Ray Zhang 10 năm trước cách đây
mục cha
commit
ec9476ad3b
58 tập tin đã thay đổi với 2600 bổ sung1114 xóa
  1. BIN
      RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/Ray.xcuserdatad/UserInterfaceState.xcuserstate
  2. 79 349
      RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/Ray.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
  3. 8 0
      RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/Ray.xcuserdatad/xcdebugger/Expressions.xcexplist
  4. 11 3
      RedAnt ERP Mobile/common/CommonEditor/CommonEditorViewController.m
  5. 1 1
      RedAnt ERP Mobile/common/Functions/MainViewController.h
  6. 79 8
      RedAnt ERP Mobile/common/Functions/MainViewController.m
  7. 4 1
      RedAnt ERP Mobile/common/Functions/PDF+Web/PDFViewController.h
  8. 200 4
      RedAnt ERP Mobile/common/Functions/PDF+Web/PDFViewController.m
  9. 2 2
      RedAnt ERP Mobile/common/Functions/camscan/ScannerViewController.m
  10. 8 5
      RedAnt ERP Mobile/common/Functions/cart/CartViewController.m
  11. 4 1
      RedAnt ERP Mobile/common/Functions/cart/ModelItemCell.h
  12. 15 7
      RedAnt ERP Mobile/common/Functions/cart/ModelItemCell.m
  13. 4 4
      RedAnt ERP Mobile/common/Functions/category/CategorySearchFilterViewController.m
  14. 6 2
      RedAnt ERP Mobile/common/Functions/category/CategoryViewController.h
  15. 12 4
      RedAnt ERP Mobile/common/Functions/category/CategoryViewController.m
  16. 1 0
      RedAnt ERP Mobile/common/Functions/contact/ContactListViewController.h
  17. 6 2
      RedAnt ERP Mobile/common/Functions/contact/CustomerInfoViewController.m
  18. 2 2
      RedAnt ERP Mobile/common/Functions/home/HomeViewController.m
  19. 8 1
      RedAnt ERP Mobile/common/Functions/modelDetail/DetailHeaderCell.h
  20. 9 4
      RedAnt ERP Mobile/common/Functions/modelDetail/DetailHeaderCell.m
  21. 36 24
      RedAnt ERP Mobile/common/Functions/modelDetail/DetailViewController.m
  22. 4 0
      RedAnt ERP Mobile/common/Functions/order/CreateOrderViewController.h
  23. 572 267
      RedAnt ERP Mobile/common/Functions/order/CreateOrderViewController.m
  24. 4 4
      RedAnt ERP Mobile/common/Functions/order/OrderDetailViewController.m
  25. 1 0
      RedAnt ERP Mobile/common/Functions/order/OrderListViewController.h
  26. 10 10
      RedAnt ERP Mobile/common/Functions/order/OrderListViewController.m
  27. 2 2
      RedAnt ERP Mobile/common/Functions/portfolio/PDFListViewController.m
  28. 6 90
      RedAnt ERP Mobile/common/Functions/portfolio/PortfolioViewController.m
  29. 2 2
      RedAnt ERP Mobile/common/Functions/portfolio/TearSheetParamViewController.m
  30. 6 4
      RedAnt ERP Mobile/common/Functions/search+itemsearch/ItemSearchViewController.m
  31. 6 5
      RedAnt ERP Mobile/common/Functions/search+itemsearch/SearchViewController.m
  32. 26 0
      RedAnt ERP Mobile/common/Functions/sidemenu/FunctionTestViewController.h
  33. 439 0
      RedAnt ERP Mobile/common/Functions/sidemenu/FunctionTestViewController.m
  34. 6 6
      RedAnt ERP Mobile/common/Functions/sidemenu/LoginViewController.m
  35. 8 89
      RedAnt ERP Mobile/common/Functions/watchlist/WatchListViewController.m
  36. 2 1
      RedAnt ERP Mobile/common/RAUtils.h
  37. 712 1
      RedAnt ERP Mobile/common/RAUtils.m
  38. 1 1
      RedAnt ERP Mobile/common/data_provider/iSalesDB.m
  39. 2 2
      RedAnt ERP Mobile/common/data_provider/iSalesNetwork.h
  40. 28 3
      RedAnt ERP Mobile/common/data_provider/iSalesNetwork.m
  41. 1 1
      RedAnt ERP Mobile/iSales-DEMO/AppDelegate.h
  42. 3 3
      RedAnt ERP Mobile/iSales-DEMO/AppDelegate.m
  43. 23 23
      RedAnt ERP Mobile/iSales-DEMO/Base.lproj/Main.storyboard
  44. 11 5
      RedAnt ERP Mobile/iSales-NPD.xcodeproj/project.pbxproj
  45. 4 4
      RedAnt ERP Mobile/iSales-NPD.xcodeproj/xcuserdata/Ray.xcuserdatad/xcschemes/RedAnt ERP Suite.xcscheme
  46. 8 1
      RedAnt ERP Mobile/iSales-NPD/AppDelegate.h
  47. 44 3
      RedAnt ERP Mobile/iSales-NPD/AppDelegate.m
  48. 125 74
      RedAnt ERP Mobile/iSales-NPD/Base.lproj/Main.storyboard
  49. 23 0
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/place_order.imageset/Contents.json
  50. BIN
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/place_order.imageset/PLACE-ORDER(1).png
  51. BIN
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/place_order.imageset/PLACE-ORDER(1)@2x.png
  52. BIN
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/place_order.imageset/PLACE-ORDER(1)@3x.png
  53. 23 0
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/taptosign_s.imageset/Contents.json
  54. BIN
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/taptosign_s.imageset/top.png
  55. BIN
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/taptosign_s.imageset/top@2x.png
  56. BIN
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/taptosign_s.imageset/top@3x.png
  57. 2 88
      RedAnt ERP Mobile/iSales-NPD/config.h
  58. 1 1
      RedAnt ERP Mobile/iSales-NPD/iSales-NPD-Info.plist

BIN
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/Ray.xcuserdatad/UserInterfaceState.xcuserstate


+ 79 - 349
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/Ray.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -9,13 +9,13 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/CommonEditor/CommonEditorViewController.m"
-            timestampString = "478164650.657051"
+            filePath = "common/Functions/sidemenu/FunctionTestViewController.m"
+            timestampString = "479793416.532987"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2154"
-            endingLineNumber = "2154"
-            landmarkName = "-tableView:cellForRowAtIndexPath:"
+            startingLineNumber = "394"
+            endingLineNumber = "394"
+            landmarkName = "-printInteractionController:choosePaper:"
             landmarkType = "5">
          </BreakpointContent>
       </BreakpointProxy>
@@ -25,13 +25,13 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/CommonEditor/CommonEditorViewController.m"
-            timestampString = "478663355.208024"
+            filePath = "common/Functions/sidemenu/FunctionTestViewController.m"
+            timestampString = "479793442.717562"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "3198"
-            endingLineNumber = "3198"
-            landmarkName = "-tableView:willSelectRowAtIndexPath:"
+            startingLineNumber = "410"
+            endingLineNumber = "410"
+            landmarkName = "-printInteractionController:choosePaper:"
             landmarkType = "5">
          </BreakpointContent>
       </BreakpointProxy>
@@ -41,13 +41,13 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/CommonEditor/CommonEditorViewController.m"
-            timestampString = "478165528.962065"
+            filePath = "common/Functions/sidemenu/FunctionTestViewController.m"
+            timestampString = "479793713.953588"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2788"
-            endingLineNumber = "2788"
-            landmarkName = "-tableView:cellForRowAtIndexPath:"
+            startingLineNumber = "407"
+            endingLineNumber = "407"
+            landmarkName = "-printInteractionController:choosePaper:"
             landmarkType = "5">
          </BreakpointContent>
       </BreakpointProxy>
@@ -57,221 +57,13 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/MainViewController.m"
-            timestampString = "478166068.982562"
+            filePath = "common/Functions/sidemenu/FunctionTestViewController.m"
+            timestampString = "479793729.388016"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "361"
-            endingLineNumber = "361"
-            landmarkName = "-onContactClick:"
-            landmarkType = "5">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            shouldBeEnabled = "No"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "common/Functions/contact/CustomerEditViewController.m"
-            timestampString = "478166394.046739"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "222"
-            endingLineNumber = "222"
-            landmarkName = "-onSaveClick:"
-            landmarkType = "5">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            shouldBeEnabled = "No"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "common/CommonEditor/CommonEditorViewController.m"
-            timestampString = "478666586.354095"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "4326"
-            endingLineNumber = "4326"
-            landmarkName = "-imgIsChanged:url_up:indexPath:index:url_index:"
-            landmarkType = "5">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            shouldBeEnabled = "No"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "common/CommonEditor/CommonEditorCellImg.m"
-            timestampString = "478167792.259007"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "52"
-            endingLineNumber = "52"
-            landmarkName = "-TouchImageViewOnTouche:"
-            landmarkType = "5">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            shouldBeEnabled = "No"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "common/CommonEditor/CommonEditorCellImg.m"
-            timestampString = "478167941.293454"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "25"
-            endingLineNumber = "25"
-            landmarkName = "-awakeFromNib"
-            landmarkType = "5">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            shouldBeEnabled = "No"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "common/CommonEditor/CommonEditorViewController.m"
-            timestampString = "478168117.378898"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2272"
-            endingLineNumber = "2272"
-            landmarkName = "-tableView:cellForRowAtIndexPath:"
-            landmarkType = "5">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            shouldBeEnabled = "No"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "common/CommonEditor/CommonEditorViewController.m"
-            timestampString = "478168123.785083"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2331"
-            endingLineNumber = "2331"
-            landmarkName = "-tableView:cellForRowAtIndexPath:"
-            landmarkType = "5">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            shouldBeEnabled = "No"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "common/CommonEditor/CommonEditorViewController.m"
-            timestampString = "478168130.829253"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2390"
-            endingLineNumber = "2390"
-            landmarkName = "-tableView:cellForRowAtIndexPath:"
-            landmarkType = "5">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            shouldBeEnabled = "No"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "common/CommonEditor/CommonEditorViewController.m"
-            timestampString = "478168226.598127"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2269"
-            endingLineNumber = "2269"
-            landmarkName = "-tableView:cellForRowAtIndexPath:"
-            landmarkType = "5">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            shouldBeEnabled = "No"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "common/CommonEditor/CommonEditorViewController.m"
-            timestampString = "478168230.20609"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2328"
-            endingLineNumber = "2328"
-            landmarkName = "-tableView:cellForRowAtIndexPath:"
-            landmarkType = "5">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            shouldBeEnabled = "No"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "common/CommonEditor/CommonEditorViewController.m"
-            timestampString = "478168230.952255"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2330"
-            endingLineNumber = "2330"
-            landmarkName = "-tableView:cellForRowAtIndexPath:"
-            landmarkType = "5">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            shouldBeEnabled = "No"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "common/CommonEditor/CommonEditorViewController.m"
-            timestampString = "478168236.556496"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2387"
-            endingLineNumber = "2387"
-            landmarkName = "-tableView:cellForRowAtIndexPath:"
-            landmarkType = "5">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            shouldBeEnabled = "No"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "common/data_provider/iSalesNetwork.m"
-            timestampString = "478238229.244427"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "992"
-            endingLineNumber = "992"
-            landmarkName = "+save_Order:"
-            landmarkType = "5">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            shouldBeEnabled = "No"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "common/Functions/order/OrderDetailViewController.m"
-            timestampString = "478504413.934616"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1290"
-            endingLineNumber = "1290"
-            landmarkName = "-tableView:cellForRowAtIndexPath:"
+            startingLineNumber = "395"
+            endingLineNumber = "395"
+            landmarkName = "-printInteractionController:choosePaper:"
             landmarkType = "5">
          </BreakpointContent>
       </BreakpointProxy>
@@ -282,27 +74,11 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "common/Functions/order/CreateOrderViewController.m"
-            timestampString = "478667156.655383"
+            timestampString = "479875551.741967"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "652"
-            endingLineNumber = "652"
-            landmarkName = "-alertView:clickedButtonAtIndex:"
-            landmarkType = "5">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "common/Functions/order/CreateOrderViewController.m"
-            timestampString = "478667156.655383"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "731"
-            endingLineNumber = "731"
+            startingLineNumber = "845"
+            endingLineNumber = "845"
             landmarkName = "-alertView:clickedButtonAtIndex:"
             landmarkType = "5">
          </BreakpointContent>
@@ -314,27 +90,11 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "common/Functions/order/CreateOrderViewController.m"
-            timestampString = "478667156.655383"
+            timestampString = "479798976.892655"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "813"
-            endingLineNumber = "813"
-            landmarkName = "-alertView:clickedButtonAtIndex:"
-            landmarkType = "5">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            shouldBeEnabled = "No"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "common/Functions/order/CreateOrderViewController.m"
-            timestampString = "478667156.655383"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "814"
-            endingLineNumber = "814"
+            startingLineNumber = "659"
+            endingLineNumber = "659"
             landmarkName = "-alertView:clickedButtonAtIndex:"
             landmarkType = "5">
          </BreakpointContent>
@@ -345,13 +105,13 @@
             shouldBeEnabled = "Yes"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/order/CreateOrderViewController.m"
-            timestampString = "478667156.655383"
+            filePath = "common/Functions/sidemenu/FunctionTestViewController.m"
+            timestampString = "479806607.767167"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "891"
-            endingLineNumber = "891"
-            landmarkName = "-alertView:clickedButtonAtIndex:"
+            startingLineNumber = "352"
+            endingLineNumber = "352"
+            landmarkName = "-searchForPrinters"
             landmarkType = "5">
          </BreakpointContent>
       </BreakpointProxy>
@@ -361,13 +121,13 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/order/CreateOrderViewController.m"
-            timestampString = "478667156.655383"
+            filePath = "common/Functions/sidemenu/FunctionTestViewController.m"
+            timestampString = "479872745.32574"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "832"
-            endingLineNumber = "832"
-            landmarkName = "-alertView:clickedButtonAtIndex:"
+            startingLineNumber = "58"
+            endingLineNumber = "58"
+            landmarkName = "-startAirPrintWithData:"
             landmarkType = "5">
          </BreakpointContent>
       </BreakpointProxy>
@@ -377,13 +137,13 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/cart/CartViewController.m"
-            timestampString = "478510186.274658"
+            filePath = "common/Functions/sidemenu/FunctionTestViewController.m"
+            timestampString = "479872767.600379"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1239"
-            endingLineNumber = "1239"
-            landmarkName = "-tableView:cellForRowAtIndexPath:"
+            startingLineNumber = "60"
+            endingLineNumber = "60"
+            landmarkName = "-startAirPrintWithData:"
             landmarkType = "5">
          </BreakpointContent>
       </BreakpointProxy>
@@ -393,12 +153,14 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/const.h"
-            timestampString = "478593190.010623"
+            filePath = "iSales-NPD/AppDelegate.m"
+            timestampString = "479874795.405073"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "88"
-            endingLineNumber = "88">
+            startingLineNumber = "1008"
+            endingLineNumber = "1008"
+            landmarkName = "-printPdf:"
+            landmarkType = "5">
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
@@ -407,14 +169,14 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/category/CategoryViewController.m"
-            timestampString = "478857813.279636"
+            filePath = "common/Functions/category/CategoryViewController.h"
+            timestampString = "479894333.783505"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "252"
-            endingLineNumber = "252"
-            landmarkName = "-onSelectAllClick:"
-            landmarkType = "5">
+            startingLineNumber = "63"
+            endingLineNumber = "63"
+            landmarkName = "handler"
+            landmarkType = "19">
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
@@ -423,62 +185,30 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/category/CategoryViewController.m"
-            timestampString = "478857813.279636"
+            filePath = "common/RAUtils.m"
+            timestampString = "479897210.632006"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "251"
-            endingLineNumber = "251"
-            landmarkName = "-onSelectAllClick:"
+            startingLineNumber = "293"
+            endingLineNumber = "293"
+            landmarkName = "+add_to_cart:selector:"
             landmarkType = "5">
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
-            shouldBeEnabled = "Yes"
+            shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/Functions/category/CategoryViewController.m"
-            timestampString = "478857813.279636"
+            filePath = "common/RAUtils.m"
+            timestampString = "479897210.632006"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "267"
-            endingLineNumber = "267"
-            landmarkName = "-onAddCartClick:"
+            startingLineNumber = "297"
+            endingLineNumber = "297"
+            landmarkName = "+add_to_cart:selector:"
             landmarkType = "5">
-            <Locations>
-               <Location
-                  shouldBeEnabled = "Yes"
-                  ignoreCount = "0"
-                  continueAfterRunningActions = "No"
-                  symbolName = "-[CategoryViewController onAddCartClick:]"
-                  moduleName = "NPD iSales"
-                  usesParentBreakpointCondition = "Yes"
-                  urlString = "file:///ios_workspace/RedAnt%20ERP%20Mobile/common/Functions/category/CategoryViewController.m"
-                  timestampString = "478859268.286193"
-                  startingColumnNumber = "9223372036854775807"
-                  endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "269"
-                  endingLineNumber = "269"
-                  offsetFromSymbolStart = "321">
-               </Location>
-               <Location
-                  shouldBeEnabled = "Yes"
-                  ignoreCount = "0"
-                  continueAfterRunningActions = "No"
-                  symbolName = "__41-[CategoryViewController onAddCartClick:]_block_invoke"
-                  moduleName = "NPD iSales"
-                  usesParentBreakpointCondition = "Yes"
-                  urlString = "file:///ios_workspace/RedAnt%20ERP%20Mobile/common/Functions/category/CategoryViewController.m"
-                  timestampString = "478859268.286581"
-                  startingColumnNumber = "9223372036854775807"
-                  endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "278"
-                  endingLineNumber = "278"
-                  offsetFromSymbolStart = "36">
-               </Location>
-            </Locations>
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
@@ -487,29 +217,29 @@
             shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/CommonEditor/CommonEditorViewController.m"
-            timestampString = "478662827.205981"
+            filePath = "common/RAUtils.m"
+            timestampString = "479900171.052357"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "3041"
-            endingLineNumber = "3041"
-            landmarkName = "-tableView:cellForRowAtIndexPath:"
+            startingLineNumber = "412"
+            endingLineNumber = "412"
+            landmarkName = "+add_to_cart:selector:"
             landmarkType = "5">
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
-            shouldBeEnabled = "Yes"
+            shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "common/CommonEditor/CommonEditorViewController.m"
-            timestampString = "478663355.208024"
+            filePath = "common/RAUtils.m"
+            timestampString = "479897210.632006"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "3096"
-            endingLineNumber = "3096"
-            landmarkName = "-tableView:cellForRowAtIndexPath:"
+            startingLineNumber = "299"
+            endingLineNumber = "299"
+            landmarkName = "+add_to_cart:selector:"
             landmarkType = "5">
          </BreakpointContent>
       </BreakpointProxy>
@@ -520,12 +250,12 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "common/Functions/category/CategoryViewController.m"
-            timestampString = "478858023.547345"
+            timestampString = "479896517.926831"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "151"
-            endingLineNumber = "151"
-            landmarkName = "-onFilterClicked:"
+            startingLineNumber = "560"
+            endingLineNumber = "560"
+            landmarkName = "-addtocart"
             landmarkType = "5">
          </BreakpointContent>
       </BreakpointProxy>

+ 8 - 0
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/Ray.xcuserdatad/xcdebugger/Expressions.xcexplist

@@ -10,5 +10,13 @@
             </PersistentString>
          </PersistentStrings>
       </ContextState>
+      <ContextState
+         contextName = "-[FunctionTestViewController printInteractionController:choosePaper:]:FunctionTestViewController.m">
+         <PersistentStrings>
+            <PersistentString
+               value = "paper.paperSize">
+            </PersistentString>
+         </PersistentStrings>
+      </ContextState>
    </ContextStates>
 </VariablesViewState>

+ 11 - 3
RedAnt ERP Mobile/common/CommonEditor/CommonEditorViewController.m

@@ -2542,15 +2542,23 @@
                 {
                     CellIdentifier = @"CommonEditorCellLabel";
                     CommonEditorCellLabel * cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
+                    
+                    //CGRect titleframe = cell.labelTitle.frame;
+                    
                     NSString* title = [item_json valueForKey:@"aname"] ;
                     NSString* value =[item_json valueForKey:@"value"];
                     
                     NSString* align =[item_json valueForKey:@"align"];
                     if([align isEqualToString:@"right"])
+                    {
+                        cell.labelTitle.frame =CGRectMake(15,11,350,21);
                         cell.labelValue.textAlignment= NSTextAlignmentRight;
+                    }
                     else
+                    {
+                        cell.labelTitle.frame =CGRectMake(15,11,150,21);
                         cell.labelValue.textAlignment =NSTextAlignmentLeft;
-                    
+                    }
                     
                     NSString* type=[item_json valueForKey:@"type"] ;
                     
@@ -2860,7 +2868,7 @@
             
             cell.labelDiscount.text = discountstr;
             cell.labelOldPrice.text = oldprice;
-            cell.labelMasterPack.text =[NSString stringWithFormat:@"Master pack:%d", stockUom];
+            cell.labelMasterPack.text =[NSString stringWithFormat:@"Sold in QTY of:%d", stockUom];
             
             bool isfree = [[item_json valueForKey:@"is_free"]boolValue];
             
@@ -3079,7 +3087,7 @@
                             cell.imageviewSignature.image=img ;
                         }
                         else
-                            cell.imageviewSignature.image=[UIImage imageNamed:@"notfound_s"];
+                            cell.imageviewSignature.image=[UIImage imageNamed:@"taptosign_s"];
                         
                         
                     });

+ 1 - 1
RedAnt ERP Mobile/common/Functions/MainViewController.h

@@ -109,7 +109,7 @@
 -(void) logoutCategory;
 
 -(void) switchToPreviousVC;
--(void) Loginout;
+-(void) Loginout:(bool)showlogin;
 -(void) switchToOrder;
 -(void) switchToCart;
 -(void)switchToHome;

+ 79 - 8
RedAnt ERP Mobile/common/Functions/MainViewController.m

@@ -20,6 +20,9 @@
 #import "ScannerSettingViewController.h"
 
 #import "ActiveViewController.h"
+#import "WebViewController.h"
+
+#import "FunctionTestViewController.h"
 
 @interface MainViewController ()
 
@@ -224,9 +227,9 @@
     self.sideMenu_UserName.text =appDelegate.user;
     
     if(appDelegate.bLogin)
-        [self.btnLogin setTitle:@"Logout" forState:UIControlStateNormal];
+        [self.btnLogin setTitle:@"Sign out" forState:UIControlStateNormal];
     else
-        [self.btnLogin setTitle:@"Login" forState:UIControlStateNormal];
+        [self.btnLogin setTitle:@"Sign in" forState:UIControlStateNormal];
     [iSalesNetwork LoadImage:appDelegate.user_icon into:self.user_head ];
     
     if(appDelegate.user_type==USER_ROLE_EMPLOYEE)
@@ -535,14 +538,14 @@
     //    [self showMenu];
     
 }
--(void) Loginout
+-(void) Loginout:(bool)showlogin
 {
     UIApplication * app = [UIApplication sharedApplication];
     AppDelegate *appDelegate = (AppDelegate *)[app delegate];
     
     if(appDelegate.bLogin)
     {
-        UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait" title:@"Logout"];
+        UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait" title:@"Sign out"];
         dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
             
             NSDictionary* return_json = [iSalesNetwork logout];
@@ -556,6 +559,9 @@
                     [self hideMenu];
                     [self switchToHome:nil];
                     [appDelegate Logout];
+                    
+                    if(showlogin)
+                    {
                     LoginViewController * loginvc =[ self.storyboard instantiateViewControllerWithIdentifier:@"LoginViewController"];
                     loginvc.returnValue = ^(bool blogin){
                         
@@ -576,6 +582,7 @@
                         NSLog(@"login present.........");
                         
                     }];
+                    }
                 }
                 else
                 {
@@ -615,7 +622,7 @@
 - (IBAction)OnLoginClick:(UIButton *)sender {
     
     
-    [self Loginout];
+    [self Loginout:true];
 
     
     
@@ -856,7 +863,7 @@
     
     self.sideMenu_UserName.text =appDelegate.user;
     
-    [self.btnLogin setTitle:@"Logout" forState:UIControlStateNormal];
+    [self.btnLogin setTitle:@"Sign out" forState:UIControlStateNormal];
     
     [iSalesNetwork LoadImage:appDelegate.user_icon into:self.user_head ];
     
@@ -1110,7 +1117,7 @@
                     if(appDelegate.can_create_order)
                     {
                         
-                        NSString* msg =@"Do you want to switch to a pending order or a new order?";
+                        NSString* msg =@"";
                         if(appDelegate.contact_id.length>0)
                         {
                             msg = [msg stringByAppendingString:@"\n\nCustomer:"];
@@ -1174,7 +1181,7 @@
             [self checklogin:false];
             if(appDelegate.can_create_order)
             {
-                NSString* msg =@"Do you want to switch to a pending order or a new order?";
+                NSString* msg =@"";
                 if(appDelegate.contact_id.length>0)
                 {
                     msg = [msg stringByAppendingString:@"\n\nCustomer:"];
@@ -1567,10 +1574,30 @@
 //        
 //    }
     
+//    if([[appDelegate.user lowercaseString] isEqualToString:@"larryl"]||[[appDelegate.user lowercaseString] isEqualToString:@"arpithat"])
+//    {
+//        //        [map setValue:@"Contact" forKey:@"title"];
+//        //        [map setValue:@"rect_contact_list" forKey:@"img"];
+//        //        [self.sideMenuItems addObject:map.copy];
+//        
+//        
+//        [map setValue:@"Function Test" forKey:@"title"];
+//        [map setValue:@"rect_market_news" forKey:@"img"];
+//        [self.sideMenuItems addObject:map.copy];
+//        
+//
+//    }
+//    
+    
     [map setValue:@"About" forKey:@"title"];
     [map setValue:@"rect_change_password" forKey:@"img"];
     [self.sideMenuItems addObject:map.copy];
     
+    
+    [map setValue:@"NPD Website" forKey:@"title"];
+    [map setValue:@"rect_change_password" forKey:@"img"];
+    [self.sideMenuItems addObject:map.copy];
+    
     [self.sideMenuTable reloadData];
     
     //
@@ -1812,8 +1839,52 @@
         
         [iSalesDB testdata];
         
+    }
+    else if([title isEqualToString:@"Function Test"])
+    {
+        
+//        NSString* url = @"https://www.newpacificdirect.com";
+//        
+//        
+//        NSString* title = @"NPD";
+        //        UIApplication * app = [UIApplication sharedApplication];
+        //        AppDelegate *appDelegate = (AppDelegate *)[app delegate];
+        //        MainViewController* main_vc=(MainViewController*)appDelegate.main_vc;
+        //
+        //
+        
+        FunctionTestViewController *ViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"FunctionTestViewController"];
+//        ViewController.url = url;
+//        ViewController.title = title;
+        
+        
+        
+        [self.navigationController pushViewController:ViewController animated:YES];
+        
     }
     
+    else if([title isEqualToString:@"NPD Website"])
+    {
+        
+        NSString* url = @"https://www.newpacificdirect.com";
+        
+        
+        NSString* title = @"NPD";
+        //        UIApplication * app = [UIApplication sharedApplication];
+        //        AppDelegate *appDelegate = (AppDelegate *)[app delegate];
+        //        MainViewController* main_vc=(MainViewController*)appDelegate.main_vc;
+        //
+        //
+        
+        WebViewController *ViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"WebViewController"];
+        ViewController.url = url;
+        ViewController.title = title;
+        
+        
+        
+        [self.navigationController pushViewController:ViewController animated:YES];
+        
+    }
     else if([title isEqualToString:@"About"])
     {
         

+ 4 - 1
RedAnt ERP Mobile/common/Functions/PDF+Web/PDFViewController.h

@@ -8,7 +8,7 @@
 
 #import <UIKit/UIKit.h>
 #import <MessageUI/MessageUI.h>
-@interface PDFViewController : UIViewController<UIDocumentInteractionControllerDelegate,MFMailComposeViewControllerDelegate>
+@interface PDFViewController : UIViewController<UIDocumentInteractionControllerDelegate,MFMailComposeViewControllerDelegate,UIPrintInteractionControllerDelegate>
 @property (strong, nonatomic) IBOutlet UIWebView *webView;
 @property (strong, nonatomic) IBOutlet UIActivityIndicatorView *mum;
 @property (strong,nonatomic) NSString* url;
@@ -31,6 +31,9 @@
 @property (strong, nonatomic)  UIBarButtonItem *btnsave;
 
 
+@property bool autoPrint;
+@property bool hidenavi;
+
 @property bool canSave;
 @property (strong,nonatomic) NSString* attachment_name;
 @end

+ 200 - 4
RedAnt ERP Mobile/common/Functions/PDF+Web/PDFViewController.m

@@ -9,6 +9,8 @@
 #import "PDFViewController.h"
 #import "RAUtils.h"
 #import "const.h"
+#import "AppDelegate.h"
+
 @interface PDFViewController ()
 
 @end
@@ -184,11 +186,19 @@
                 
                 if(self.onLoadSuccess)
                     self.onLoadSuccess(self.url);
+                
+                if(self.autoPrint)
+                    [self startAirPrintWithData:self.content];
+                
+                
  //               int a=0;
             }
             else
             {
                 [RAUtils message_alert:nil  title:@"Open PDF Failed" controller:self];
+                
+                if(self.autoPrint)
+                    [self.navigationController popViewControllerAnimated:true];
 //                self.content = [self.url dataUsingEncoding:NSUTF8StringEncoding];
             }
             
@@ -223,7 +233,14 @@
     [super didReceiveMemoryWarning];
     // Dispose of any resources that can be recreated.
 }
-
+-(void) viewWillAppear:(BOOL)animated
+{
+    
+    
+    [super viewWillAppear:animated];
+  
+    [[self navigationController] setNavigationBarHidden:self.hidenavi animated:NO];
+}
 - (IBAction)onActionClick:(id)sender {
    
     //NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
@@ -445,12 +462,191 @@
 /*
 #pragma mark - Navigation
 
-// In a storyboard-based application, you will often want to do a little preparation before navigation
+ In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
 {
-    // Get the new view controller using [segue destinationViewController].
-    // Pass the selected object to the new view controller.
+     Get the new view controller using [segue destinationViewController].
+     Pass the selected object to the new view controller.
 }
 */
+- (void)startAirPrintWithData:(id )data
+{
+
+
+    UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait..." title:@"Prepare printing..."];
+
+    UIPrintInteractionController* airPrinterController=[UIPrintInteractionController sharedPrintController];
+    UIPrintInfo *printInfo = [UIPrintInfo printInfo];
+    printInfo.outputType = UIPrintInfoOutputGeneral;
+    printInfo.orientation = UIPrintInfoOrientationPortrait;
+    printInfo.jobName = @"CoolVisitAirPrint";
+    airPrinterController.printInfo = printInfo;
+    airPrinterController.printingItem = data;
+    airPrinterController.delegate = self;
+
+
+    airPrinterController.showsNumberOfCopies=true;
+    airPrinterController.showsPageRange = true;
+    airPrinterController.showsPaperSelectionForLoadedPapers=true;
+
+    void (^completionHandler)(UIPrintInteractionController *, BOOL, NSError *) = ^(UIPrintInteractionController *printController, BOOL completed, NSError *error) {
+        if(completed && error)
+            NSLog(@"Printing failed due to error in domain %@ with error code %lu. Localized description: %@, and failure reason: %@", error.domain, (long)error.code, error.localizedDescription, error.localizedFailureReason);
+    };
+
+    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+
+    UIPrinter *airPrinter = [UIPrinter printerWithURL:[NSURL URLWithString:appDelegate.printerURL] ];///*self.printer;*/
+
+
+
+
+    [[UIPrinter printerWithURL:[NSURL URLWithString:appDelegate.printerURL]] contactPrinter:^(BOOL available)
+     {
+         [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
+         
+         if (available&& appDelegate.printerURL.length>0)
+         {
+             
+
+             [airPrinterController printToPrinter:airPrinter completionHandler:completionHandler];
+             NSLog(@"AIRPRINTER AVAILABLE");
+         }
+         else
+         {
+
+             //             [airPrinterController presentFromRect:CGRectMake(0, 0, 300, 500) inView:self.view animated:YES completionHandler:
+             //
+             //
+             //
+             //              //        [printPicker presentAnimated:YES completionHandler:
+             //              ^(UIPrintInteractionController *printerController, BOOL userDidSelect, NSError *error)
+             //              {
+             //                  if (userDidSelect)
+             //                  {
+             //                      NSString* sid= printerController.printInfo.printerID;
+             //                      UIPrintPaper*paper=  printerController.printPaper;
+             //
+             //                  }
+             //              }];
+
+
+             NSLog(@"AIRPRINTER NOT AVAILABLE");
+
+
+
+             if (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_7_1)
+             {
+                 UIPrinterPickerController *printPicker = [UIPrinterPickerController printerPickerControllerWithInitiallySelectedPrinter:nil];
+              //   [printPicker presentFromBarButtonItem:self.btnSubmitOrder animated:yes completionHandler:
+
+
+
+                [ printPicker presentFromBarButtonItem:self.btnshare animated:YES completionHandler:
+
+
+                // [printPicker presentFromRect:CGRectMake(0, 0, 300, 500) inView:self.view animated:YES completionHandler:
+
+
+
+                  //        [printPicker presentAnimated:YES completionHandler:
+                  ^(UIPrinterPickerController *printerPicker, BOOL userDidSelect, NSError *error)
+                  {
+                      if (userDidSelect)
+                      {
+                          //User selected the item in the UIPrinterPickerController and got the printer details.
+
+                          [UIPrinterPickerController printerPickerControllerWithInitiallySelectedPrinter:printerPicker.selectedPrinter];
+
+                          //Here you will get the printer and printer details.ie,
+                          // printerPicker.selectedPrinter, printerPicker.selectedPrinter.displayName, printerPicker.selectedPrinter.URL etc. So you can display the printer name in your label text or button title.
+
+
+
 
+                          appDelegate.printerURL =printerPicker.selectedPrinter.URL.absoluteString;
+
+                          [self startAirPrintWithData:data];
+
+                      }
+                      else
+                      {
+
+
+//                          AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+//                          if([appDelegate.mode isEqualToString:@"Trade Show Mode"]&& appDelegate.submit_order_logout)
+//                          {
+//
+//                              [((MainViewController*)appDelegate.main_vc) Loginout:false];
+//                          }
+//                          [self prepareReturn:nil];
+
+                          [self.navigationController popViewControllerAnimated:true];
+                      }
+                  }];
+             }
+         }
+     }];
+
+
+
+}
+
+#pragma mark - UIPrintInteractionControllerDelegate
+- (UIPrintPaper *)printInteractionController:(UIPrintInteractionController *)printInteractionController choosePaper:(NSArray<UIPrintPaper *> *)paperList
+{
+
+    ;
+
+    //    (int) width = 29700
+    //    Printing description of (*( (int *)0x7caa3a40)):
+    //    (int) height = 42000
+    //设置纸张大小
+
+
+    for(UIPrintPaper* paper in paperList)
+    {
+        if (CGSizeEqualToSize(paper.paperSize, CGSizeMake(612, 792)))
+            return paper;
+
+    }
+    CGSize paperSize = CGSizeMake(612, 792);
+    UIPrintPaper * p=[UIPrintPaper bestPaperForPageSize:paperSize withPapersFromArray:paperList];
+    return p;
+}
+- (void)printInteractionControllerWillPresentPrinterOptions:(UIPrintInteractionController *)printInteractionController
+{
+
+}
+- (void)printInteractionControllerDidPresentPrinterOptions:(UIPrintInteractionController *)printInteractionController
+{
+
+}
+- (void)printInteractionControllerWillDismissPrinterOptions:(UIPrintInteractionController *)printInteractionController
+{
+
+}
+- (void)printInteractionControllerDidDismissPrinterOptions:(UIPrintInteractionController *)printInteractionController
+{
+
+}
+
+- (void)printInteractionControllerWillStartJob:(UIPrintInteractionController *)printInteractionController
+{
+
+}
+- (void)printInteractionControllerDidFinishJob:(UIPrintInteractionController *)printInteractionController
+{
+
+//    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+//    if([appDelegate.mode isEqualToString:@"Trade Show Mode"]&& appDelegate.submit_order_logout)
+//    {
+//
+//        [((MainViewController*)appDelegate.main_vc) Loginout:false];
+//    }
+//
+//    [self prepareReturn:nil];
+
+    [self.navigationController popViewControllerAnimated:true];
+}
 @end

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

@@ -512,7 +512,7 @@
             
             if(appDelegate.can_create_order)
             {
-                NSString* msg =@"Do you want to switch to a pending order or a new order?";
+                NSString* msg =@"";
                 if(appDelegate.contact_id.length>0)
                 {
                     msg = [msg stringByAppendingString:@"\n\nCustomer:"];
@@ -526,7 +526,7 @@
             }
             else
             {
-                UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:NSLocalizedString(@"Do you want to add to a pending order?", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Add to pending order", nil), nil];
+                UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:NSLocalizedString(@"", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Add to pending order", nil), nil];
                 
                 // alert.
                 [alert show];

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

@@ -123,7 +123,7 @@
         UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait..." title:@"Add To Wishlist"];
         dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
             
-            NSDictionary* cart_json = [iSalesNetwork add_toWatchList:ids];
+            NSDictionary* cart_json = [iSalesNetwork move_cart2wish:ids];
             
             dispatch_async(dispatch_get_main_queue(), ^{
                 
@@ -871,7 +871,7 @@
             
             double cuft=count*[[item_json valueForKey:@"cuft"] doubleValue];
             double weight=count*[[item_json valueForKey:@"weight"] doubleValue];
-            int carton=count*[[item_json valueForKey:@"carton"] intValue];
+            int carton=/*count**/[[item_json valueForKey:@"carton"] intValue];
             
             int item_count=1;
             
@@ -1163,7 +1163,7 @@
 }
 - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
 {
-    return 33;
+    return 40;
 }
 - (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
 {
@@ -1308,7 +1308,7 @@
             cell.labelDiscount.hidden = false;
         }
     }
-    cell.onReturnQTY=^(int qty)
+    cell.onReturnQTY=^(int qty,NSDictionary* ext)
     {
         NSMutableDictionary * item_json = [self.content_arr[indexPath.row] mutableCopy];//[[self.content_data objectForKey:[NSString stringWithFormat:@"item_%ld",(long)indexPath.row]] mutableCopy];
         
@@ -1317,6 +1317,9 @@
         if(count==qty)
             return;
         [item_json setValue:[NSString stringWithFormat:@"%d",qty] forKey:@"count"];
+        [item_json setValue:[ext valueForKey:@"cuft"] forKey:@"cuft"];
+                [item_json setValue:[ext valueForKey:@"carton"] forKey:@"carton"];
+                [item_json setValue:[ext valueForKey:@"weight"] forKey:@"weight"];
         double unit_price = [[item_json valueForKey:@"unit_price"] doubleValue];
         //   double sub_total=[[item_json valueForKey:@"subtotal_price"] doubleValue];
         [item_json setValue:[NSString stringWithFormat:@"%f",unit_price*qty] forKey:@"subtotal_price"];
@@ -1349,7 +1352,7 @@
     cell.labelDiscount.text = discountstr;
     cell.labelOldPrice.text = oldprice;
     
-    cell.labelMasterpack.text =[NSString stringWithFormat:@"Master pack:%d", stockUom];
+    cell.labelMasterpack.text =[NSString stringWithFormat:@"Sold in QTY of:%d", stockUom];
     
     cell.labelDescription.text = description;
     //   cell.labelIdentifier.text = identifier;

+ 4 - 1
RedAnt ERP Mobile/common/Functions/cart/ModelItemCell.h

@@ -53,7 +53,10 @@
 
 @property (strong, nonatomic) IBOutlet UILabel *labelNoSuchModel;
 
-@property (nonatomic , copy) void (^onReturnQTY)(int qty);
+@property (nonatomic , copy) void (^onReturnQTY)(int qty , NSDictionary* ext);
+
+
+//@property (strong,nonatomic) NSString* last_edit;
 
 //@property int step;
 //@property int quantity;

+ 15 - 7
RedAnt ERP Mobile/common/Functions/cart/ModelItemCell.m

@@ -68,7 +68,7 @@
                 if([[cart_json valueForKey:@"result"] intValue]==2)
                 {
                     if(self.onReturnQTY)
-                        self.onReturnQTY(sender.value);
+                        self.onReturnQTY(sender.value,cart_json);
 //                    
 //                    if (self.delegate && [self.delegate respondsToSelector:@selector(returnQTY:)]) {
 //                        [self.delegate returnQTY:sender.value ];
@@ -101,7 +101,7 @@
                 if([[cart_json valueForKey:@"result"] intValue]==2)
                 {
                     if(self.onReturnQTY)
-                        self.onReturnQTY(sender.value);
+                        self.onReturnQTY(sender.value,cart_json);
                 }
                 else
                 {
@@ -125,7 +125,7 @@
                 if([[cart_json valueForKey:@"result"] intValue]==2)
                 {
                     if(self.onReturnQTY)
-                        self.onReturnQTY(sender.value);
+                        self.onReturnQTY(sender.value,cart_json);
 //                    if (self.delegate && [self.delegate respondsToSelector:@selector(returnQTY:)]) {
 //                        [self.delegate returnQTY:sender.value ];
 //                    }
@@ -304,6 +304,9 @@
 }
 - (void)textFieldDidEndEditing:(UITextField *)textField
 {
+    
+    
+    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
     int qty = [textField.text intValue];
     
     if(qty==0)
@@ -315,7 +318,7 @@
         int c=qty;
         
         int m=c%(int)(self.stepper.stepValue);
-        if(m!=0)
+        if(m!=0&&appDelegate.alert_sold_in_quantities)
         {
             
             
@@ -343,7 +346,7 @@
                             //                }
                             
                             if(self.onReturnQTY)
-                                self.onReturnQTY(qty);
+                                self.onReturnQTY(qty,cart_json);
                         }
                         else
                         {
@@ -360,6 +363,7 @@
             
             UIAlertAction *alertthree = [UIAlertAction actionWithTitle:@"No" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
                 NSLog(@"No");
+                textField.text = [NSString stringWithFormat:@"%d",self.pre_val];
             }];
             [alertControl addAction:actionOne];
             
@@ -392,7 +396,7 @@
                         //                }
                         
                         if(self.onReturnQTY)
-                            self.onReturnQTY(qty);
+                            self.onReturnQTY(qty,cart_json);
                     }
                     else
                     {
@@ -418,8 +422,12 @@
 
 - (void)textFieldDidBeginEditing:(UITextField *)textField
 {
+    NSString* text = textField.text;
+    if(text.length==0)
+        text=@"0";
+    self.pre_val = [textField.text intValue];
     
-//    self.lastedit = textField;
+   // self.last_edit = textField.text;
 }
 
 @end

+ 4 - 4
RedAnt ERP Mobile/common/Functions/category/CategorySearchFilterViewController.m

@@ -156,7 +156,7 @@
     //        else
     //        enumvc.canbeEmpty =true;
     enumvc.cadedate = [self.availability_cadedate mutableCopy];
-    enumvc.title = @"Select";
+    enumvc.title = @"";
     //       enumvc.value = [value_json mutableCopy];
     enumvc.single_select =true;
     
@@ -193,7 +193,7 @@
     //        else
     //        enumvc.canbeEmpty =true;
     enumvc.cadedate = [self.qty_cadedate mutableCopy];
-    enumvc.title = @"Select";
+    enumvc.title = @"";
     //       enumvc.value = [value_json mutableCopy];
     enumvc.single_select =true;
     
@@ -230,7 +230,7 @@
     //        else
     //        enumvc.canbeEmpty =true;
     enumvc.cadedate = [self.price_cadedate mutableCopy];
-    enumvc.title = @"Select";
+    enumvc.title = @"";
     //       enumvc.value = [value_json mutableCopy];
     enumvc.single_select =true;
     
@@ -274,7 +274,7 @@
     //        else
     //        enumvc.canbeEmpty =true;
     enumvc.cadedate = [self.alert_cadedate mutableCopy];
-    enumvc.title = @"Select";
+    enumvc.title = @"";
     //       enumvc.value = [value_json mutableCopy];
     enumvc.single_select =true;
     

+ 6 - 2
RedAnt ERP Mobile/common/Functions/category/CategoryViewController.h

@@ -12,6 +12,10 @@
 #import "EnumSelectViewController.h"
 #import "RAViewController.h"
 #import "ActiveViewController.h"
+
+typedef void (^add_to_cart_Handler)(void);
+
+
 @interface CategoryViewController : ActiveViewController<UICollectionViewDataSource,UICollectionViewDelegate,UICollectionViewDelegateFlowLayout/*,UITableViewDataSource,UITableViewDelegate*/,UIScrollViewDelegate,/*SearchFilterDelegate,*/CategoryMenuDelegate,UIAlertViewDelegate>
 @property (strong, nonatomic) IBOutlet UIView *headerView;
 @property (strong, nonatomic) IBOutlet UICollectionView *collectionview;
@@ -55,7 +59,7 @@
 @property (strong,nonatomic) NSString* p_available;
 @property (strong,nonatomic) NSString* p_QTY;
 @property (strong,nonatomic) NSString* p_price;
-
-
+//@property (copy, nonatomic)void (^add_to_cart_Handler)(void);
+@property (copy, nonatomic) add_to_cart_Handler handler;
 //@property bool disable_refresh;
 @end

+ 12 - 4
RedAnt ERP Mobile/common/Functions/category/CategoryViewController.m

@@ -256,6 +256,14 @@
 }
 - (IBAction)onAddCartClick:(id)sender {
     
+   // self.add_to_cart_Handler();
+//    self.handler = [self addtocart];
+//    
+//    
+//    
+//    
+    [RAUtils add_to_cart:self selector:@selector(addtocart)];
+    return;
     
     UIApplication * app = [UIApplication sharedApplication];
     AppDelegate *appDelegate = (AppDelegate *)[app delegate];
@@ -283,7 +291,7 @@
                     [main_vc checklogin:false];
                     if(appDelegate.can_create_order)
                     {
-                        NSString* msg =@"Do you want to switch to a pending order or a new order?";
+                        NSString* msg =@"";
                         if(appDelegate.contact_id.length>0)
                         {
                             msg = [msg stringByAppendingString:@"\n\nCustomer:"];
@@ -299,7 +307,7 @@
                     }
                     else
                     {
-                        UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:NSLocalizedString(@"Do you want to add to a pending order?", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Add to pending order", nil), nil];
+                        UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:NSLocalizedString(@"", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Add to pending order", nil), nil];
                         
                         // alert.
                         [alert show];
@@ -347,7 +355,7 @@
             
             if(appDelegate.can_create_order)
             {
-                NSString* msg =@"Do you want to switch to a pending order or a new order?";
+                NSString* msg =@"";
                 if(appDelegate.contact_id.length>0)
                 {
                     msg = [msg stringByAppendingString:@"\n\nCustomer:"];
@@ -361,7 +369,7 @@
             }
             else
             {
-                UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:NSLocalizedString(@"Do you want to add to a pending order?", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Add to pending order", nil), nil];
+                UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:NSLocalizedString(@"", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Add to pending order", nil), nil];
                 
                 // alert.
                 [alert show];

+ 1 - 0
RedAnt ERP Mobile/common/Functions/contact/ContactListViewController.h

@@ -38,4 +38,5 @@
 @property bool assig_icon;
 @property bool reset_icon;
 @property int ui_type;
+
 @end

+ 6 - 2
RedAnt ERP Mobile/common/Functions/contact/CustomerInfoViewController.m

@@ -289,25 +289,29 @@
     
     
     if (self.data_init==nil) {
+        
+         UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait..." title:@"Loading Contact information"];
+        
         dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
             
             NSDictionary* editor_json = [iSalesNetwork request_CustomerInfo:self.contactId];
             
             dispatch_async(dispatch_get_main_queue(), ^{
                 
-                
+                [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
                 
                 if([[editor_json valueForKey:@"result"] intValue]==2)
                 {
                     self.data_init = [[editor_json objectForKey:@"customerInfo" ] mutableCopy];
                     
                     [self fillData];
-                    
+                    self.btn_assign.enabled=true;
                     
                 }
                 else
                 {
                     [RAUtils message_alert:[editor_json valueForKey:@"err_msg"] title:@"Loading Contact Information" controller:self] ;
+                    self.btn_assign.enabled=false;
                 }
                 
                 

+ 2 - 2
RedAnt ERP Mobile/common/Functions/home/HomeViewController.m

@@ -389,12 +389,12 @@
             
             SliderPage * tempview = [[SliderPage alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, ui_height)];
             tempview.autoresizingMask =    UIViewAutoresizingFlexibleHeight  |UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleRightMargin|UIViewAutoresizingFlexibleTopMargin|UIViewAutoresizingFlexibleBottomMargin;
-            NSString* img_url = [slide_itemjson valueForKey:@"pic_url"];
+            NSString* img_url = [slide_itemjson valueForKey:@"img"];
             
             
             tempview.contentMode = UIViewContentModeScaleToFill;
             tempview.img_url = img_url;
-            //                tempview.url =;
+            //                tempview.url =@"";
             //                tempview.action_type = ;
             //                tempview.params = ;
             

+ 8 - 1
RedAnt ERP Mobile/common/Functions/modelDetail/DetailHeaderCell.h

@@ -8,6 +8,7 @@
 
 #import <UIKit/UIKit.h>
 #import "PhotoStackView.h"
+#import "RTLabel.h"
 
 
 @class DetailHeaderCell;
@@ -40,7 +41,10 @@
 @property (nonatomic, strong) NSString *product_id;
 //@property long detailID;
 //@property (strong, nonatomic) IBOutlet UILabel *itemIDLabel;
-@property (strong, nonatomic) IBOutlet UILabel *descriptionLabel;
+//@property (strong, nonatomic) IBOutlet UILabel *descriptionLabel;
+@property (strong, nonatomic) IBOutlet RTLabel *descriptionRTLabel;
+
+
 @property (strong, nonatomic) IBOutlet UILabel *priceLabel;
 //@property (strong, nonatomic) IBOutlet UILabel *shipLabel;
 
@@ -58,6 +62,9 @@
 @property (strong, nonatomic) IBOutlet UIButton *btnaddCart;
 @property (strong, nonatomic) IBOutlet UIButton *btnaddWish;
 @property (strong, nonatomic) IBOutlet UILabel *eta_label;
+
+@property (strong, nonatomic) IBOutlet UILabel *incoming_stock_label;
+
 @property (strong, nonatomic) IBOutlet UILabel *etaval_label;
 @property (strong, nonatomic) IBOutlet UIImageView *qrcode_imageview;
 @property (strong, nonatomic) IBOutlet UILabel *model_label;

+ 9 - 4
RedAnt ERP Mobile/common/Functions/modelDetail/DetailHeaderCell.m

@@ -43,6 +43,11 @@
     self.selector_Button.layer.borderWidth = 0.5;
     self.selector_Button.layer.borderColor = [[UIColor lightGrayColor] CGColor];
     self.selector_Button.layer.cornerRadius = 0;
+    
+    
+    [self.descriptionRTLabel setLineBreakMode: RTTextLineBreakModeWordWrapping];
+    [self.descriptionRTLabel setTextAlignment:RTTextAlignmentCenter];
+    [self.descriptionRTLabel setFont:[UIFont systemFontOfSize:22]];
 //    self.label_net_err.layer.borderColor = [UIColor darkGrayColor].CGColor;
 //    self.label_net_err.layer.borderWidth = 2.0;
 //    self.label_net_err.layer.cornerRadius=15;
@@ -288,7 +293,7 @@
             
             if(appDelegate.can_create_order)
             {
-                NSString* msg =@"Do you want to switch to a pending order or a new order?";
+                NSString* msg =@"";
                 if(appDelegate.contact_id.length>0)
                 {
                     msg = [msg stringByAppendingString:@"\n\nCustomer:"];
@@ -366,7 +371,7 @@
 
 -(void) addtocart:(int) count
 {
-    
+    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
 
     if(self.cqty>0)
     {
@@ -382,7 +387,7 @@
             int c=self.cqty+count;
             
             int m=c%self.step;
-            if(m!=0)
+            if(m!=0&&appDelegate.alert_sold_in_quantities)
             {
                 
                 
@@ -594,7 +599,7 @@
         int c=self.cqty+count;
         
         int m=c%self.step;
-        if(m!=0)
+        if(m!=0&&appDelegate.alert_sold_in_quantities)
         {
             
             

+ 36 - 24
RedAnt ERP Mobile/common/Functions/modelDetail/DetailViewController.m

@@ -275,29 +275,29 @@ self.isrefreshing=false;
 //    return;
     [super didRotateFromInterfaceOrientation:fromInterfaceOrientation];
     
-    NSMutableIndexSet *sectionToReload =  [[NSMutableIndexSet alloc] init];
-        int section_count =[[self.detail_data valueForKey:@"detail_section_count"] intValue];
-    
-    for(int i=0;i<section_count;i++)
-    {
-        NSDictionary* section_json = [self.detail_data objectForKey:[NSString stringWithFormat:@"detail_%ld",(long)i]];
-        
-       
-        
-        NSString* type=[section_json valueForKey:@"type"] ;
-        
-        if([type isEqualToString:@"kv"])
-        {
-            
-            [sectionToReload addIndex:i+1];
-        }
-    }
-    
-
-    [self.detailTable reloadSections:sectionToReload withRowAnimation:UITableViewRowAnimationNone];
-    
+//    NSMutableIndexSet *sectionToReload =  [[NSMutableIndexSet alloc] init];
+//        int section_count =[[self.detail_data valueForKey:@"detail_section_count"] intValue];
+//    
+//    for(int i=0;i<section_count;i++)
+//    {
+//        NSDictionary* section_json = [self.detail_data objectForKey:[NSString stringWithFormat:@"detail_%ld",(long)i]];
+//        
+//       
+//        
+//        NSString* type=[section_json valueForKey:@"type"] ;
+//        
+//        if([type isEqualToString:@"kv"])
+//        {
+//            
+//            [sectionToReload addIndex:i+1];
+//        }
+//    }
+//    
+//
+//    [self.detailTable reloadSections:sectionToReload withRowAnimation:UITableViewRowAnimationNone];
+//    
 
-        
+    [self.detailTable reloadData];
     
     
     
@@ -914,7 +914,10 @@ self.isrefreshing=false;
             cell.cqyt_label.text=nil;
         }
         
-        cell.descriptionLabel.text =[NSString stringWithFormat:@"%@\n\n",[section_json valueForKey:@"model_descrition"]];
+        
+        cell.descriptionRTLabel.text =[NSString stringWithFormat:@"%@\n\n",[section_json valueForKey:@"model_descrition"]];
+        
+    //    cell.descriptionLabel.text =[NSString stringWithFormat:@"%@\n\n",[section_json valueForKey:@"model_descrition"]];
         cell.model_label.text =[section_json valueForKey:@"model_name"];
         
         
@@ -939,7 +942,6 @@ self.isrefreshing=false;
 //        cell.shipLabel.text = [section_json valueForKey:@"ship"];
         cell.count_Label.text =[section_json valueForKey:@"Availability"] ;
         
-        cell.incomingcount_Label.text =[section_json valueForKey:@"incoming_stock"] ;
         
         NSString* eta =[section_json valueForKey:@"ETA"] ;
         if(eta.length>0)
@@ -948,6 +950,12 @@ self.isrefreshing=false;
             cell.eta_label.hidden = false;
             cell.etaval_label.text = eta;
             cell.etaval_label.hidden = false;
+
+            
+            cell.incoming_stock_label.hidden=false;
+            cell.incomingcount_Label.text =[section_json valueForKey:@"incoming_stock"] ;
+            cell.incomingcount_Label.hidden = false;
+
             
         }
         else
@@ -955,6 +963,10 @@ self.isrefreshing=false;
             cell.eta_label.hidden = true;
             cell.etaval_label.text = nil;
             cell.etaval_label.hidden = true;
+            
+            cell.incoming_stock_label.hidden = true;
+            cell.incomingcount_Label.text = nil;
+            cell.incomingcount_Label.hidden = true;
         }
         self.selector = [section_json objectForKey:@"selector"];
         

+ 4 - 0
RedAnt ERP Mobile/common/Functions/order/CreateOrderViewController.h

@@ -15,4 +15,8 @@
 @property (strong,nonatomic) NSMutableDictionary* upparams;
 
 @property (strong,nonatomic) UIBarButtonItem *btnSubmitOrder;
+
+
+//@property (nonatomic , copy) void (^printPdfCallback)(NSString* url);
+
 @end

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

@@ -330,7 +330,7 @@
                 
                 if([appDelegate.mode isEqualToString:@"Trade Show Mode"]&& appDelegate.save_order_logout && appDelegate.user_type ==USER_ROLE_EMPLOYEE)
                 {
-                    [((MainViewController*)appDelegate.main_vc) Loginout];
+                    [((MainViewController*)appDelegate.main_vc) Loginout:false];
                     [self prepareReturn:nil];
                     [self.navigationController popViewControllerAnimated:true];
                 }
@@ -370,7 +370,7 @@
 {
     
     [super textFieldDidEndEditing:textField];
- 
+    
     UITableViewCell *cell = (UITableViewCell *) textField.superview.superview;
     NSIndexPath *   indexPath = [self.editorTable indexPathForCell:cell];
     
@@ -426,20 +426,20 @@
             
             
             
-        NSUInteger newIndex[] = {indexPath.section, total_row_idx};
-        NSIndexPath *newPath = [[NSIndexPath alloc] initWithIndexes:newIndex length:2];
-//        NSLog(@"before refresh %@",NSStringFromCGSize(self.editorTable.contentSize));
-         [self.editorTable reloadRowsAtIndexPaths:@[newPath]withRowAnimation:UITableViewRowAnimationMiddle];
-
-//         NSLog(@"after refresh %@",NSStringFromCGSize(self.editorTable.contentSize));
+            NSUInteger newIndex[] = {indexPath.section, total_row_idx};
+            NSIndexPath *newPath = [[NSIndexPath alloc] initWithIndexes:newIndex length:2];
+            //        NSLog(@"before refresh %@",NSStringFromCGSize(self.editorTable.contentSize));
+            [self.editorTable reloadRowsAtIndexPaths:@[newPath]withRowAnimation:UITableViewRowAnimationMiddle];
             
+            //         NSLog(@"after refresh %@",NSStringFromCGSize(self.editorTable.contentSize));
             
-//            CGSize tablecontent =self.editorTable.contentSize;
-//            tablecontent.height=tablecontent.height+self.keyboard_h;
-//            self.editorTable.contentSize=tablecontent;
-//            
-//            
-//            NSLog(@"resize to %@",NSStringFromCGSize(self.editorTable.contentSize));
+            
+            //            CGSize tablecontent =self.editorTable.contentSize;
+            //            tablecontent.height=tablecontent.height+self.keyboard_h;
+            //            self.editorTable.contentSize=tablecontent;
+            //
+            //
+            //            NSLog(@"resize to %@",NSStringFromCGSize(self.editorTable.contentSize));
         }
         
         //                self.content_data = [editor_json mutableCopy];
@@ -447,7 +447,7 @@
         
         //                  NSMutableDictionary* content_data1 = [self translate_json:self.content_data];
         
-     //   [self.editorTable reloadData];
+        //   [self.editorTable reloadData];
         
     }
     //
@@ -637,145 +637,169 @@
             
             
             UIAlertAction *actionOne = [UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action)
-            {
-                
-                AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-                
-                if(appDelegate.user_type ==USER_ROLE_EMPLOYEE )
-                {
-                    
-                    if(/*!self.have_tail*/ true)
-                    {UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait" title:@"Submit Order"];
-                        [upparams setValue:@"false" forKey:@"isHold"];
-                        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-                            
-                            NSDictionary* editor_json = [iSalesNetwork saveandcommit_Order:upparams];
-                            
-                            dispatch_async(dispatch_get_main_queue(), ^{
-                                [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
-                                
-                                
-                                if([[editor_json valueForKey:@"result"] intValue]==2)
-                                {
-                                    //          NSMutableDictionary * customerInfo=[self create_cusromer_info_from_table];
-                                    
-                                    
-                                    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-                                    //                                        appDelegate.customerInfo = customerInfo;
-                                    //                                        appDelegate.contact_id = [customerInfo valueForKey:@"customer_cid"];
-                                    //                                        appDelegate.order_code = nil;
-                                    [appDelegate closeOrder];
-                                    [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
-                                    
-                                    
-                                    if([appDelegate.mode isEqualToString:@"Trade Show Mode"]&& appDelegate.submit_order_logout)
-                                    {
-                                        [((MainViewController*)appDelegate.main_vc) Loginout];
-                                    }
-                                    
-                                    //    //     self.labelContact.text=appDelegate.contact_name;
-                                    //
-                                    //    NSDictionary * customerinfo = appDelegate.customerInfo;
-                                    
-                                    
-                                    UIAlertView * alert = [[UIAlertView alloc] initWithTitle: @"Submit successful." message:[NSString stringWithFormat:@"SO#: %@",[editor_json valueForKey:@"so#"]] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
-                                    
-                                    [alert show];
-                                    
-                                    [self prepareReturn:nil];
-                                    [self.navigationController popViewControllerAnimated:true];
-                                    //                                        [self.navigationController dismissViewControllerAnimated:true completion:^{
-                                    //
-                                    //
-                                    //                                            ;
-                                    //                                        }];
-                                    
-                                }
-                                else
-                                {
-                                    [RAUtils message_alert:[editor_json valueForKey:@"err_msg"] title:@"Submit Order" controller:self] ;
-                                }
-                                
-                                
-                                
-                                
-                            });
-                        });
-                    }
-                    else
-                    {
-                        UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Retain models", nil) message:NSLocalizedString(@"There are some models left in cart,do you want to keep them?", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"NO", nil) otherButtonTitles:NSLocalizedString(@"YES", nil), nil];
-                        
-                        
-                        alert.tag = KEEP_TAIL;
-                        
-                        
-                        self.upparams = upparams;
-                        
-                        [alert show];
-                    }
-                    
-                }
-                else
-                { //USER_ROLE_CUSTOMER
-                    
-                    //            if(self.have_tail)
-                    //            [upparams setValue:@"true" forKey:@"isHold"];
-                    //            else
-                    //                [upparams setValue:@"false" forKey:@"isHold"];
-                    UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait" title:@"Submit Order"];
-                    
-                    [upparams setValue:@"true" forKey:@"isHold"];
-                    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-                        
-                        NSDictionary* editor_json = [iSalesNetwork saveandcommit_Order:upparams];
-                        
-                        dispatch_async(dispatch_get_main_queue(), ^{
-                            
-                            [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
-                            
-                            if([[editor_json valueForKey:@"result"] intValue]==2)
-                            {
-                                //       NSMutableDictionary * customerInfo=[self create_cusromer_info_from_table];
-                                
-                                
-                                AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-                                // appDelegate.customerInfo = customerInfo;
-                                
-                                NSString* orderCode = [editor_json valueForKey:@"orderCode"];
-                                appDelegate.order_code = orderCode;
-                                [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
-                                UIAlertView * alert = [[UIAlertView alloc] initWithTitle: @"Submit successful." message:[NSString stringWithFormat:@"SO#: %@",[editor_json valueForKey:@"so#"]] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
-                                
-                                [alert show];
-                                //    //     self.labelContact.text=appDelegate.contact_name;
-                                //
-                                //    NSDictionary * customerinfo = appDelegate.customerInfo;
-                                [self prepareReturn:nil];
-                                [self.navigationController popViewControllerAnimated:true];
-                                //                                    [self.navigationController dismissViewControllerAnimated:true completion:^{
-                                //
-                                //
-                                //                                        ;
-                                //                                    }];
-                                
-                            }
-                            else
-                            {
-                                [RAUtils message_alert:[editor_json valueForKey:@"err_msg"] title:@"Submit Order" controller:self] ;
-                            }
-                            
-                            
-                            
-                            
-                        });
-                    });
-                    
-                }
-                
-                
-                
-            }];
+                                        {
+                                            
+                                            AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+                                            
+                                            if(appDelegate.user_type ==USER_ROLE_EMPLOYEE )
+                                            {
+                                                
+                                                if(/*!self.have_tail*/ true)
+                                                {UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait" title:@"Submit Order"];
+                                                    [upparams setValue:@"false" forKey:@"isHold"];
+                                                    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+                                                        
+                                                        NSDictionary* editor_json = [iSalesNetwork saveandcommit_Order:upparams];
+                                                        
+                                                        dispatch_async(dispatch_get_main_queue(), ^{
+                                                            [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
+                                                            
+                                                            
+                                                            if([[editor_json valueForKey:@"result"] intValue]==2)
+                                                            {
+                                                                //          NSMutableDictionary * customerInfo=[self create_cusromer_info_from_table];
+                                                                
+                                                                // debug aaa
+                                                                AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+                                                                //                                appDelegate.customerInfo = customerInfo;
+                                                                //                                appDelegate.contact_id = [customerInfo valueForKey:@"customer_cid"];
+                                                                //                                appDelegate.order_code = nil;
+                                                                [appDelegate closeOrder];
+                                                                [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
+                                                                
+                                                                UIAlertView * alert = [[UIAlertView alloc] initWithTitle: @"Submit successful." message:[NSString stringWithFormat:@"SO#: %@",[editor_json valueForKey:@"so#"]] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
+                                                                
+                                                                [alert show];
+                                                                
+                                                                NSString* pdf_url = [editor_json valueForKey:@"pdf_url"];
+//                                                                if(pdf_url.length>0)
+//                                                                {
+//                                                                    
+//                                                                    [alert dismissWithClickedButtonIndex:0 animated:FALSE];
+//                                                                    //[self downloadpdf:pdf_url];
+//                                                                    
+//                                                                    
+//                                                                    if([appDelegate.mode isEqualToString:@"Trade Show Mode"]&& appDelegate.submit_order_logout)
+//                                                                    {
+//                                                                        //bbb
+//                                                                        [((MainViewController*)appDelegate.main_vc) Loginout:false];
+//                                                                    }
+//                                                                    
+//                                                                    [self prepareReturn:nil];
+//                                                                    
+//                                                                    [self.navigationController popViewControllerAnimated:true];
+//                                                                    
+//                                                                    [appDelegate printPdf:pdf_url];
+////                                                                    if(self.printPdfCallback)
+////                                                                        self.printPdfCallback(pdf_url);
+//                                                                }
+//                                                                else
+                                                                {
+                                                                    if([appDelegate.mode isEqualToString:@"Trade Show Mode"]&& appDelegate.submit_order_logout)
+                                                                    {
+                                                                        //bbb
+                                                                        [((MainViewController*)appDelegate.main_vc) Loginout:false];
+                                                                    }
+                                                                    [self prepareReturn:nil];
+                                                                    
+                                                                    [self.navigationController popViewControllerAnimated:true];
+                                                                    
+                                                                    if(pdf_url.length>0)
+                                                                    {
+                                                                        
+                                                                        [alert dismissWithClickedButtonIndex:0 animated:FALSE];
+                                                                        
+                                                                        [appDelegate printPdf:pdf_url];
+                                                                        
+                                                                    }
+                                                                }
+                                                                
+                                                            }
+                                                            else
+                                                            {
+                                                                [RAUtils message_alert:[editor_json valueForKey:@"err_msg"] title:@"Submit Order" controller:self] ;
+                                                            }
+                                                            
+                                                            
+                                                            
+                                                            
+                                                        });
+                                                    });
+                                                }
+                                                else
+                                                {
+                                                    UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Retain models", nil) message:NSLocalizedString(@"There are some models left in cart,do you want to keep them?", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"NO", nil) otherButtonTitles:NSLocalizedString(@"YES", nil), nil];
+                                                    
+                                                    
+                                                    alert.tag = KEEP_TAIL;
+                                                    
+                                                    
+                                                    self.upparams = upparams;
+                                                    
+                                                    [alert show];
+                                                }
+                                                
+                                            }
+                                            else
+                                            { //USER_ROLE_CUSTOMER
+                                                
+                                                //            if(self.have_tail)
+                                                //            [upparams setValue:@"true" forKey:@"isHold"];
+                                                //            else
+                                                //                [upparams setValue:@"false" forKey:@"isHold"];
+                                                UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait" title:@"Submit Order"];
+                                                
+                                                [upparams setValue:@"true" forKey:@"isHold"];
+                                                dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+                                                    
+                                                    NSDictionary* editor_json = [iSalesNetwork saveandcommit_Order:upparams];
+                                                    
+                                                    dispatch_async(dispatch_get_main_queue(), ^{
+                                                        
+                                                        [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
+                                                        
+                                                        if([[editor_json valueForKey:@"result"] intValue]==2)
+                                                        {
+                                                            //       NSMutableDictionary * customerInfo=[self create_cusromer_info_from_table];
+                                                            
+                                                            
+                                                            AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+                                                            // appDelegate.customerInfo = customerInfo;
+                                                            
+                                                            NSString* orderCode = [editor_json valueForKey:@"orderCode"];
+                                                            appDelegate.order_code = orderCode;
+                                                            [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
+                                                            UIAlertView * alert = [[UIAlertView alloc] initWithTitle: @"Submit successful." message:[NSString stringWithFormat:@"SO#: %@",[editor_json valueForKey:@"so#"]] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
+                                                            
+                                                            [alert show];
+                                                            //    //     self.labelContact.text=appDelegate.contact_name;
+                                                            //
+                                                            //    NSDictionary * customerinfo = appDelegate.customerInfo;
+                                                            [self prepareReturn:nil];
+                                                            [self.navigationController popViewControllerAnimated:true];
+                                                            //                                    [self.navigationController dismissViewControllerAnimated:true completion:^{
+                                                            //
+                                                            //
+                                                            //                                        ;
+                                                            //                                    }];
+                                                            
+                                                        }
+                                                        else
+                                                        {
+                                                            [RAUtils message_alert:[editor_json valueForKey:@"err_msg"] title:@"Submit Order" controller:self] ;
+                                                        }
+                                                        
+                                                        
+                                                        
+                                                        
+                                                    });
+                                                });
+                                                
+                                            }
+                                            
+                                            
+                                            
+                                        }];
             
             UIAlertAction *alertthree = [UIAlertAction actionWithTitle:@"No" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
                 //NSLog(@"Cancel");
@@ -819,6 +843,8 @@
                                 
                                 if([[editor_json valueForKey:@"result"] intValue]==2)
                                 {
+                                    
+                                    //debug bbb
                                     //    NSMutableDictionary * customerInfo=[self create_cusromer_info_from_table];
                                     
                                     
@@ -829,26 +855,64 @@
                                     [appDelegate closeOrder];
                                     [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
                                     
-                                    if([appDelegate.mode isEqualToString:@"Trade Show Mode"]&& appDelegate.submit_order_logout)
+                                    UIAlertView * alert = [[UIAlertView alloc] initWithTitle: @"Submit successful." message:[NSString stringWithFormat:@"SO#: %@",[editor_json valueForKey:@"so#"]] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
+                                    
+                                    [alert show];
+                                    
+                                    NSString* pdf_url = [editor_json valueForKey:@"pdf_url"];
+//                                    if(pdf_url.length>0)
+//                                    {
+//                                        
+//                                        [alert dismissWithClickedButtonIndex:0 animated:FALSE];
+////                                        [self downloadpdf:pdf_url];
+//                                        
+//                                        
+//                                        if([appDelegate.mode isEqualToString:@"Trade Show Mode"]&& appDelegate.submit_order_logout)
+//                                        {
+//                                            //bbb
+//                                            [((MainViewController*)appDelegate.main_vc) Loginout:false];
+//                                        }
+//                                        
+//                                        [self prepareReturn:nil];
+//                                        
+//                                        [self.navigationController popViewControllerAnimated:true];
+//                                        
+//                                        [appDelegate printPdf:pdf_url];
+//                                        
+////                                        if(self.printPdfCallback)
+////                                            self.printPdfCallback(pdf_url);
+//                                    }
+//                                    else
                                     {
-                                        [((MainViewController*)appDelegate.main_vc) Loginout];
+                                        if([appDelegate.mode isEqualToString:@"Trade Show Mode"]&& appDelegate.submit_order_logout)
+                                        {
+                                            //bbb
+                                            [((MainViewController*)appDelegate.main_vc) Loginout:false];
+                                        }
+                                        [self prepareReturn:nil];
+                                        
+                                        [self.navigationController popViewControllerAnimated:true];
+                                        
+                                        
+                                        if(pdf_url.length>0)
+                                        {
+                                            
+                                            [alert dismissWithClickedButtonIndex:0 animated:FALSE];
+                                            
+                                            [appDelegate printPdf:pdf_url];
+                                           
+                                        }
+                                        
+                                        
                                     }
                                     //    //     self.labelContact.text=appDelegate.contact_name;
                                     //
                                     //    NSDictionary * customerinfo = appDelegate.customerInfo;
                                     
                                     
-                                    UIAlertView * alert = [[UIAlertView alloc] initWithTitle: @"Submit successful." message:[NSString stringWithFormat:@"SO#: %@",[editor_json valueForKey:@"so#"]] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
                                     
-                                    [alert show];
                                     
-                                    [self prepareReturn:nil];
-                                    //                                [self.navigationController dismissViewControllerAnimated:true completion:^{
-                                    //
-                                    //
-                                    //                                    ;
-                                    //                                }];
-                                    [self.navigationController popViewControllerAnimated:true];
+                                    
                                     
                                 }
                                 else
@@ -914,7 +978,7 @@
                                 [self prepareReturn:nil];
                                 //                            [self.navigationController dismissViewControllerAnimated:true completion:^{
                                 //
-                                //                                
+                                //
                                 //                                ;
                                 //                            }];
                                 [self.navigationController popViewControllerAnimated:true];
@@ -935,7 +999,7 @@
             }
             
             
-
+            
             
         }
         
@@ -951,104 +1015,104 @@
         
     }
     
-//    else if( alertView.tag == KEEP_TAIL)
-//    {UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait" title:@"Submit Order"];
-//        if(buttonIndex!=alertView.cancelButtonIndex)
-//        {//keep tail;
-//            
-//            [self.upparams setValue:@"true" forKey:@"isHold"];
-//            dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-//                
-//                NSDictionary* editor_json = [iSalesNetwork saveandcommit_Order:self.upparams];
-//                
-//                dispatch_async(dispatch_get_main_queue(), ^{
-//                    [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
-//                    
-//                    
-//                    if([[editor_json valueForKey:@"result"] intValue]==2)
-//                    {
-//                        NSMutableDictionary * customerInfo=[self create_cusromer_info_from_table];
-//                        UIAlertView * alert = [[UIAlertView alloc] initWithTitle: @"Submit successful." message:[NSString stringWithFormat:@"SO#: %@",[editor_json valueForKey:@"so#"]] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
-//                        
-//                        [alert show];
-//                        
-//                        AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-//                        appDelegate.customerInfo = customerInfo;
-//                        appDelegate.contact_id = [customerInfo valueForKey:@"customer_cid"];
-//                        NSString* orderCode = [editor_json valueForKey:@"orderCode"];
-//                        appDelegate.order_code = orderCode;
-//                        [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
-//                        //    //     self.labelContact.text=appDelegate.contact_name;
-//                        //
-//                        //    NSDictionary * customerinfo = appDelegate.customerInfo;
-//                        [self prepareReturn:nil];
-////                        [self.navigationController dismissViewControllerAnimated:true completion:^{
-////                            
-////                            
-////                            ;
-////                        }];
-//                        [self.navigationController popViewControllerAnimated:true];
-//                        
-//                    }
-//                    else
-//                    {
-//                        [RAUtils message_alert:[editor_json valueForKey:@"err_msg"]  title:@"Submit Order" controller:self] ;
-//                    }
-//                    
-//                    
-//                    
-//                    
-//                });
-//            });
-//        }
-//        else
-//        {// not keep tail;
-//            [self.upparams setValue:@"false" forKey:@"isHold"];
-//            dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-//                
-//                NSDictionary* editor_json = [iSalesNetwork saveandcommit_Order:self.upparams];
-//                
-//                dispatch_async(dispatch_get_main_queue(), ^{
-//                    [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
-//                    
-//                    
-//                    if([[editor_json valueForKey:@"result"] intValue]==2)
-//                    {
-//                        //    NSMutableDictionary * customerInfo=[self create_cusromer_info_from_table];
-//                        UIAlertView * alert = [[UIAlertView alloc] initWithTitle: @"Submit successful." message:[NSString stringWithFormat:@"SO#: %@",[editor_json valueForKey:@"so#"]] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
-//                        
-//                        [alert show];
-//                        
-//                        AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-//                        //                        appDelegate.customerInfo = customerInfo;
-//                        //                        appDelegate.contact_id = [customerInfo valueForKey:@"customer_cid"];
-//                        //                        appDelegate.order_code = nil;
-//                        [appDelegate closeOrder];
-//                        [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
-//                        //    //     self.labelContact.text=appDelegate.contact_name;
-//                        //
-//                        //    NSDictionary * customerinfo = appDelegate.customerInfo;
-//                        [self prepareReturn:nil];
-////                        [self.navigationController dismissViewControllerAnimated:true completion:^{
-////                            
-////                            
-////                            ;
-////                        }];
-//                        [self.navigationController popViewControllerAnimated:true];
-//                        
-//                    }
-//                    else
-//                    {
-//                        [RAUtils message_alert:[editor_json valueForKey:@"err_msg"] title:@"Submit Order" controller:self] ;
-//                    }
-//                    
-//                    
-//                    
-//                    
-//                });
-//            });
-//        }
-//    }
+    //    else if( alertView.tag == KEEP_TAIL)
+    //    {UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait" title:@"Submit Order"];
+    //        if(buttonIndex!=alertView.cancelButtonIndex)
+    //        {//keep tail;
+    //
+    //            [self.upparams setValue:@"true" forKey:@"isHold"];
+    //            dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+    //
+    //                NSDictionary* editor_json = [iSalesNetwork saveandcommit_Order:self.upparams];
+    //
+    //                dispatch_async(dispatch_get_main_queue(), ^{
+    //                    [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
+    //
+    //
+    //                    if([[editor_json valueForKey:@"result"] intValue]==2)
+    //                    {
+    //                        NSMutableDictionary * customerInfo=[self create_cusromer_info_from_table];
+    //                        UIAlertView * alert = [[UIAlertView alloc] initWithTitle: @"Submit successful." message:[NSString stringWithFormat:@"SO#: %@",[editor_json valueForKey:@"so#"]] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
+    //
+    //                        [alert show];
+    //
+    //                        AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+    //                        appDelegate.customerInfo = customerInfo;
+    //                        appDelegate.contact_id = [customerInfo valueForKey:@"customer_cid"];
+    //                        NSString* orderCode = [editor_json valueForKey:@"orderCode"];
+    //                        appDelegate.order_code = orderCode;
+    //                        [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
+    //                        //    //     self.labelContact.text=appDelegate.contact_name;
+    //                        //
+    //                        //    NSDictionary * customerinfo = appDelegate.customerInfo;
+    //                        [self prepareReturn:nil];
+    ////                        [self.navigationController dismissViewControllerAnimated:true completion:^{
+    ////
+    ////
+    ////                            ;
+    ////                        }];
+    //                        [self.navigationController popViewControllerAnimated:true];
+    //
+    //                    }
+    //                    else
+    //                    {
+    //                        [RAUtils message_alert:[editor_json valueForKey:@"err_msg"]  title:@"Submit Order" controller:self] ;
+    //                    }
+    //
+    //
+    //
+    //
+    //                });
+    //            });
+    //        }
+    //        else
+    //        {// not keep tail;
+    //            [self.upparams setValue:@"false" forKey:@"isHold"];
+    //            dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+    //
+    //                NSDictionary* editor_json = [iSalesNetwork saveandcommit_Order:self.upparams];
+    //
+    //                dispatch_async(dispatch_get_main_queue(), ^{
+    //                    [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
+    //
+    //
+    //                    if([[editor_json valueForKey:@"result"] intValue]==2)
+    //                    {
+    //                        //    NSMutableDictionary * customerInfo=[self create_cusromer_info_from_table];
+    //                        UIAlertView * alert = [[UIAlertView alloc] initWithTitle: @"Submit successful." message:[NSString stringWithFormat:@"SO#: %@",[editor_json valueForKey:@"so#"]] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
+    //
+    //                        [alert show];
+    //
+    //                        AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+    //                        //                        appDelegate.customerInfo = customerInfo;
+    //                        //                        appDelegate.contact_id = [customerInfo valueForKey:@"customer_cid"];
+    //                        //                        appDelegate.order_code = nil;
+    //                        [appDelegate closeOrder];
+    //                        [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
+    //                        //    //     self.labelContact.text=appDelegate.contact_name;
+    //                        //
+    //                        //    NSDictionary * customerinfo = appDelegate.customerInfo;
+    //                        [self prepareReturn:nil];
+    ////                        [self.navigationController dismissViewControllerAnimated:true completion:^{
+    ////
+    ////
+    ////                            ;
+    ////                        }];
+    //                        [self.navigationController popViewControllerAnimated:true];
+    //
+    //                    }
+    //                    else
+    //                    {
+    //                        [RAUtils message_alert:[editor_json valueForKey:@"err_msg"] title:@"Submit Order" controller:self] ;
+    //                    }
+    //
+    //
+    //
+    //
+    //                });
+    //            });
+    //        }
+    //    }
     else if(alertView.tag == CLOSE_ACTION)
     {
         if(buttonIndex==1)
@@ -1103,11 +1167,11 @@
                         
                         [appDelegate closeOrder];
                         [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
-                         [((MainViewController*)appDelegate.main_vc) switchToHome];
+                        [((MainViewController*)appDelegate.main_vc) switchToHome];
                         
                         if([appDelegate.mode isEqualToString:@"Trade Show Mode"]&& appDelegate.submit_order_logout)
                         {
-                            [((MainViewController*)appDelegate.main_vc) Loginout];
+                            [((MainViewController*)appDelegate.main_vc) Loginout:false];
                         }
                         
                         [self prepareReturn:nil];
@@ -1138,4 +1202,245 @@
         }
     }
 }
+//
+//
+//-(void) downloadpdf:(NSString* )url
+//{
+//    UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait..." title:@"Printing..."];
+//    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+//        
+//        
+//        NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:url]        cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:60*5];
+//        
+//        //设置请求方式为get
+//        
+//        [request setHTTPMethod:@"GET"];
+//        
+//        //添加用户会话id
+//        
+//        [request addValue:@"text/html" forHTTPHeaderField:@"Content-Type"];
+//        
+//        //连接发送请求
+//        
+//        
+//        NSHTTPURLResponse* urlResponse = nil;
+//        
+//        NSError *error = [[NSError alloc] init];
+//        
+//        NSData* content= [NSURLConnection sendSynchronousRequest:request returningResponse:&urlResponse error:&error];
+//        
+//        //      self.filename = [urlResponse suggestedFilename];
+//        
+//        
+//        dispatch_async(dispatch_get_main_queue(), ^{
+//            [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
+//            //  self.navigationItem.title = self.save_name;
+//            //   UIRefreshControl *reF = (UIRefreshControl *)[self.view viewWithTag:200];
+//            //  self.content=nil;
+//            if(content!=nil&&content.length>0)
+//            {
+//                
+//                
+//                [self startAirPrintWithData:content];
+//                
+//                
+//            }
+//            else
+//            {
+//                [RAUtils message_alert:nil  title:@"Open PDF Failed" controller:self];
+//                //                self.content = [self.url dataUsingEncoding:NSUTF8StringEncoding];
+//            }
+//            
+//            ;
+//            //            NSLog(@"%@",[[NSString alloc] initWithData:self.content encoding:NSASCIIStringEncoding]);
+//            //
+//            
+//            
+//            // [self.webView loadData:self.content MIMEType:urlResponse.MIMEType textEncodingName:nil baseURL:nil];
+//            
+//            
+//            
+//            
+//        });
+//    });
+//}
+//
+//- (void)startAirPrintWithData:(id )data
+//{
+//    
+//    
+//    
+//    
+//    UIPrintInteractionController* airPrinterController=[UIPrintInteractionController sharedPrintController];
+//    UIPrintInfo *printInfo = [UIPrintInfo printInfo];
+//    printInfo.outputType = UIPrintInfoOutputGeneral;
+//    printInfo.orientation = UIPrintInfoOrientationPortrait;
+//    printInfo.jobName = @"CoolVisitAirPrint";
+//    airPrinterController.printInfo = printInfo;
+//    airPrinterController.printingItem = data;
+//    airPrinterController.delegate = self;
+//    
+//    
+//    airPrinterController.showsNumberOfCopies=true;
+//    airPrinterController.showsPageRange = true;
+//    airPrinterController.showsPaperSelectionForLoadedPapers=true;
+//    
+//    void (^completionHandler)(UIPrintInteractionController *, BOOL, NSError *) = ^(UIPrintInteractionController *printController, BOOL completed, NSError *error) {
+//        if(completed && error)
+//            NSLog(@"Printing failed due to error in domain %@ with error code %lu. Localized description: %@, and failure reason: %@", error.domain, (long)error.code, error.localizedDescription, error.localizedFailureReason);
+//    };
+//    
+//    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+//    
+//    UIPrinter *airPrinter = [UIPrinter printerWithURL:[NSURL URLWithString:appDelegate.printerURL] ];///*self.printer;*/
+//    
+//    
+//    
+//    
+//    [[UIPrinter printerWithURL:[NSURL URLWithString:appDelegate.printerURL]] contactPrinter:^(BOOL available)
+//     {
+//         if (available&& appDelegate.printerURL.length>0)
+//         {
+//             
+//             [airPrinterController printToPrinter:airPrinter completionHandler:completionHandler];
+//             NSLog(@"AIRPRINTER AVAILABLE");
+//         }
+//         else
+//         {
+//             
+//             //             [airPrinterController presentFromRect:CGRectMake(0, 0, 300, 500) inView:self.view animated:YES completionHandler:
+//             //              
+//             //              
+//             //              
+//             //              //        [printPicker presentAnimated:YES completionHandler:
+//             //              ^(UIPrintInteractionController *printerController, BOOL userDidSelect, NSError *error)
+//             //              {
+//             //                  if (userDidSelect)
+//             //                  {
+//             //                      NSString* sid= printerController.printInfo.printerID;
+//             //                      UIPrintPaper*paper=  printerController.printPaper;
+//             //  
+//             //                  }
+//             //              }];
+//             
+//             
+//             NSLog(@"AIRPRINTER NOT AVAILABLE");
+//             
+//             
+//             
+//             if (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_7_1)
+//             {
+//                 UIPrinterPickerController *printPicker = [UIPrinterPickerController printerPickerControllerWithInitiallySelectedPrinter:nil];
+//              //   [printPicker presentFromBarButtonItem:self.btnSubmitOrder animated:yes completionHandler:
+//                 
+//                 
+//                 
+//                [ printPicker presentFromBarButtonItem:self.btnSubmitOrder animated:YES completionHandler:
+//                 
+//                 
+//                // [printPicker presentFromRect:CGRectMake(0, 0, 300, 500) inView:self.view animated:YES completionHandler:
+//                  
+//                  
+//                  
+//                  //        [printPicker presentAnimated:YES completionHandler:
+//                  ^(UIPrinterPickerController *printerPicker, BOOL userDidSelect, NSError *error)
+//                  {
+//                      if (userDidSelect)
+//                      {
+//                          //User selected the item in the UIPrinterPickerController and got the printer details.
+//                          
+//                          [UIPrinterPickerController printerPickerControllerWithInitiallySelectedPrinter:printerPicker.selectedPrinter];
+//                          
+//                          //Here you will get the printer and printer details.ie,
+//                          // printerPicker.selectedPrinter, printerPicker.selectedPrinter.displayName, printerPicker.selectedPrinter.URL etc. So you can display the printer name in your label text or button title.
+//                          
+//                          
+//                          
+//                          
+//                          appDelegate.printerURL =printerPicker.selectedPrinter.URL.absoluteString;
+//                          
+//                          [self startAirPrintWithData:data];
+//                          
+//                      }
+//                      else
+//                      {
+//                          
+//                          
+//                          AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+//                          if([appDelegate.mode isEqualToString:@"Trade Show Mode"]&& appDelegate.submit_order_logout)
+//                          {
+//                              
+//                              [((MainViewController*)appDelegate.main_vc) Loginout:false];
+//                          }
+//                          [self prepareReturn:nil];
+//                          
+//                          [self.navigationController popViewControllerAnimated:true];
+//                      }
+//                  }];
+//             }
+//         }
+//     }];
+//    
+//    
+//    
+//}
+//
+//#pragma mark - UIPrintInteractionControllerDelegate
+//- (UIPrintPaper *)printInteractionController:(UIPrintInteractionController *)printInteractionController choosePaper:(NSArray<UIPrintPaper *> *)paperList
+//{
+//    
+//    ;
+//    
+//    //    (int) width = 29700
+//    //    Printing description of (*( (int *)0x7caa3a40)):
+//    //    (int) height = 42000
+//    //设置纸张大小
+//    
+//    
+//    for(UIPrintPaper* paper in paperList)
+//    {
+//        if (CGSizeEqualToSize(paper.paperSize, CGSizeMake(612, 792)))
+//            return paper;
+//        
+//    }
+//    CGSize paperSize = CGSizeMake(612, 792);
+//    UIPrintPaper * p=[UIPrintPaper bestPaperForPageSize:paperSize withPapersFromArray:paperList];
+//    return p;
+//}
+//- (void)printInteractionControllerWillPresentPrinterOptions:(UIPrintInteractionController *)printInteractionController
+//{
+//    
+//}
+//- (void)printInteractionControllerDidPresentPrinterOptions:(UIPrintInteractionController *)printInteractionController
+//{
+//    
+//}
+//- (void)printInteractionControllerWillDismissPrinterOptions:(UIPrintInteractionController *)printInteractionController
+//{
+//    
+//}
+//- (void)printInteractionControllerDidDismissPrinterOptions:(UIPrintInteractionController *)printInteractionController
+//{
+//    
+//}
+//
+//- (void)printInteractionControllerWillStartJob:(UIPrintInteractionController *)printInteractionController
+//{
+//    
+//}
+//- (void)printInteractionControllerDidFinishJob:(UIPrintInteractionController *)printInteractionController
+//{
+//    
+//    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+//    if([appDelegate.mode isEqualToString:@"Trade Show Mode"]&& appDelegate.submit_order_logout)
+//    {
+//        
+//        [((MainViewController*)appDelegate.main_vc) Loginout:false];
+//    }
+//    
+//    [self prepareReturn:nil];
+//    
+//    [self.navigationController popViewControllerAnimated:true];
+//}
+
 @end

+ 4 - 4
RedAnt ERP Mobile/common/Functions/order/OrderDetailViewController.m

@@ -311,7 +311,7 @@
     
     
     ViewController.save_name =so;
-    
+    ViewController.hidenavi = false;
     if(company==nil)
         company=@"";
     NSString* customer_email=    [self.content_data[@"customerInfo"] valueForKey:@"customer_email"];
@@ -343,7 +343,7 @@
     
     
     
-    UIAlertAction *actionOne = [UIAlertAction actionWithTitle:@"With item images" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
+    UIAlertAction *actionOne = [UIAlertAction actionWithTitle:@"With Thumbnails" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
         NSString* url=[self.content_data valueForKey:@"pdfUrl"];
         
         
@@ -358,7 +358,7 @@
         
     }];
     
-    UIAlertAction *alertthree = [UIAlertAction actionWithTitle:@"Without item images" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
+    UIAlertAction *alertthree = [UIAlertAction actionWithTitle:@"Without Thumbnails" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
         NSString* url=[self.content_data valueForKey:@"pdfUrl"];
         NSLog(@"pdf url:%@",url);
         ViewController.url = url;
@@ -1155,7 +1155,7 @@
                                 cell.sign_img.image=img ;
                             }
                             else
-                                cell.sign_img.image=[UIImage imageNamed:@"notfound_s"];
+                                cell.sign_img.image=[UIImage imageNamed:@"taptosign_s"];
                             
                             
                         });

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

@@ -43,4 +43,5 @@
 
 @property (strong, nonatomic) IBOutlet UILabel *label_net_err;
 @property int init_style;
+@property (strong,nonatomic) NSString* customer_id;
 @end

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

@@ -365,7 +365,7 @@ dispatch_async(dispatch_get_main_queue(), ^{
         
         
         NSMutableDictionary* content=nil;
-        content=[[iSalesNetwork request_OrderList:self.offset limit : self.limit keywords:self.keywords status:str_status] mutableCopy];
+        content=[[iSalesNetwork request_OrderList:self.offset limit : self.limit keywords:self.keywords status:str_status customer:self.customer_id] mutableCopy];
         dispatch_async(dispatch_get_main_queue(), ^{
             
             
@@ -698,19 +698,19 @@ dispatch_async(dispatch_get_main_queue(), ^{
 //    [modellabel sizeToFit];
 //    [myView addSubview:modellabel];
     
-    UILabel *modellabel = [[UILabel alloc] initWithFrame:CGRectMake(self.table_order.frame.size.width-276, 2, 100, 22)];
-    modellabel.autoresizingMask=UIViewAutoresizingFlexibleLeftMargin;
-    modellabel.textColor=[UIColor whiteColor];
-    modellabel.backgroundColor = [UIColor clearColor];
-    modellabel.text=NSLocalizedString(@"Items/QTY", nil);
-    [modellabel sizeToFit];
-    [myView addSubview:modellabel];
+//    UILabel *modellabel = [[UILabel alloc] initWithFrame:CGRectMake(self.table_order.frame.size.width-276, 2, 100, 22)];
+//    modellabel.autoresizingMask=UIViewAutoresizingFlexibleLeftMargin;
+//    modellabel.textColor=[UIColor whiteColor];
+//    modellabel.backgroundColor = [UIColor clearColor];
+//    modellabel.text=NSLocalizedString(@"Items/QTY", nil);
+//    [modellabel sizeToFit];
+//    [myView addSubview:modellabel];
     
-    UILabel *pricelabel = [[UILabel alloc] initWithFrame:CGRectMake(/*492*/self.table_order.frame.size.width-276, 21, 100, 22)];
+    UILabel *pricelabel = [[UILabel alloc] initWithFrame:CGRectMake(/*492*/self.table_order.frame.size.width-276, 11, 100, 22)];
     pricelabel.autoresizingMask=UIViewAutoresizingFlexibleLeftMargin;
     pricelabel.textColor=[UIColor whiteColor];
     pricelabel.backgroundColor = [UIColor clearColor];
-    pricelabel.text=NSLocalizedString(@"Price", nil);
+    pricelabel.text=NSLocalizedString(@"Order Total", nil);
     [pricelabel sizeToFit];
     [myView addSubview:pricelabel];
     

+ 2 - 2
RedAnt ERP Mobile/common/Functions/portfolio/PDFListViewController.m

@@ -495,9 +495,9 @@
     ViewController.attachment_name = [NSString stringWithFormat:@"NPD_Product_List %@.pdf",cur_time];
     ViewController.mail_subject = subject;
 
-    
+    ViewController.hidenavi = false;
     [self.navigationController pushViewController:ViewController animated:YES];
-    [[self navigationController] setNavigationBarHidden:NO animated:NO];
+    //[self.navigationController setNavigationBarHidden:NO animated:NO];
 
 }
 

+ 6 - 90
RedAnt ERP Mobile/common/Functions/portfolio/PortfolioViewController.m

@@ -86,7 +86,7 @@
                     
                     if(appDelegate.can_create_order)
                     {
-                        NSString* msg =@"Do you want to switch to a pending order or a new order?";
+                        NSString* msg =@"";
                         if(appDelegate.contact_id.length>0)
                         {
                             msg = [msg stringByAppendingString:@"\n\nCustomer:"];
@@ -102,7 +102,7 @@
                     }
                     else
                     {
-                        UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:NSLocalizedString(@"Do you want to add to a pending order?", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Add to pending order", nil), nil];
+                        UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:NSLocalizedString(@"", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Add to pending order", nil), nil];
                         
                         // alert.
                         [alert show];
@@ -148,7 +148,7 @@
             [main_vc checklogin:false];
             if(appDelegate.can_create_order)
             {
-                NSString* msg =@"Do you want to switch to a pending order or a new order?";
+                NSString* msg =@"";
                 if(appDelegate.contact_id.length>0)
                 {
                     msg = [msg stringByAppendingString:@"\n\nCustomer:"];
@@ -162,7 +162,7 @@
             }
             else
             {
-                UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:NSLocalizedString(@"Do you want to add to a pending order?", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Add to pending order", nil), nil];
+                UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:NSLocalizedString(@"", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Add to pending order", nil), nil];
                 
                 // alert.
                 [alert show];
@@ -362,91 +362,7 @@
 //    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
     VC.onDismiss=^(NSString* catelog_name)
     {
-        //        PDFViewController *ViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"PDFViewController"];
-        //        ViewController.url = self.pdf_url;
-        //        ViewController.mail_content = [self.content_data valueForKey:@"email_content"];
-        //
-        //        ViewController.save_name =catelog_name;
-        //
-        //
-        //        NSString* company=    [appDelegate.customerInfo valueForKey:@"customer_name"];
-        //
-        //        if(company==nil)
-        //            company=@"";
-        //        NSString* customer_email=    [appDelegate.customerInfo valueForKey:@"customer_email"];
-        //
-        //
-        //        NSMutableArray* send_to = [[NSMutableArray alloc]init];
-        //        if(customer_email.length>0)
-        //            [send_to addObject:customer_email];
-        //        ViewController.mail_to = send_to;
-        //
-        //        NSString* subject;
-        //        if (company.length==0) {
-        //            subject = @"Tear sheet";
-        //
-        //
-        //
-        //        }
-        //        else
-        //        {
-        //            subject = [NSString stringWithFormat:@"Tear sheet for %@",company ];
-        //        }
-        //        ViewController.mail_subject = subject;
-        //
-        //        ViewController.onLoadSuccess =^(NSString* url)
-        //        {
-        //            if(self.remove_item)
-        //            {
-        //                dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-        //
-        //                    NSDictionary* cart_json = [iSalesNetwork watchlist_remove:string_iid];
-        //
-        //                    dispatch_async(dispatch_get_main_queue(), ^{
-        //
-        //
-        //
-        //                        if([[cart_json valueForKey:@"result"] intValue]==2)
-        //                        {
-        //                            [self reload_data];
-        //                        }
-        //                        else
-        //                        {
-        //                            [RAUtils error_alert:[cart_json valueForKey:@"err_msg"] title:@"Failed to remove model from wishlist."] ;
-        //                        }
-        //
-        //                    });
-        //                });
-        //            }
-        //        };
-        //
-        //
-        //        ViewController.onSavePDF=^(NSString* name,NSString* file)
-        //        {
-        //
-        //            NSString* cid=    [appDelegate.customerInfo valueForKey:@"customer_cid"];
-        //            if(cid==nil)
-        //                cid=@"";
-        //
-        //            NSString *path = NSTemporaryDirectory();
-        //            NSString *temp_path = [path stringByAppendingPathComponent:file];
-        //
-        //            [iSalesDB save_pdf:temp_path filename:file];
-        //            NSString* str_sendto=[send_to componentsJoinedByString:@";"];
-        //            NSString *sql = [NSString stringWithFormat:
-        //                             @"INSERT INTO pdf_cache (name,file_name,c_id,c_name,o_id,pdf_type,send_to) VALUES ('%@', '%@', '%@', '%@', '%@', '%@', '%@')",
-        //                             name, file,cid, company, @"", @"Tear Sheet",str_sendto];
-        //
-        //            [iSalesDB execSql:sql];
-        //
-        //        };
-        //
-        //        //    ViewController. = self.function_name;
-        //        //    ViewController.behavior =BEHAVIOR_SEARCH;
-        //
-        //        [self.navigationController pushViewController:ViewController animated:YES];
-        //        [[self navigationController] setNavigationBarHidden:NO animated:NO];
-        
+          
     };
     
     //
@@ -853,7 +769,7 @@
         
         
     }
-    cell.backgroundColor = UIColorFromRGB(0xF2EEEA);
+    cell.backgroundColor = [UIColor whiteColor];//UIColorFromRGB(0xF2EEEA);
     return cell;
     
 }

+ 2 - 2
RedAnt ERP Mobile/common/Functions/portfolio/TearSheetParamViewController.m

@@ -422,9 +422,9 @@
                 
                 //    ViewController. = self.function_name;
                 //    ViewController.behavior =BEHAVIOR_SEARCH;
-                
+                ViewController.hidenavi = false;
                 [self.navigationController pushViewController:ViewController animated:YES];
-                [[self navigationController] setNavigationBarHidden:NO animated:NO];
+              //  [[self navigationController] setNavigationBarHidden:NO animated:NO];
                 
                 
                 /*

+ 6 - 4
RedAnt ERP Mobile/common/Functions/search+itemsearch/ItemSearchViewController.m

@@ -579,6 +579,8 @@
 }
 - (IBAction)onAddCartClick:(id)sender {
     
+    [RAUtils add_to_cart:self selector:@selector(addtocart)];
+    return;
     
     UIApplication * app = [UIApplication sharedApplication];
     AppDelegate *appDelegate = (AppDelegate *)[app delegate];
@@ -608,7 +610,7 @@
                     
                     if(appDelegate.can_create_order)
                     {
-                        NSString* msg =@"Do you want to switch to a pending order or a new order?";
+                        NSString* msg =@"";
                         if(appDelegate.contact_id.length>0)
                         {
                             msg = [msg stringByAppendingString:@"\n\nCustomer:"];
@@ -624,7 +626,7 @@
                     }
                     else
                     {
-                        UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:NSLocalizedString(@"Do you want to add to a pending order?", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Add to pending order", nil), nil];
+                        UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:NSLocalizedString(@"", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Add to pending order", nil), nil];
                         
                         // alert.
                         [alert show];
@@ -672,7 +674,7 @@
             
             if(appDelegate.can_create_order)
             {
-                NSString* msg =@"Do you want to switch to a pending order or a new order?";
+                NSString* msg =@"";
                 if(appDelegate.contact_id.length>0)
                 {
                     msg = [msg stringByAppendingString:@"\n\nCustomer:"];
@@ -686,7 +688,7 @@
             }
             else
             {
-                UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:NSLocalizedString(@"Do you want to add to a pending order?", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Add to pending order", nil), nil];
+                UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:NSLocalizedString(@"", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Add to pending order", nil), nil];
                 
                 // alert.
                 [alert show];

+ 6 - 5
RedAnt ERP Mobile/common/Functions/search+itemsearch/SearchViewController.m

@@ -504,7 +504,8 @@
     // Dispose of any resources that can be recreated.
 }
 - (IBAction)onAddCartClick:(id)sender {
-    
+    [RAUtils add_to_cart:self selector:@selector(addtocart)];
+    return;
     
     UIApplication * app = [UIApplication sharedApplication];
     AppDelegate *appDelegate = (AppDelegate *)[app delegate];
@@ -533,7 +534,7 @@
                     [main_vc checklogin:false];
                     if(appDelegate.can_create_order)
                     {
-                        NSString* msg =@"Do you want to switch to a pending order or a new order?";
+                        NSString* msg =@"";
                         if(appDelegate.contact_id.length>0)
                         {
                             msg = [msg stringByAppendingString:@"\n\nCustomer:"];
@@ -549,7 +550,7 @@
                     }
                     else
                     {
-                        UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:NSLocalizedString(@"Do you want to add to a pending order?", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Add to pending order", nil), nil];
+                        UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:NSLocalizedString(@"", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Add to pending order", nil), nil];
                         
                         // alert.
                         [alert show];
@@ -596,7 +597,7 @@
          //   [main_vc checklogin:false];
             if(appDelegate.can_create_order)
             {
-                NSString* msg =@"Do you want to switch to a pending order or a new order?";
+                NSString* msg =@"";
                 if(appDelegate.contact_id.length>0)
                 {
                     msg = [msg stringByAppendingString:@"\n\nCustomer:"];
@@ -610,7 +611,7 @@
             }
             else
             {
-                UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:NSLocalizedString(@"Do you want to add to a pending order?", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Add to pending order", nil), nil];
+                UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:NSLocalizedString(@"", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Add to pending order", nil), nil];
                 
                 // alert.
                 [alert show];

+ 26 - 0
RedAnt ERP Mobile/common/Functions/sidemenu/FunctionTestViewController.h

@@ -0,0 +1,26 @@
+//
+//  FunctionTestViewController.h
+//  iSales-NPD
+//
+//  Created by Ray on 3/15/16.
+//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface FunctionTestViewController : UIViewController <UIPrintInteractionControllerDelegate>
+
+
+@property (nonatomic,strong) UIPrintInteractionController* airPrinterController;
+
+
+@property (nonatomic,strong) NSString* printerurl;
+@property (nonatomic,strong) NSString* printerdisplayName;
+@property (strong, nonatomic) IBOutlet UILabel *labelPrintername;
+
+
+
+@property (nonatomic,strong) UIPrinter* printer;
+
+@property (nonatomic,strong) NSURL *printerURL;
+@end

+ 439 - 0
RedAnt ERP Mobile/common/Functions/sidemenu/FunctionTestViewController.m

@@ -0,0 +1,439 @@
+//
+//  FunctionTestViewController.m
+//  iSales-NPD
+//
+//  Created by Ray on 3/15/16.
+//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
+//
+
+#import "FunctionTestViewController.h"
+#import "RAUtils.h"
+
+@interface FunctionTestViewController ()
+
+@end
+
+@implementation FunctionTestViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+    
+    
+    
+self.airPrinterController = [UIPrintInteractionController sharedPrintController];
+}
+- (void)viewWillAppear:(BOOL)animated
+{
+    
+    [super viewWillAppear:animated];
+    [[self navigationController] setNavigationBarHidden:NO animated:NO];
+    
+}
+
+- (void)startAirPrintWithData:(id )data
+{
+    
+
+
+    
+    
+    UIPrintInfo *printInfo = [UIPrintInfo printInfo];
+    printInfo.outputType = UIPrintInfoOutputGeneral;
+    printInfo.orientation = UIPrintInfoOrientationPortrait;
+    printInfo.jobName = @"CoolVisitAirPrint";
+    self.airPrinterController.printInfo = printInfo;
+    self.airPrinterController.printingItem = data;
+    self.airPrinterController.delegate = self;
+    
+    void (^completionHandler)(UIPrintInteractionController *, BOOL, NSError *) = ^(UIPrintInteractionController *printController, BOOL completed, NSError *error) {
+        if(completed && error)
+            NSLog(@"Printing failed due to error in domain %@ with error code %lu. Localized description: %@, and failure reason: %@", error.domain, (long)error.code, error.localizedDescription, error.localizedFailureReason);
+    };
+    UIPrinter *airPrinter = [UIPrinter printerWithURL:self.printerURL];///*self.printer;*/
+    
+    
+    
+    
+    [[UIPrinter printerWithURL:self.printerURL] contactPrinter:^(BOOL available)
+     {
+         if (available)
+         {
+             
+             [self.airPrinterController printToPrinter:airPrinter completionHandler:completionHandler];
+             NSLog(@"AIRPRINTER AVAILABLE");
+         }
+         else
+         {
+             NSLog(@"AIRPRINTER NOT AVAILABLE");
+         }
+     }];
+    
+    
+//    [airPrinter contactPrinter:^(BOOL available)
+//    {
+//        if (available) {
+//           self.printerdisplayName= airPrinter.displayName;
+////        self.printerNameLabel.text = self.savedPrinter.displayName;
+////            self.printerLocationLabel.text = self.savedPrinter.displayLocation;
+//    }
+//    else {
+//        NSLog(@"cannot connect to printer");
+////        self.printerConnectionGoneIndicator.hidden = NO;
+//    }
+//    }];
+ //   [self.airPrinterController printToPrinter:airPrinter completionHandler:completionHandler];
+}
+
+
+-(void) downloadpdfUI
+{
+    UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait..." title:@"Loading..."];
+    NSString* url = @"http://192.168.0.119:8080/site/u/NPD/file/20160315/96ad77c5-e8cd-4bf1-ac97-21c76b56af79.pdf";
+    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+        
+        
+        NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:url]        cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:60*5];
+        
+        //设置请求方式为get
+        
+        [request setHTTPMethod:@"GET"];
+        
+        //添加用户会话id
+        
+        [request addValue:@"text/html" forHTTPHeaderField:@"Content-Type"];
+        
+        //连接发送请求
+        
+        
+        NSHTTPURLResponse* urlResponse = nil;
+        
+        NSError *error = [[NSError alloc] init];
+        
+        NSData* content= [NSURLConnection sendSynchronousRequest:request returningResponse:&urlResponse error:&error];
+        
+        //      self.filename = [urlResponse suggestedFilename];
+        
+        
+        dispatch_async(dispatch_get_main_queue(), ^{
+            [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
+            //  self.navigationItem.title = self.save_name;
+            //   UIRefreshControl *reF = (UIRefreshControl *)[self.view viewWithTag:200];
+            //  self.content=nil;
+            if(content!=nil&&content.length>0)
+            {
+                
+                
+                UIPrintInfo *printInfo = [UIPrintInfo printInfo];
+                printInfo.outputType = UIPrintInfoOutputGeneral;
+                printInfo.orientation = UIPrintInfoOrientationPortrait;
+                printInfo.jobName = @"CoolVisitAirPrint";
+                self.airPrinterController.printInfo = printInfo;
+                self.airPrinterController.printingItem = content;
+                self.airPrinterController.delegate = self;
+                
+                self.airPrinterController.showsNumberOfCopies=true;
+                self.airPrinterController.showsPageRange = true;
+                self.airPrinterController.showsPaperSelectionForLoadedPapers=true;
+                
+                
+                
+                
+                [self.airPrinterController presentFromRect:CGRectMake(0, 0, 300, 500) inView:self.view animated:YES completionHandler:
+                 
+                 
+                 
+                 //        [printPicker presentAnimated:YES completionHandler:
+                 ^(UIPrintInteractionController *printerController, BOOL userDidSelect, NSError *error)
+                 {
+                     if (userDidSelect)
+                     {
+                         
+                         UIPrintPaper*paper=  printerController.printPaper;
+                         //             printerController.printPaper = paper;
+                         //             printer
+                         
+                         //             //User selected the item in the UIPrinterPickerController and got the printer details.
+                         //
+                         //             [UIPrinterPickerController printerPickerControllerWithInitiallySelectedPrinter:printerPicker.selectedPrinter];
+                         //
+                         //             //Here you will get the printer and printer details.ie,
+                         //             // printerPicker.selectedPrinter, printerPicker.selectedPrinter.displayName, printerPicker.selectedPrinter.URL etc. So you can display the printer name in your label text or button title.
+                         //             
+                         //             
+                         //             self.labelPrintername.text =printerPicker.selectedPrinter.displayName;
+                         //             //       [btnSettingsPrint setTitle:printerPicker.selectedPrinter.displayName forState:UIControlStateNormal];
+                         //             
+                         //             
+                         //             
+                         //             self.printerurl =printerPicker.selectedPrinter.URL.absoluteString;
+                         //             NSURL *printerURL = printerPicker.selectedPrinter.URL;
+                         //             
+                     }
+                 }];
+
+                //[self startAirPrintWithData:content];
+                
+                //                [reF removeFromSuperview];
+                //
+                //
+                //                // NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
+                //                NSString *path = NSTemporaryDirectory();
+                //                NSString *filePath = [path stringByAppendingPathComponent:self.filename];
+                //                //    NSError *error = [[NSError alloc] init];
+                //                //    BOOL bo = [[NSFileManager defaultManager] createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:&error];
+                //                //    NSAssert(bo,@"创建目录失败");
+                //                [self.content writeToFile:filePath atomically:YES];
+                //
+                //
+                //                self.btnshare.enabled =true;
+                //
+                //
+                //                self.btnemail.enabled =true;
+                //                self.btnsave.enabled =true;
+                //
+                //                if(self.onLoadSuccess)
+                //                    self.onLoadSuccess(self.url);
+                //               int a=0;
+            }
+            else
+            {
+                [RAUtils message_alert:nil  title:@"Open PDF Failed" controller:self];
+                //                self.content = [self.url dataUsingEncoding:NSUTF8StringEncoding];
+            }
+            
+            ;
+            //            NSLog(@"%@",[[NSString alloc] initWithData:self.content encoding:NSASCIIStringEncoding]);
+            //
+            
+            
+            // [self.webView loadData:self.content MIMEType:urlResponse.MIMEType textEncodingName:nil baseURL:nil];
+            
+            
+            
+            
+        });
+    });
+}
+
+
+-(void) downloadpdf
+{
+     UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait..." title:@"Loading..."];
+    NSString* url = @"http://192.168.0.119:8080/site/u/NPD/file/20160315/96ad77c5-e8cd-4bf1-ac97-21c76b56af79.pdf";
+    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+        
+        
+        NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:url]        cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:60*5];
+        
+        //设置请求方式为get
+        
+        [request setHTTPMethod:@"GET"];
+        
+        //添加用户会话id
+        
+        [request addValue:@"text/html" forHTTPHeaderField:@"Content-Type"];
+        
+        //连接发送请求
+        
+        
+        NSHTTPURLResponse* urlResponse = nil;
+        
+        NSError *error = [[NSError alloc] init];
+        
+        NSData* content= [NSURLConnection sendSynchronousRequest:request returningResponse:&urlResponse error:&error];
+        
+  //      self.filename = [urlResponse suggestedFilename];
+        
+        
+        dispatch_async(dispatch_get_main_queue(), ^{
+            [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
+          //  self.navigationItem.title = self.save_name;
+         //   UIRefreshControl *reF = (UIRefreshControl *)[self.view viewWithTag:200];
+            //  self.content=nil;
+            if(content!=nil&&content.length>0)
+            {
+                
+                
+                [self startAirPrintWithData:content];
+                
+//                [reF removeFromSuperview];
+//                
+//                
+//                // NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
+//                NSString *path = NSTemporaryDirectory();
+//                NSString *filePath = [path stringByAppendingPathComponent:self.filename];
+//                //    NSError *error = [[NSError alloc] init];
+//                //    BOOL bo = [[NSFileManager defaultManager] createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:&error];
+//                //    NSAssert(bo,@"创建目录失败");
+//                [self.content writeToFile:filePath atomically:YES];
+//                
+//                
+//                self.btnshare.enabled =true;
+//                
+//                
+//                self.btnemail.enabled =true;
+//                self.btnsave.enabled =true;
+//                
+//                if(self.onLoadSuccess)
+//                    self.onLoadSuccess(self.url);
+                //               int a=0;
+            }
+            else
+            {
+                [RAUtils message_alert:nil  title:@"Open PDF Failed" controller:self];
+                //                self.content = [self.url dataUsingEncoding:NSUTF8StringEncoding];
+            }
+            
+            ;
+            //            NSLog(@"%@",[[NSString alloc] initWithData:self.content encoding:NSASCIIStringEncoding]);
+            //
+            
+            
+           // [self.webView loadData:self.content MIMEType:urlResponse.MIMEType textEncodingName:nil baseURL:nil];
+            
+            
+            
+            
+        });
+    });
+}
+//-(void)settingPrinter
+//{
+//    UIPrinterPickerController *pickerController =[UIPrinterPickerController printerPickerControllerWithInitiallySelectedPrinter:nil];
+//    CGRect rect;
+//    UIInterfaceOrientation currentOrientation = [UIApplication sharedApplication].statusBarOrientation;
+//    rect = CGRectMake(0, 0, 200, 200);
+//    void (^completionHandler)(UIPrinterPickerController *, BOOL, NSError *) = ^(UIPrinterPickerController *printController, BOOL userDidSelect, NSError * err) {
+//        if (userDidSelect)
+//        {
+//            // save the urlString and Printer name, do your UI interactions
+//            self.printerurl = pickerController.selectedPrinter.URL.absoluteString;
+//            self.printerdisplayName = pickerController.selectedPrinter.displayName;
+//        }
+//    };
+//    
+//    
+//    [pickerController presentFromRect:self.view.frame inView:self.view animated:YES completionHandler:completionHandler];
+//   // [pickerController presentAnimated:YES completionHandler:completionHandler];
+//}
+
+- (IBAction)OnPrintParamsClick:(id)sender {
+    [self downloadpdfUI];
+    
+    
+}
+
+- (void) searchForPrinters
+{
+    // For checking the ios version is greater than ios 7.Because skipping the   Printing UI is ony in ios8 and later.
+    if (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_7_1)
+    {
+        UIPrinterPickerController *printPicker = [UIPrinterPickerController printerPickerControllerWithInitiallySelectedPrinter:nil];
+        
+        
+        [printPicker presentFromRect:CGRectMake(0, 0, 300, 500) inView:self.view animated:YES completionHandler:
+
+        
+        
+//        [printPicker presentAnimated:YES completionHandler:
+         ^(UIPrinterPickerController *printerPicker, BOOL userDidSelect, NSError *error)
+         {
+             if (userDidSelect)
+             {
+                 //User selected the item in the UIPrinterPickerController and got the printer details.
+                 
+                 [UIPrinterPickerController printerPickerControllerWithInitiallySelectedPrinter:printerPicker.selectedPrinter];
+                 
+                 //Here you will get the printer and printer details.ie,
+                 // printerPicker.selectedPrinter, printerPicker.selectedPrinter.displayName, printerPicker.selectedPrinter.URL etc. So you can display the printer name in your label text or button title.
+                 
+                 
+                 self.labelPrintername.text =printerPicker.selectedPrinter.displayName;
+          //       [btnSettingsPrint setTitle:printerPicker.selectedPrinter.displayName forState:UIControlStateNormal];
+                 
+                 self.printer = printerPicker.selectedPrinter;
+                 
+                 self.printerurl =printerPicker.selectedPrinter.URL.absoluteString;
+                 self.printerURL = printerPicker.selectedPrinter.URL;
+                 
+             }
+         }];
+    }
+}
+
+
+- (void)didReceiveMemoryWarning {
+    [super didReceiveMemoryWarning];
+    // Dispose of any resources that can be recreated.
+}
+- (IBAction)onBackgroundprintClick:(id)sender {
+    
+    [self downloadpdf];
+    //[self startAirPrintWithImage:[UIImage imageNamed:@"notfound_s"]];
+}
+- (IBAction)onPrintersettingClick:(id)sender {
+    
+    //[self settingPrinter];
+    
+    [self searchForPrinters];
+}
+
+/*
+#pragma mark - Navigation
+
+// In a storyboard-based application, you will often want to do a little preparation before navigation
+- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
+    // Get the new view controller using [segue destinationViewController].
+    // Pass the selected object to the new view controller.
+}
+*/
+
+
+- (UIPrintPaper *)printInteractionController:(UIPrintInteractionController *)printInteractionController choosePaper:(NSArray<UIPrintPaper *> *)paperList
+{
+    
+    ;
+
+//    (int) width = 29700
+//    Printing description of (*( (int *)0x7caa3a40)):
+//    (int) height = 42000
+//设置纸张大小
+    
+    
+    for(UIPrintPaper* paper in paperList)
+    {
+        if (CGSizeEqualToSize(paper.paperSize, CGSizeMake(612, 792)))
+            return paper;
+
+    }
+    CGSize paperSize = CGSizeMake(612, 792);
+     UIPrintPaper * p=[UIPrintPaper bestPaperForPageSize:paperSize withPapersFromArray:paperList];
+    return p;
+}
+- (void)printInteractionControllerWillPresentPrinterOptions:(UIPrintInteractionController *)printInteractionController
+{
+    
+}
+- (void)printInteractionControllerDidPresentPrinterOptions:(UIPrintInteractionController *)printInteractionController
+{
+    
+}
+- (void)printInteractionControllerWillDismissPrinterOptions:(UIPrintInteractionController *)printInteractionController
+{
+    
+}
+- (void)printInteractionControllerDidDismissPrinterOptions:(UIPrintInteractionController *)printInteractionController
+{
+    
+}
+
+- (void)printInteractionControllerWillStartJob:(UIPrintInteractionController *)printInteractionController
+{
+    
+}
+- (void)printInteractionControllerDidFinishJob:(UIPrintInteractionController *)printInteractionController
+{
+    
+}
+@end

+ 6 - 6
RedAnt ERP Mobile/common/Functions/sidemenu/LoginViewController.m

@@ -61,10 +61,10 @@
 }
 - (IBAction)CloseClick:(id)sender {
     
-    
+    [self dismissViewControllerAnimated:true completion:nil];
                     if(self.returnValue)
                         self.returnValue(false);
-    [self dismissViewControllerAnimated:true completion:nil];
+    
     
     
 }
@@ -96,7 +96,7 @@
     
     
     self.btnLogin.enabled = false;
-    UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait..." title:@"Login"];
+    UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait..." title:@"Sign in"];
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
         
         
@@ -129,10 +129,10 @@
                 }
                 [defaults synchronize];
                 
-                
+                [self dismissViewControllerAnimated:YES completion:nil];
                 if(self.returnValue)
                     self.returnValue(true);
-                [self dismissViewControllerAnimated:YES completion:nil];
+                
 //                if (self.delegate && [self.delegate respondsToSelector:@selector(LoginViewControllerDidLogin:)]) {
 //                    [self.delegate LoginViewControllerDidLogin:self];
 //                }
@@ -164,7 +164,7 @@
                         break;
                 }
                 
-                [RAUtils alert_view:msg title:@"Login"];
+                [RAUtils alert_view:msg title:@"Sign in"];
                 
 //                UIAlertView * alert = [[UIAlertView alloc] initWithTitle: @"Login Failed." message:msg delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
 //                

+ 8 - 89
RedAnt ERP Mobile/common/Functions/watchlist/WatchListViewController.m

@@ -48,6 +48,9 @@
         [self.itemListTable reloadData];
 }
 - (IBAction)onAddtoCart:(id)sender {
+    [RAUtils add_to_cart:self selector:@selector(addtocart)];
+    return;
+    
     UIApplication * app = [UIApplication sharedApplication];
     AppDelegate *appDelegate = (AppDelegate *)[app delegate];
     MainViewController* main_vc=(MainViewController*)appDelegate.main_vc;
@@ -74,7 +77,7 @@
                     
                     [main_vc checklogin:false];
                     if(appDelegate.can_create_order)
-                    {                NSString* msg =@"Do you want to switch to a pending order or a new order?";
+                    {                NSString* msg =@"";
                         if(appDelegate.contact_id.length>0)
                         {
                             msg = [msg stringByAppendingString:@"\n\nCustomer:"];
@@ -90,7 +93,7 @@
                     }
                     else
                     {
-                        UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:NSLocalizedString(@"Do you want to add to a pending order?", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Add to pending order", nil), nil];
+                        UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:NSLocalizedString(@"", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Add to pending order", nil), nil];
                         
                         // alert.
                         [alert show];
@@ -136,7 +139,7 @@
             [main_vc checklogin:false];
             if(appDelegate.can_create_order)
             {
-                NSString* msg =@"Do you want to switch to a pending order or a new order?";
+                NSString* msg =@"";
                 if(appDelegate.contact_id.length>0)
                 {
                     msg = [msg stringByAppendingString:@"\n\nCustomer:"];
@@ -150,7 +153,7 @@
             }
             else
             {
-                UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:NSLocalizedString(@"Do you want to add to a pending order?", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Add to pending order", nil), nil];
+                UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:NSLocalizedString(@"", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Add to pending order", nil), nil];
                 
                 // alert.
                 [alert show];
@@ -351,90 +354,6 @@
 //AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
     VC.onDismiss=^(NSString* catelog_name)
     {
-//        PDFViewController *ViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"PDFViewController"];
-//        ViewController.url = self.pdf_url;
-//        ViewController.mail_content = [self.content_data valueForKey:@"email_content"];
-//        
-//        ViewController.save_name =catelog_name;
-//        
-//
-//        NSString* company=    [appDelegate.customerInfo valueForKey:@"customer_name"];
-//        
-//        if(company==nil)
-//            company=@"";
-//        NSString* customer_email=    [appDelegate.customerInfo valueForKey:@"customer_email"];
-//        
-//        
-//        NSMutableArray* send_to = [[NSMutableArray alloc]init];
-//        if(customer_email.length>0)
-//            [send_to addObject:customer_email];
-//        ViewController.mail_to = send_to;
-//        
-//        NSString* subject;
-//        if (company.length==0) {
-//            subject = @"Tear sheet";
-//            
-//            
-//            
-//        }
-//        else
-//        {
-//            subject = [NSString stringWithFormat:@"Tear sheet for %@",company ];
-//        }
-//        ViewController.mail_subject = subject;
-//        
-//        ViewController.onLoadSuccess =^(NSString* url)
-//        {
-//            if(self.remove_item)
-//            {
-//                dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-//                    
-//                    NSDictionary* cart_json = [iSalesNetwork watchlist_remove:string_iid];
-//                    
-//                    dispatch_async(dispatch_get_main_queue(), ^{
-//                        
-//                        
-//                        
-//                        if([[cart_json valueForKey:@"result"] intValue]==2)
-//                        {
-//                            [self reload_data];
-//                        }
-//                        else
-//                        {
-//                            [RAUtils error_alert:[cart_json valueForKey:@"err_msg"] title:@"Failed to remove model from wishlist."] ;
-//                        }
-//                        
-//                    });
-//                });
-//            }
-//        };
-//        
-//        
-//        ViewController.onSavePDF=^(NSString* name,NSString* file)
-//        {
-//            
-//            NSString* cid=    [appDelegate.customerInfo valueForKey:@"customer_cid"];
-//            if(cid==nil)
-//                cid=@"";
-//            
-//            NSString *path = NSTemporaryDirectory();
-//            NSString *temp_path = [path stringByAppendingPathComponent:file];
-//            
-//            [iSalesDB save_pdf:temp_path filename:file];
-//            NSString* str_sendto=[send_to componentsJoinedByString:@";"];
-//            NSString *sql = [NSString stringWithFormat:
-//                             @"INSERT INTO pdf_cache (name,file_name,c_id,c_name,o_id,pdf_type,send_to) VALUES ('%@', '%@', '%@', '%@', '%@', '%@', '%@')",
-//                             name, file,cid, company, @"", @"Tear Sheet",str_sendto];
-//            
-//            [iSalesDB execSql:sql];
-//            
-//        };
-//        
-//        //    ViewController. = self.function_name;
-//        //    ViewController.behavior =BEHAVIOR_SEARCH;
-//        
-//        [self.navigationController pushViewController:ViewController animated:YES];
-//        [[self navigationController] setNavigationBarHidden:NO animated:NO];
 
     };
     
@@ -810,7 +729,7 @@
         
         
     }
-    cell.backgroundColor = UIColorFromRGB(0xF2EEEA);
+    cell.backgroundColor = [UIColor whiteColor];//UIColorFromRGB(0xF2EEEA);
     return cell;
     
 }

+ 2 - 1
RedAnt ERP Mobile/common/RAUtils.h

@@ -15,6 +15,7 @@
 //    
 //    
 //}MyTestStruct;
+typedef void (^add_to_cart_Handler)(void);
 
 @interface RAUtils : NSObject
 +(NSString*) FloatFormat:(float)value;
@@ -42,5 +43,5 @@
 +(NSMutableArray*)dictionary2array:(NSDictionary*)json count_fields:(NSString*) count_fields item_mark:(NSString*) item_mark items_mark:(NSString* )items_mark;
 
 +(NSArray*) string2arr:(NSString*) string separator:(NSString*)separator;
-
++(void) add_to_cart:(UIViewController*) vc selector:(SEL)aSelector;
 @end

+ 712 - 1
RedAnt ERP Mobile/common/RAUtils.m

@@ -8,10 +8,10 @@
 
 #import "RAUtils.h"
 #import "LoginViewController.h"
+#import "MainViewController.h"
 
 @implementation RAUtils
 
-
 + (UIImage *)scaleToSize:(UIImage *)img size:(CGSize)size{
     // 创建一个bitmap的context
     // 并把它设置成为当前正在使用的context
@@ -202,6 +202,10 @@
     
     [alertControl addAction:alertthree];
     
+    
+    UIAlertAction *alertcancel = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
+    }];
+    [alertControl addAction:alertcancel];
     //UIAlertControllerStyle类型为UIAlertControllerStyleAlert可以添加addTextFieldWithConfigurationHandler:^(UITextField *textField)
     
     
@@ -217,6 +221,713 @@
     
 
 }
+
++(void) neworder:(UIViewController*) vc selector:(SEL)addtocart
+{
+    
+    UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait" title:@"Create Order"];
+    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+        
+        NSDictionary* return_json = [iSalesNetwork new_Order];
+        
+        dispatch_async(dispatch_get_main_queue(), ^{
+            [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
+            
+            
+            if([[return_json valueForKey:@"result"] intValue]==2)
+            {
+                int result=[[return_json valueForKey:@"result"] intValue];
+                if(result==2)
+                {
+                    //successed.
+                    
+                    NSString* order_code = [return_json valueForKey:@"orderCode"];
+                    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+                    appDelegate.order_code = order_code;
+                    
+                    
+                    [vc performSelector:addtocart];
+                    
+                    
+                    //    [self ReloadData];
+                    
+                    
+                    //                    if(self.shopCartBlock!=nil)
+                    //                    {
+                    //                        UIImage* img=[self photoStackView:self.photoStack photoForIndex:0];
+                    //
+                    //
+                    //                        CGRect iv_rect = CGRectMake(self.btnaddCart.center.x-50, self.btnaddCart.center.y-50, 100, 100);
+                    //                        UIImageView* iv = [[UIImageView alloc] initWithFrame:iv_rect];
+                    //                        iv.image = img;
+                    //                        //                        [self.contentView addSubview:iv];
+                    //                        self.shopCartBlock(iv);
+                    //
+                    //                    }
+                    
+                }
+            }
+            else
+            {
+                [RAUtils message_alert:[return_json valueForKey:@"err_msg"] title:@"Create Order" controller:vc] ;
+            }
+            
+            
+            
+            
+        });
+    });
+}
+
++(void) add_to_cart:(UIViewController*) vc selector:(SEL)addtocart
+{
+    UIApplication * app = [UIApplication sharedApplication];
+    AppDelegate *appDelegate = (AppDelegate *)[app delegate];
+    MainViewController* main_vc=(MainViewController*)appDelegate.main_vc;
+
+   
+    
+    if(appDelegate.bLogin==false)
+    {
+        
+        LoginViewController * loginvc =[ vc.storyboard instantiateViewControllerWithIdentifier:@"LoginViewController"];
+
+        loginvc.returnValue = ^(bool blogin){
+        
+            if(blogin)
+            {
+                if(appDelegate.user_type==USER_ROLE_EMPLOYEE)
+                {
+                    
+                    [main_vc checklogin:false];
+                    
+                    
+                    NSString* msg =@"";
+//                    if(appDelegate.contact_id.length>0)
+//                    {
+//                        msg = [msg stringByAppendingString:@"Customer:"];
+//                        msg = [msg stringByAppendingString:appDelegate.customerInfo[@"customer_name"]];
+//                        
+//                    }
+                    
+                    UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:@"Add to cart" message:msg preferredStyle:UIAlertControllerStyleAlert];
+                    //block代码块取代了delegate
+                    
+                    
+                    
+                    UIAlertAction *actionOne = [UIAlertAction actionWithTitle:@"Add to pending order" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
+                        
+                        
+                        //  vc.disable_refresh = true;
+                        OrderListViewController* ovc =[ vc.storyboard instantiateViewControllerWithIdentifier:@"OrderListViewController"];
+                        ovc.showNavibar = true;
+                        //ovc.customer_id = appDelegate.contact_id;
+                        ovc.selectOrder = ^(NSMutableDictionary* order_detail){
+                            
+                            [vc performSelector:addtocart];
+                            
+                            
+                        };
+                        ovc.init_style = OL_OPEN;
+                        
+                        ovc.onCancel = ^(){
+                            
+                            //  self.disable_refresh = false;
+                            
+                            
+                            
+                        };
+                        
+                        [vc.navigationController pushViewController:ovc animated:true];
+                        
+                        
+                        
+                        
+                        
+                    }];
+                    
+                    UIAlertAction *alertthree = [UIAlertAction actionWithTitle:@"Add to new order" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
+                        
+                        
+                        {
+                            //create new;
+                            //    self.disable_refresh = true;
+                            if(appDelegate.customerInfo==nil)// select contact if current contact not exist
+                            {
+                                ContactListViewController* cvc = [vc.storyboard instantiateViewControllerWithIdentifier:@"ContactListViewController" ];
+                                cvc.showNavibar = true;
+                                cvc.contact_type = @"Sales_Order_Customer";
+                                cvc.returnValue = ^(NSMutableDictionary* value,NSIndexPath* source){
+                                    
+                                    appDelegate.contact_id=[value valueForKey:@"customer_cid"];
+                                    appDelegate.customerInfo = value;
+                                    
+                                    
+                                    if(appDelegate.order_code==nil)
+                                        [self neworder:vc selector:addtocart];
+                                    //                                                            neworder();
+                                    
+                                    //    [main_vc checklogin:true];
+                                    //            [self handle_action_return:value indexPath:indexPath action:ACTION_FILL_SECTION];
+                                    
+                                    //
+                                    //                if(self.returnValue)
+                                    //                    self.returnValue(value);
+                                };
+                                
+                                cvc.onCancel = ^(){
+                                    
+                                    [RAUtils message_alert:@"Cannot create order without cursomer infomation." title:@"New Order Error" controller:vc];
+                                    
+                                    // self.disable_refresh = false;
+                                    
+                                };
+                                cvc.onReset = ^(){
+                                    // [main_vc checklogin:true];
+                                };
+                                
+                                [vc.navigationController pushViewController:cvc animated:true];
+                            }
+                            else
+                            {
+                                [self neworder:vc selector:addtocart];
+                            }
+                            
+                        }
+                        
+                        
+                        NSLog(@"No");
+                    }];
+                    [alertControl addAction:actionOne];
+                    
+                    [alertControl addAction:alertthree];
+                    
+                    UIAlertAction *alertcancel = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
+                    }];
+                    [alertControl addAction:alertcancel];
+                    
+                    //UIAlertControllerStyle类型为UIAlertControllerStyleAlert可以添加addTextFieldWithConfigurationHandler:^(UITextField *textField)
+                    
+                    
+                    [vc presentViewController:alertControl animated:YES completion:nil];
+                    
+                    
+                    
+                    
+                    
+                    
+                    
+                }
+
+                else
+                {
+                    
+                    //customer login;
+                    [main_vc checklogin:false];
+                    //[self addtocart];
+                    [vc performSelector:addtocart];
+                }
+            }
+            
+
+        };
+        
+        UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:loginvc] ;
+        
+        
+        
+        
+        
+        //    [self hackModalSheetSize:CGSizeMake(450, 200) ofVC:navi];
+        
+        navi.modalPresentationStyle = UIModalTransitionStyleCrossDissolve;//有三种状态,自己看看是哪种
+        [vc presentViewController:navi animated:YES completion:^{
+            
+            //        navi.view.superview.bounds = CGRectMake(0, 0, 480, 320);
+            
+            NSLog(@"LoginViewController present.........");
+            
+            //   self.btop = false;
+            //  <#code#>
+        }];
+    }
+    else
+    {
+        if(appDelegate.user_type==USER_ROLE_EMPLOYEE&&/*appDelegate.contact_id==nil&&*/appDelegate.order_code==nil)
+        {
+            if(appDelegate.contact_id.length==0)
+            {
+                
+                
+                
+                NSString* msg =@"";
+
+                
+                UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:@"Add to cart" message:msg preferredStyle:UIAlertControllerStyleAlert];
+                //block代码块取代了delegate
+                
+                
+                
+                UIAlertAction *actionOne = [UIAlertAction actionWithTitle:@"Add to pending order" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
+                    
+                    
+                    //  vc.disable_refresh = true;
+                    OrderListViewController* ovc =[ vc.storyboard instantiateViewControllerWithIdentifier:@"OrderListViewController"];
+                    ovc.showNavibar = true;
+                    //ovc.customer_id = appDelegate.contact_id;
+                    ovc.selectOrder = ^(NSMutableDictionary* order_detail){
+                        
+                        [vc performSelector:addtocart];
+                        
+                        
+                    };
+                    ovc.init_style = OL_OPEN;
+                    
+                    ovc.onCancel = ^(){
+                        
+                        //  self.disable_refresh = false;
+                        
+                        
+                        
+                    };
+                    
+                    [vc.navigationController pushViewController:ovc animated:true];
+                    
+                    
+                    
+                    
+                    
+                }];
+                
+                UIAlertAction *alertthree = [UIAlertAction actionWithTitle:@"Add to new order" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
+                    
+                    
+                    {
+                        //create new;
+                        //    self.disable_refresh = true;
+                        if(appDelegate.customerInfo==nil)// select contact if current contact not exist
+                        {
+                            ContactListViewController* cvc = [vc.storyboard instantiateViewControllerWithIdentifier:@"ContactListViewController" ];
+                            cvc.showNavibar = true;
+                            cvc.contact_type = @"Sales_Order_Customer";
+                            cvc.returnValue = ^(NSMutableDictionary* value,NSIndexPath* source){
+                                
+                                appDelegate.contact_id=[value valueForKey:@"customer_cid"];
+                                appDelegate.customerInfo = value;
+                                
+                                
+                                if(appDelegate.order_code==nil)
+                                    [self neworder:vc selector:addtocart];
+                                //                                                            neworder();
+                                
+                                //    [main_vc checklogin:true];
+                                //            [self handle_action_return:value indexPath:indexPath action:ACTION_FILL_SECTION];
+                                
+                                //
+                                //                if(self.returnValue)
+                                //                    self.returnValue(value);
+                            };
+                            
+                            cvc.onCancel = ^(){
+                                
+                                [RAUtils message_alert:@"Cannot create order without cursomer infomation." title:@"New Order Error" controller:vc];
+                                
+                                // self.disable_refresh = false;
+                                
+                            };
+                            cvc.onReset = ^(){
+                                // [main_vc checklogin:true];
+                            };
+                            
+                            [vc.navigationController pushViewController:cvc animated:true];
+                        }
+                        else
+                        {
+                            [self neworder:vc selector:addtocart];
+                        }
+                        
+                    }
+                    
+                    
+                    NSLog(@"No");
+                }];
+                [alertControl addAction:actionOne];
+                
+                [alertControl addAction:alertthree];
+                UIAlertAction *alertcancel = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
+                }];
+                [alertControl addAction:alertcancel];
+                
+                //UIAlertControllerStyle类型为UIAlertControllerStyleAlert可以添加addTextFieldWithConfigurationHandler:^(UITextField *textField)
+                
+                
+                [vc presentViewController:alertControl animated:YES completion:nil];
+                
+                
+                
+                
+                
+                
+                
+            }
+            
+            else
+            
+            {
+               
+                UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait..." title:@"Checking Pending Order"];
+                
+                
+                
+                
+                dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+                    
+                    NSDictionary* return_json = [iSalesNetwork request_PendingOrder:appDelegate.contact_id];
+                    
+                    dispatch_async(dispatch_get_main_queue(), ^{
+                        
+                      [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
+                        
+                        if([[return_json valueForKey:@"result"] intValue]==2)
+                        {
+                            
+                            bool openPendingOrder= [[return_json valueForKey:@"hasPending"] boolValue];
+                            bool createNewOrder=appDelegate.can_create_order;
+                            
+                            if(openPendingOrder&&createNewOrder)
+                            {
+                                
+                                NSString* msg =@"";
+                                if(appDelegate.contact_id.length>0)
+                                {
+                                    msg = [msg stringByAppendingString:@"Customer:"];
+                                    msg = [msg stringByAppendingString:appDelegate.customerInfo[@"customer_name"]];
+                                    
+                                }
+                                
+                                UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:@"Add to cart" message:msg preferredStyle:UIAlertControllerStyleAlert];
+                                //block代码块取代了delegate
+                                
+                                
+                                
+                                UIAlertAction *actionOne = [UIAlertAction actionWithTitle:@"Add to pending order" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
+                                    
+                                    
+                                    //  vc.disable_refresh = true;
+                                    OrderListViewController* ovc =[ vc.storyboard instantiateViewControllerWithIdentifier:@"OrderListViewController"];
+                                    ovc.showNavibar = true;
+                                    ovc.customer_id = appDelegate.contact_id;
+                                    ovc.selectOrder = ^(NSMutableDictionary* order_detail){
+                                        
+                                        [vc performSelector:addtocart];
+                                        
+                                        
+                                    };
+                                    ovc.init_style = OL_OPEN;
+                                    
+                                    ovc.onCancel = ^(){
+                                        
+                                        //  self.disable_refresh = false;
+                                        
+                                        
+                                        
+                                    };
+                                    
+                                    [vc.navigationController pushViewController:ovc animated:true];
+                                    
+                                    
+                                    
+                                    
+                                    
+                                }];
+                                
+                                UIAlertAction *alertthree = [UIAlertAction actionWithTitle:@"Add to new order" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
+                                    
+                                    
+                                    {
+                                        //create new;
+                                        //    self.disable_refresh = true;
+                                        if(appDelegate.customerInfo==nil)// select contact if current contact not exist
+                                        {
+                                            ContactListViewController* cvc = [vc.storyboard instantiateViewControllerWithIdentifier:@"ContactListViewController" ];
+                                            cvc.showNavibar = true;
+                                            cvc.contact_type = @"Sales_Order_Customer";
+                                            cvc.returnValue = ^(NSMutableDictionary* value,NSIndexPath* source){
+                                                
+                                                appDelegate.contact_id=[value valueForKey:@"customer_cid"];
+                                                appDelegate.customerInfo = value;
+                                                
+                                                
+                                                if(appDelegate.order_code==nil)
+                                                    [self neworder:vc selector:addtocart];
+                                                //                                                            neworder();
+                                                
+                                                //    [main_vc checklogin:true];
+                                                //            [self handle_action_return:value indexPath:indexPath action:ACTION_FILL_SECTION];
+                                                
+                                                //
+                                                //                if(self.returnValue)
+                                                //                    self.returnValue(value);
+                                            };
+                                            
+                                            cvc.onCancel = ^(){
+                                                
+                                                [RAUtils message_alert:@"Cannot create order without cursomer infomation." title:@"New Order Error" controller:vc];
+                                                
+                                                // self.disable_refresh = false;
+                                                
+                                            };
+                                            cvc.onReset = ^(){
+                                                // [main_vc checklogin:true];
+                                            };
+                                            
+                                            [vc.navigationController pushViewController:cvc animated:true];
+                                        }
+                                        else
+                                        {
+                                            [self neworder:vc selector:addtocart];
+                                        }
+                                        
+                                    }
+                                    
+                                    
+                                    NSLog(@"No");
+                                }];
+                                [alertControl addAction:actionOne];
+                                
+                                [alertControl addAction:alertthree];
+                                
+                                UIAlertAction *alertcancel = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
+                                }];
+                                [alertControl addAction:alertcancel];
+                                //UIAlertControllerStyle类型为UIAlertControllerStyleAlert可以添加addTextFieldWithConfigurationHandler:^(UITextField *textField)
+                                
+                                
+                                [vc presentViewController:alertControl animated:YES completion:nil];
+                                
+                                
+                                
+                                
+                                
+                                
+                            }
+                            else
+                            {
+                                if(openPendingOrder)
+                                {
+                                    NSString* msg =@"";
+                                    if(appDelegate.contact_id.length>0)
+                                    {
+                                        msg = [msg stringByAppendingString:@"Customer:"];
+                                        msg = [msg stringByAppendingString:appDelegate.customerInfo[@"customer_name"]];
+                                        
+                                    }
+                                    
+                                    UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:@"Add to cart" message:msg preferredStyle:UIAlertControllerStyleAlert];
+                                    //block代码块取代了delegate
+                                    
+                                    
+                                    
+                                    UIAlertAction *actionOne = [UIAlertAction actionWithTitle:@"Add to pending order" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
+                                        
+                                        
+                                        //  vc.disable_refresh = true;
+                                        OrderListViewController* ovc =[ vc.storyboard instantiateViewControllerWithIdentifier:@"OrderListViewController"];
+                                        ovc.showNavibar = true;
+                                        ovc.customer_id = appDelegate.contact_id;
+                                        ovc.selectOrder = ^(NSMutableDictionary* order_detail){
+                                            
+                                            [vc performSelector:addtocart];
+                                            
+                                            
+                                        };
+                                        ovc.init_style = OL_OPEN;
+                                        
+                                        ovc.onCancel = ^(){
+                                            
+                                            //  self.disable_refresh = false;
+                                            
+                                            
+                                            
+                                        };
+                                        
+                                        [vc.navigationController pushViewController:ovc animated:true];
+                                        
+                                        
+                                        
+                                        
+                                        
+                                    }];
+                                    
+                                   
+                                    [alertControl addAction:actionOne];
+                                    UIAlertAction *alertcancel = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
+                                    }];
+                                    [alertControl addAction:alertcancel];
+                                    
+                                    //   [alertControl addAction:alertthree];
+                                    
+                                    //UIAlertControllerStyle类型为UIAlertControllerStyleAlert可以添加addTextFieldWithConfigurationHandler:^(UITextField *textField)
+                                    
+                                    
+                                    [vc presentViewController:alertControl animated:YES completion:nil];
+                                    
+                                    
+                                    
+                                    
+                                    
+                                    
+                                    
+                                }
+                                else if(createNewOrder)
+                                {
+                                    NSString* msg =@"";
+                                    if(appDelegate.contact_id.length>0)
+                                    {
+                                        msg = [msg stringByAppendingString:@"Customer:"];
+                                        msg = [msg stringByAppendingString:appDelegate.customerInfo[@"customer_name"]];
+                                        
+                                    }
+                                    
+                                    UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:@"Add to cart" message:msg preferredStyle:UIAlertControllerStyleAlert];
+                                    //block代码块取代了delegate
+                                    
+                                    
+                                    
+                                   
+                                    
+                                    UIAlertAction *alertthree = [UIAlertAction actionWithTitle:@"Add to new order" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
+                                        
+                                        
+                                        {
+                                            //create new;
+                                            //    self.disable_refresh = true;
+                                            if(appDelegate.customerInfo==nil)// select contact if current contact not exist
+                                            {
+                                                ContactListViewController* cvc = [vc.storyboard instantiateViewControllerWithIdentifier:@"ContactListViewController" ];
+                                                cvc.showNavibar = true;
+                                                cvc.contact_type = @"Sales_Order_Customer";
+                                                cvc.returnValue = ^(NSMutableDictionary* value,NSIndexPath* source){
+                                                    
+                                                    appDelegate.contact_id=[value valueForKey:@"customer_cid"];
+                                                    appDelegate.customerInfo = value;
+                                                    
+                                                    
+                                                    if(appDelegate.order_code==nil)
+                                                        [self neworder:vc selector:addtocart];
+                                                    //                                                            neworder();
+                                                    
+                                                    //    [main_vc checklogin:true];
+                                                    //            [self handle_action_return:value indexPath:indexPath action:ACTION_FILL_SECTION];
+                                                    
+                                                    //
+                                                    //                if(self.returnValue)
+                                                    //                    self.returnValue(value);
+                                                };
+                                                
+                                                cvc.onCancel = ^(){
+                                                    
+                                                    [RAUtils message_alert:@"Cannot create order without cursomer infomation." title:@"New Order Error" controller:vc];
+                                                    
+                                                    // self.disable_refresh = false;
+                                                    
+                                                };
+                                                cvc.onReset = ^(){
+                                                    // [main_vc checklogin:true];
+                                                };
+                                                
+                                                [vc.navigationController pushViewController:cvc animated:true];
+                                            }
+                                            else
+                                            {
+                                                [self neworder:vc selector:addtocart];
+                                            }
+                                            
+                                        }
+                                        
+                                        
+                                        NSLog(@"No");
+                                    }];
+                                    //                                        [alertControl addAction:actionOne];
+                                    
+                                    [alertControl addAction:alertthree];
+                                    
+                                    UIAlertAction *alertcancel = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
+                                    }];
+                                    [alertControl addAction:alertcancel];
+                                    
+                                    //UIAlertControllerStyle类型为UIAlertControllerStyleAlert可以添加addTextFieldWithConfigurationHandler:^(UITextField *textField)
+                                    
+                                    
+                                    [vc presentViewController:alertControl animated:YES completion:nil];
+                                    
+                                    
+                                    
+                                    
+                                    
+                                }
+                                else
+                                {
+                                    [RAUtils message_alert:[return_json valueForKey:@"You donot have permission to access order"] title:@"Add To Cart" controller:vc];
+                                }
+                                
+                            }
+                            
+                            
+                        }
+                        else
+                        {
+                            
+                            [RAUtils message_alert:[return_json valueForKey:@"err_msg"] title:@"Check Pending Order" controller:vc] ;
+                        }
+                        
+                        
+                        
+                        
+                    });
+                });
+                
+                
+            }
+//            // [main_vc checklogin:false];
+//            
+//            if(appDelegate.can_create_order)
+//            {
+//                NSString* msg =@"";
+//                if(appDelegate.contact_id.length>0)
+//                {
+//                    msg = [msg stringByAppendingString:@"\n\nCustomer:"];
+//                    msg = [msg stringByAppendingString:appDelegate.customerInfo[@"customer_name"]];
+//                    
+//                }
+//                UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:msg delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Add to pending order", nil),NSLocalizedString(@"Add to new order", nil), nil];
+//                
+//                // alert.
+//                [alert show];
+//            }
+//            else
+//            {
+//                UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:NSLocalizedString(@"", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Add to pending order", nil), nil];
+//                
+//                // alert.
+//                [alert show];
+//            }
+        }
+        else
+        {
+            
+//            if(appDelegate.order_code==nil)
+//                [ self neworder];
+//            else
+                [vc performSelector:addtocart];
+            
+            
+            
+        }
+    }
+
+}
+
 +(void) alert_view :(NSString*) msg title:(NSString*) title 
 {
     if(title==nil)

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

@@ -115,7 +115,7 @@
     
     [iSalesDB execSql:create_contact_image db:db];
     
-    NSString * insert_user_queeniey=@"insert into offline_login(can_show_price,can_see_price,contact_id,user_type,can_cancel_order,can_set_cart_price,can_create_portfolio,can_delete_order,can_submit_order,can_set_tearsheet_price,can_create_order,mode,username,password) values(1,1,'NPD',1,1,1,1,1,1,1,1,'Regualar Mode','QueenieY','lj0EPk2Th9zZCVwrcskZOA==')";
+    NSString * insert_user_queeniey=@"insert into offline_login(can_show_price,can_see_price,contact_id,user_type,can_cancel_order,can_set_cart_price,can_create_portfolio,can_delete_order,can_submit_order,can_set_tearsheet_price,can_create_order,mode,username,password) values(1,1,'NPD',1,1,1,1,1,1,1,1,'Regular Mode','QueenieY','lj0EPk2Th9zZCVwrcskZOA==')";
      [iSalesDB execSql:insert_user_queeniey db:db];
     //   [self execSql:create_model_category db:db];
     

+ 2 - 2
RedAnt ERP Mobile/common/data_provider/iSalesNetwork.h

@@ -64,7 +64,7 @@
 +(NSDictionary*) move_wish2cart:(NSString* ) item_ids;
 +(NSDictionary*) move_cart2wish:(NSString* ) item_ids;
 
-+(NSDictionary*)request_OrderList:(int ) offset limit :(int)limit keywords :(NSString* ) keywords status:(NSString*) status_code;
++(NSDictionary*)request_OrderList:(int ) offset limit :(int)limit keywords :(NSString* ) keywords status:(NSString*) status_code customer:(NSString*) customer;
 +(NSDictionary*)request_OrderDetail:(NSString* ) orderid;
 +(NSDictionary*)commit_Order:(NSString*) order_code;// saved:(bool) saved;
 +(NSDictionary*)copy_Order:(NSString*) order_code;
@@ -77,7 +77,7 @@
 +(NSDictionary*)save_Order:(NSMutableDictionary*)params;
 +(NSDictionary*)delete_Order:(NSString*) order_id;
 +(NSDictionary*)cancel_Order:(NSString*) order_id;
-
++(NSDictionary*)request_PendingOrder:(NSString* ) contactid;
 +(NSDictionary*)request_CustomerInfo:(NSString* ) contactid;
 +(NSDictionary*)update_customer_img: (NSString*) contactid img_url:(NSString*) url ;
 //+(NSDictionary*) new_Customer;

+ 28 - 3
RedAnt ERP Mobile/common/data_provider/iSalesNetwork.m

@@ -1071,7 +1071,7 @@ repeat:{
 //    NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
 //    return jsobj;
 //}
-+(NSDictionary*)request_OrderList:(int ) offset limit :(int)limit keywords :(NSString* ) keywords status:(NSString*) status_code
++(NSDictionary*)request_OrderList:(int ) offset limit :(int)limit keywords :(NSString* ) keywords status:(NSString*) status_code customer:(NSString*) customer
 {
     
 
@@ -1090,6 +1090,8 @@ repeat:{
      [params setValue:[NSString stringWithFormat:@"%d",offset ] forKey:@"offset"];
     [params setValue:[NSString stringWithFormat:@"%d",limit ] forKey:@"limit"];
      [params setValue:keywords forKey:@"keyWord"];
+     [params setValue:customer forKey:@"customer_filter"];
+    
     [params setValue:status_code forKey:@"orderStatus"];
     NSData* json=[self get_json:URL_ORDER_LIST parameters:params];
     if(json==nil)
@@ -2179,6 +2181,7 @@ repeat:{
         
         appDelegate.save_order_logout = false;
         appDelegate.submit_order_logout = false;
+        appDelegate.alert_sold_in_quantities = false;
         
         appDelegate.ipad_perm =nil ;
         appDelegate.user_type = USER_ROLE_UNKNOWN;
@@ -2283,7 +2286,29 @@ repeat:{
     NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
     return jsobj;
 }
-
++(NSDictionary*)request_PendingOrder:(NSString *)contactid
+{
+    if(![self IsNetworkAvailable])
+        return [RAUtils error_json:RESULT_NET_NOTAVAILABLE err_msg:nil];
+    
+    
+    NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
+    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+    if(appDelegate.user!=nil)
+        [params setValue:appDelegate.user forKey:@"user"];
+    //    if(appDelegate.contact_id!=nil)
+    
+    if(appDelegate.password!=nil)
+        [params setValue:appDelegate.password forKey:@"password"];
+    [params setValue:contactid forKey:@"contactId"];
+    NSData* json=[self get_json:URL_CUSTOMER_PENDINGORDER parameters:params];
+    if(json==nil)
+        return nil;
+    NSError *error=nil;
+    NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
+    return jsobj;
+    
+}
 +(NSDictionary*)request_CustomerInfo:(NSString* ) contactid
 {
     if(![self IsNetworkAvailable])
@@ -2395,7 +2420,7 @@ repeat:{
         appDelegate.save_order_logout =[[objheader valueForKey:@"save_order_logout"] boolValue];
         appDelegate.submit_order_logout =[[objheader valueForKey:@"submit_order_logout"] boolValue];
 
-        
+        appDelegate.alert_sold_in_quantities = [[objheader valueForKey:@"alert_sold_in_quantities"] boolValue];
         
 
         

+ 1 - 1
RedAnt ERP Mobile/iSales-DEMO/AppDelegate.h

@@ -64,7 +64,7 @@
 @property bool can_update_contact_info;
 @property bool submit_order_logout;
 @property bool save_order_logout;
-
+@property bool alert_sold_in_quantities;
 @property(readonly) bool price_hidden;
 
 -(void) set_priceHidden:(bool)price_hidden;

+ 3 - 3
RedAnt ERP Mobile/iSales-DEMO/AppDelegate.m

@@ -224,12 +224,12 @@
             }
             else
             {
-                if([mode isEqualToString:@"Regualar Mode"])
+                if([mode isEqualToString:@"Regular Mode"])
                 {
                     NSString* title = self.user;
                     [main_vc.buttonUser setTitle:title forState:UIControlStateNormal];
                     
-                    main_vc.labelMode.text=@"Regualar Mode";
+                    main_vc.labelMode.text=@"Regular Mode";
                     [main_vc.labelMode setTextColor:UIColorFromRGB(0x336699)];
                     //                [main_vc.buttonUser setTitleColor:UIColorFromRGB(0x996633) forState:UIControlStateNormal];
                     //                main_vc.buttonUser.hidden=true;
@@ -242,7 +242,7 @@
                     NSString* title = self.user;
                     [main_vc.buttonUser setTitle:title forState:UIControlStateNormal];
                     
-                    main_vc.labelMode.text=@"TM";
+                    main_vc.labelMode.text=@"Trade Show Mode";
                     [main_vc.labelMode setTextColor:UIColorFromRGB(0x009966)];
                     //                [main_vc.buttonUser setTitleColor:UIColorFromRGB(0x009966) forState:UIControlStateNormal];
                     //                main_vc.buttonUser.hidden=true;

+ 23 - 23
RedAnt ERP Mobile/iSales-DEMO/Base.lproj/Main.storyboard

@@ -135,7 +135,7 @@
                                         <color key="textColor" red="0.59999999999999998" green="0.40000000000000002" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
                                         <nil key="highlightedColor"/>
                                     </label>
-                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="0eT-W5-bga" userLabel="Login">
+                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="0eT-W5-bga" userLabel="sign_in">
                                         <rect key="frame" x="628" y="20" width="140" height="30"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
                                         <state key="normal" title="Sign in">
@@ -260,7 +260,7 @@
                                         <rect key="frame" x="121" y="130" width="57" height="30"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <fontDescription key="fontDescription" type="system" pointSize="17"/>
-                                        <state key="normal" title="Login">
+                                        <state key="normal" title="Sign in">
                                             <color key="titleColor" red="0.59999999999999998" green="0.40000000000000002" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
                                         </state>
                                         <connections>
@@ -645,10 +645,10 @@
             </objects>
             <point key="canvasLocation" x="251" y="-221"/>
         </scene>
-        <!--Login-->
+        <!--Sign_in-->
         <scene sceneID="nj3-gQ-5tx">
             <objects>
-                <viewController storyboardIdentifier="LoginViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="Q1j-qK-Nq8" userLabel="Login" customClass="LoginViewController" sceneMemberID="viewController">
+                <viewController storyboardIdentifier="LoginViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="Q1j-qK-Nq8" userLabel="Sign_in" customClass="LoginViewController" sceneMemberID="viewController">
                     <view key="view" contentMode="scaleToFill" id="vfL-PU-G6Q">
                         <rect key="frame" x="0.0" y="0.0" width="480" height="320"/>
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
@@ -672,7 +672,7 @@
                                 <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
                                 <color key="backgroundColor" red="0.59999999999999998" green="0.40000000000000002" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="20"/>
-                                <state key="normal" title="Login">
+                                <state key="normal" title="Sign in">
                                     <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                                     <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
                                 </state>
@@ -695,7 +695,7 @@
                                     <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
                                 </state>
                             </button>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Login" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="2AI-yS-Vfe">
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Sign in" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="2AI-yS-Vfe">
                                 <rect key="frame" x="60" y="67" width="65" height="26"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="20"/>
@@ -759,10 +759,10 @@
                                 <inset key="separatorInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
                                 <prototypes>
                                     <tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="DetailHeaderCell" rowHeight="550" id="PCZ-Ci-oQf" customClass="DetailHeaderCell">
-                                        <rect key="frame" x="0.0" y="49.5" width="768" height="550"/>
+                                        <rect key="frame" x="0.0" y="50" width="768" height="550"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="PCZ-Ci-oQf" id="DiR-eY-PiR">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="549.5"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="768" height="550"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="USD 123.45" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="fD8-Km-IT3">
@@ -991,18 +991,18 @@
                                         </connections>
                                     </tableViewCell>
                                     <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="DetailImageCell" id="gSx-f2-mrB" customClass="DetailImageCell">
-                                        <rect key="frame" x="0.0" y="599.5" width="768" height="600"/>
+                                        <rect key="frame" x="0.0" y="600" width="768" height="600"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="gSx-f2-mrB" id="k28-H7-ddZ">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="599.5"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="768" height="600"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                         </tableViewCellContentView>
                                     </tableViewCell>
                                     <tableViewCell contentMode="scaleToFill" restorationIdentifier="DetailTopicCell" selectionStyle="default" indentationWidth="10" reuseIdentifier="DetailTopicCell" id="zzF-db-bsq" customClass="DetailTopicCell">
-                                        <rect key="frame" x="0.0" y="1199.5" width="768" height="600"/>
+                                        <rect key="frame" x="0.0" y="1200" width="768" height="600"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="zzF-db-bsq" id="rZ0-x8-h3B">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="599.5"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="768" height="600"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" minimumZoomScale="0.0" maximumZoomScale="0.0" dataMode="prototypes" id="z6w-ak-dlg">
@@ -1057,10 +1057,10 @@
                                         </connections>
                                     </tableViewCell>
                                     <tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="DetailInfoCell" rowHeight="44" id="hYM-aE-rjR" customClass="DetailKVCell">
-                                        <rect key="frame" x="0.0" y="1799.5" width="768" height="44"/>
+                                        <rect key="frame" x="0.0" y="1800" width="768" height="44"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="hYM-aE-rjR" id="o59-aa-UU2">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="43.5"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="768" height="44"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="EOR-Ov-zPZ">
@@ -1840,7 +1840,7 @@
                                         <rect key="frame" x="0.0" y="0.0" width="768" height="44"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="QWz-EJ-Yzy" id="E1L-su-dvV">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="44"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="768" height="43.5"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" id="PJV-YE-GvQ">
@@ -1864,7 +1864,7 @@
                                         <rect key="frame" x="0.0" y="44" width="768" height="44"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="TID-OY-afi" id="yuC-0D-Ebs">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="44"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="768" height="43.5"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Diskspace" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="pVO-Tx-wMs">
@@ -1892,7 +1892,7 @@
                                         <rect key="frame" x="0.0" y="88" width="768" height="44"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Pol-lE-P45" id="FAm-1c-nX0">
-                                            <rect key="frame" x="0.0" y="0.0" width="682" height="44"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="682" height="43.5"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Clean Cache" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="AHm-p1-51h">
@@ -2212,7 +2212,7 @@
                                                 <rect key="frame" x="0.0" y="22" width="768" height="120"/>
                                                 <autoresizingMask key="autoresizingMask"/>
                                                 <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="0QE-xl-8q8" id="tZa-g0-y6H">
-                                                    <rect key="frame" x="0.0" y="0.0" width="768" height="119.5"/>
+                                                    <rect key="frame" x="0.0" y="0.0" width="768" height="120"/>
                                                     <autoresizingMask key="autoresizingMask"/>
                                                     <subviews>
                                                         <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="name aaaaaaaaaaaaa aaaaaaaaaa BBBBB  CCCCC" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="S98-fV-nsC" userLabel="name and description">
@@ -2276,7 +2276,7 @@
                                                             <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
                                                             <nil key="highlightedColor"/>
                                                         </label>
-                                                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Master pack:9999" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="qsG-i3-KAv">
+                                                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Sold in QTY of:9999" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="qsG-i3-KAv">
                                                             <rect key="frame" x="589" y="14" width="144" height="21"/>
                                                             <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
                                                             <fontDescription key="fontDescription" type="system" pointSize="17"/>
@@ -5569,7 +5569,7 @@ redantsupport@united-us.net</string>
                                         </connections>
                                     </collectionViewCell>
                                     <collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="CategoryCellNPD" id="maC-dP-Mdd" customClass="CategoryCellNPD">
-                                        <rect key="frame" x="369" y="214.5" width="180" height="251"/>
+                                        <rect key="frame" x="369" y="215" width="180" height="251"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
                                         <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
                                             <rect key="frame" x="0.0" y="0.0" width="180" height="251"/>
@@ -6210,10 +6210,10 @@ redantsupport@united-us.net</string>
                         <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                         <prototypes>
                             <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="Ebw-26-5Ud">
-                                <rect key="frame" x="0.0" y="22" width="768" height="44"/>
+                                <rect key="frame" x="0.0" y="86" width="768" height="44"/>
                                 <autoresizingMask key="autoresizingMask"/>
                                 <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Ebw-26-5Ud" id="gop-RV-8fg">
-                                    <rect key="frame" x="0.0" y="0.0" width="768" height="43.5"/>
+                                    <rect key="frame" x="0.0" y="0.0" width="768" height="44"/>
                                     <autoresizingMask key="autoresizingMask"/>
                                 </tableViewCellContentView>
                             </tableViewCell>
@@ -7209,7 +7209,7 @@ redantsupport@united-us.net</string>
         <image name="menu_open" width="36" height="36"/>
         <image name="newcustomer" width="32" height="32"/>
         <image name="neworder" width="40" height="40"/>
-        <image name="npd_logo" width="187" height="49"/>
+        <image name="npd_logo" width="69" height="50"/>
         <image name="order" width="72" height="72"/>
         <image name="pick_bg" width="280" height="280"/>
         <image name="profle" width="64" height="64"/>

+ 11 - 5
RedAnt ERP Mobile/iSales-NPD.xcodeproj/project.pbxproj

@@ -117,6 +117,7 @@
 		7162A5E91C5899F700AB630E /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7162A5E81C5899F700AB630E /* MainViewController.m */; };
 		716961B519594E1000B19FB4 /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 716961B419594E1000B19FB4 /* libsqlite3.dylib */; };
 		71777FC61C8AC97300DA2511 /* debug_category_filter.json in Resources */ = {isa = PBXBuildFile; fileRef = 71777FC51C8AC97300DA2511 /* debug_category_filter.json */; };
+		7186C25D1C97A6EE00CB43F4 /* FunctionTestViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7186C25C1C97A6EE00CB43F4 /* FunctionTestViewController.m */; };
 		718716251C433D8B00F25860 /* ExternalAccessory.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 718716241C433D8B00F25860 /* ExternalAccessory.framework */; };
 		718716271C433D9700F25860 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 718716261C433D9700F25860 /* AudioToolbox.framework */; };
 		718716291C433DA400F25860 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 718716281C433DA400F25860 /* AVFoundation.framework */; };
@@ -176,7 +177,7 @@
 		712C40B51C7310F4000E6831 /* CartGeneralNotesViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CartGeneralNotesViewController.m; path = common/Functions/cart/CartGeneralNotesViewController.m; sourceTree = SOURCE_ROOT; };
 		712C40B71C731126000E6831 /* ItemNotesViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ItemNotesViewController.h; path = common/Functions/cart/ItemNotesViewController.h; sourceTree = SOURCE_ROOT; };
 		712C40B81C731126000E6831 /* ItemNotesViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ItemNotesViewController.m; path = common/Functions/cart/ItemNotesViewController.m; sourceTree = SOURCE_ROOT; };
-		713F76A61929F4A7006A7305 /* NPD iSales.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "NPD iSales.app"; sourceTree = BUILT_PRODUCTS_DIR; };
+		713F76A61929F4A7006A7305 /* NPD Mobile.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "NPD Mobile.app"; sourceTree = BUILT_PRODUCTS_DIR; };
 		713F76A91929F4A7006A7305 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
 		713F76AB1929F4A7006A7305 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
 		713F76AD1929F4A7006A7305 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
@@ -378,6 +379,8 @@
 		716387D3195408E7006E65E6 /* config.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; };
 		716961B419594E1000B19FB4 /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = usr/lib/libsqlite3.dylib; sourceTree = SDKROOT; };
 		71777FC51C8AC97300DA2511 /* debug_category_filter.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = debug_category_filter.json; sourceTree = "<group>"; };
+		7186C25B1C97A6EE00CB43F4 /* FunctionTestViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FunctionTestViewController.h; path = common/Functions/sidemenu/FunctionTestViewController.h; sourceTree = SOURCE_ROOT; };
+		7186C25C1C97A6EE00CB43F4 /* FunctionTestViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FunctionTestViewController.m; path = common/Functions/sidemenu/FunctionTestViewController.m; sourceTree = SOURCE_ROOT; };
 		718716221C433D5000F25860 /* libScanApiCore.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libScanApiCore.a; path = ../lib/libScanApiCore.a; sourceTree = "<group>"; };
 		718716241C433D8B00F25860 /* ExternalAccessory.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ExternalAccessory.framework; path = System/Library/Frameworks/ExternalAccessory.framework; sourceTree = SDKROOT; };
 		718716261C433D9700F25860 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
@@ -537,7 +540,7 @@
 		713F76A71929F4A7006A7305 /* Products */ = {
 			isa = PBXGroup;
 			children = (
-				713F76A61929F4A7006A7305 /* NPD iSales.app */,
+				713F76A61929F4A7006A7305 /* NPD Mobile.app */,
 			);
 			name = Products;
 			sourceTree = "<group>";
@@ -748,6 +751,8 @@
 				7162A5D71C5876E300AB630E /* ScannerSettingViewController.m */,
 				7162A5D81C5876E300AB630E /* SettingViewController.h */,
 				7162A5D91C5876E300AB630E /* SettingViewController.m */,
+				7186C25B1C97A6EE00CB43F4 /* FunctionTestViewController.h */,
+				7186C25C1C97A6EE00CB43F4 /* FunctionTestViewController.m */,
 			);
 			name = sideMenu;
 			sourceTree = "<group>";
@@ -1077,7 +1082,7 @@
 			);
 			name = "iSales-NPD";
 			productName = "iSales-NPD";
-			productReference = 713F76A61929F4A7006A7305 /* NPD iSales.app */;
+			productReference = 713F76A61929F4A7006A7305 /* NPD Mobile.app */;
 			productType = "com.apple.product-type.application";
 		};
 /* End PBXNativeTarget section */
@@ -1242,6 +1247,7 @@
 				7162A5021C586F5B00AB630E /* AddressEditorViewController.m in Sources */,
 				7162A55C1C58724700AB630E /* ContactListTableViewCell.m in Sources */,
 				71DF745C1C575E7900F2789C /* CommonEditorCellEdit.m in Sources */,
+				7186C25D1C97A6EE00CB43F4 /* FunctionTestViewController.m in Sources */,
 				71DF74691C575E7900F2789C /* MonthPickerViewController.m in Sources */,
 				71DF74371C575D6600F2789C /* CommonGridViewController.m in Sources */,
 				7162A5B51C58738600AB630E /* ScannerViewController.m in Sources */,
@@ -1444,7 +1450,7 @@
 				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
 				LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib";
 				PRODUCT_BUNDLE_IDENTIFIER = "usai.apex.iSales-NPD";
-				PRODUCT_NAME = "NPD iSales";
+				PRODUCT_NAME = "NPD Mobile";
 				PROVISIONING_PROFILE = "";
 				WRAPPER_EXTENSION = app;
 			};
@@ -1463,7 +1469,7 @@
 				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
 				LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib";
 				PRODUCT_BUNDLE_IDENTIFIER = "usai.apex.iSales-NPD";
-				PRODUCT_NAME = "NPD iSales";
+				PRODUCT_NAME = "NPD Mobile";
 				PROVISIONING_PROFILE = "";
 				WRAPPER_EXTENSION = app;
 			};

+ 4 - 4
RedAnt ERP Mobile/iSales-NPD.xcodeproj/xcuserdata/Ray.xcuserdatad/xcschemes/RedAnt ERP Suite.xcscheme

@@ -15,7 +15,7 @@
             <BuildableReference
                BuildableIdentifier = "primary"
                BlueprintIdentifier = "713F76A51929F4A7006A7305"
-               BuildableName = "NPD iSales.app"
+               BuildableName = "NPD Mobile.app"
                BlueprintName = "iSales-NPD"
                ReferencedContainer = "container:iSales-NPD.xcodeproj">
             </BuildableReference>
@@ -43,7 +43,7 @@
          <BuildableReference
             BuildableIdentifier = "primary"
             BlueprintIdentifier = "713F76A51929F4A7006A7305"
-            BuildableName = "NPD iSales.app"
+            BuildableName = "NPD Mobile.app"
             BlueprintName = "iSales-NPD"
             ReferencedContainer = "container:iSales-NPD.xcodeproj">
          </BuildableReference>
@@ -66,7 +66,7 @@
          <BuildableReference
             BuildableIdentifier = "primary"
             BlueprintIdentifier = "713F76A51929F4A7006A7305"
-            BuildableName = "NPD iSales.app"
+            BuildableName = "NPD Mobile.app"
             BlueprintName = "iSales-NPD"
             ReferencedContainer = "container:iSales-NPD.xcodeproj">
          </BuildableReference>
@@ -97,7 +97,7 @@
          <BuildableReference
             BuildableIdentifier = "primary"
             BlueprintIdentifier = "713F76A51929F4A7006A7305"
-            BuildableName = "NPD iSales.app"
+            BuildableName = "NPD Mobile.app"
             BlueprintName = "iSales-NPD"
             ReferencedContainer = "container:iSales-NPD.xcodeproj">
          </BuildableReference>

+ 8 - 1
RedAnt ERP Mobile/iSales-NPD/AppDelegate.h

@@ -66,7 +66,7 @@
 @property bool can_update_contact_info;
 @property bool submit_order_logout;
 @property bool save_order_logout;
-
+@property bool alert_sold_in_quantities;
 @property(readonly) bool price_hidden;
 
 -(void) set_priceHidden:(bool)price_hidden;
@@ -105,4 +105,11 @@
 
 // scanner test
 -(void) test_onDecodedDataResult:(NSString*) value;
+
+// printer
+
+@property (strong, nonatomic) NSString * printerURL;
+-(void) printPdf:(NSString*) url;
+
+
 @end

+ 44 - 3
RedAnt ERP Mobile/iSales-NPD/AppDelegate.m

@@ -9,6 +9,7 @@
 #import "AppDelegate.h"
 #import "UILabel+FontAppearance.h"
 #import "MainViewController.h"
+#import "PDFViewController.h"
 @implementation AppDelegate
 {
 #ifdef USE_SOFTSCAN
@@ -159,7 +160,7 @@
     self.order_customer_id = nil;
     self.customerInfo = nil;
     self.contact_id = nil;
-    [self SetMode:nil];
+ //   [self SetMode:nil];
  //   [self SetSo:nil];
     
     
@@ -215,9 +216,9 @@
         }
         else
         {
-            if([mode isEqualToString:@"Regualar Mode"])
+            if([mode isEqualToString:@"Regular Mode"])
             {
-                self.mode=@"Regualar Mode";
+                self.mode=@"Regular Mode";
                 NSString* title = self.user;
                 [main_vc.buttonUser setTitle:title forState:UIControlStateNormal];
                 
@@ -1001,4 +1002,44 @@
 }
 
 
+
+-(void) printPdf:(NSString*) url
+{
+    PDFViewController *ViewController = [self.main_vc.storyboard instantiateViewControllerWithIdentifier:@"PDFViewController"];
+    ViewController.url = url;
+    ViewController.canSave = false;
+//    NSString* subject;
+    //                    if (company.length==0) {
+    
+//    NSString* cur_time =[RAUtils current_date];
+ //   subject =name;//[NSString stringWithFormat:@"NPD Product List %@",cur_time];
+    
+//    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+//    NSString* customer_email=    [appDelegate.customerInfo valueForKey:@"customer_email"];
+//    
+//    
+//    NSMutableArray* send_to = [[NSMutableArray alloc]init];
+//    if(customer_email.length>0)
+//    {
+//        send_to=[[customer_email componentsSeparatedByString:NSLocalizedString(@";", nil)] mutableCopy];
+//        //                            customer_email compo
+//        //                            [send_to addObject:customer_email];
+//    }
+//    ViewController.mail_to = send_to;
+    
+    //                    }
+    //                    else
+    //                    {
+    //                        subject = [NSString stringWithFormat:@"Tear sheet for %@",company ];
+    //                    }
+//    ViewController.attachment_name = [NSString stringWithFormat:@"NPD_Product_List %@.pdf",cur_time];
+//    ViewController.mail_subject = subject;
+    ViewController.autoPrint=true;
+    ViewController.hidenavi = false;
+    [self.main_vc.navigationController pushViewController:ViewController animated:YES];
+  //  [ViewController.navigationController setNavigationBarHidden:NO animated:NO];
+    
+
+}
+
 @end

+ 125 - 74
RedAnt ERP Mobile/iSales-NPD/Base.lproj/Main.storyboard

@@ -249,7 +249,7 @@
                                         <color key="textColor" red="0.59999999999999998" green="0.40000000000000002" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
                                         <nil key="highlightedColor"/>
                                     </label>
-                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="0eT-W5-bga" userLabel="Login">
+                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="0eT-W5-bga" userLabel="sign_in">
                                         <rect key="frame" x="628" y="20" width="140" height="30"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
                                         <state key="normal" title="Sign in">
@@ -335,14 +335,14 @@
                                                     <autoresizingMask key="autoresizingMask"/>
                                                     <subviews>
                                                         <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="pki-xD-OOT">
-                                                            <rect key="frame" x="15" y="12" width="32" height="20"/>
+                                                            <rect key="frame" x="15" y="12" width="31.5" height="19.5"/>
                                                             <autoresizingMask key="autoresizingMask"/>
                                                             <fontDescription key="fontDescription" type="system" pointSize="16"/>
                                                             <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
                                                             <nil key="highlightedColor"/>
                                                         </label>
                                                         <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Detail" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="a18-fA-KeX">
-                                                            <rect key="frame" x="234" y="12" width="41" height="20"/>
+                                                            <rect key="frame" x="233.5" y="12" width="41.5" height="19.5"/>
                                                             <autoresizingMask key="autoresizingMask"/>
                                                             <fontDescription key="fontDescription" type="system" pointSize="16"/>
                                                             <color key="textColor" red="0.55686274509803924" green="0.55686274509803924" blue="0.57647058823529407" alpha="1" colorSpace="calibratedRGB"/>
@@ -371,10 +371,10 @@
                                         <nil key="highlightedColor"/>
                                     </label>
                                     <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="M7a-qh-Dgr">
-                                        <rect key="frame" x="121" y="130" width="57" height="30"/>
+                                        <rect key="frame" x="110" y="130" width="80" height="30"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <fontDescription key="fontDescription" type="system" pointSize="17"/>
-                                        <state key="normal" title="Login">
+                                        <state key="normal" title="Sign in">
                                             <color key="titleColor" red="0.59999999999999998" green="0.40000000000000002" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
                                         </state>
                                         <connections>
@@ -481,7 +481,7 @@
                             <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="120" sectionHeaderHeight="22" sectionFooterHeight="22" id="Bod-ih-aFz">
                                 <rect key="frame" x="0.0" y="44" width="768" height="936"/>
                                 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                <color key="backgroundColor" red="0.94901960780000005" green="0.93333333330000001" blue="0.91764705879999997" alpha="1" colorSpace="calibratedRGB"/>
+                                <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                                 <prototypes>
                                     <tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="WatchListItemCell" rowHeight="120" id="Hjj-gq-Qs5" customClass="ModelItemCell">
                                         <rect key="frame" x="0.0" y="22" width="768" height="120"/>
@@ -585,7 +585,7 @@
                             <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="120" sectionHeaderHeight="22" sectionFooterHeight="22" id="kOF-xZ-ifb">
                                 <rect key="frame" x="0.0" y="44" width="768" height="936"/>
                                 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                <color key="backgroundColor" red="0.94901960780000005" green="0.93333333330000001" blue="0.91764705879999997" alpha="1" colorSpace="calibratedRGB"/>
+                                <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                                 <prototypes>
                                     <tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="WatchListItemCell" rowHeight="120" id="L9J-GT-Vuy" customClass="ModelItemCell">
                                         <rect key="frame" x="0.0" y="22" width="768" height="120"/>
@@ -764,10 +764,10 @@
             </objects>
             <point key="canvasLocation" x="251" y="-221"/>
         </scene>
-        <!--Login-->
+        <!--Sign_in-->
         <scene sceneID="nj3-gQ-5tx">
             <objects>
-                <viewController storyboardIdentifier="LoginViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="Q1j-qK-Nq8" userLabel="Login" customClass="LoginViewController" sceneMemberID="viewController">
+                <viewController storyboardIdentifier="LoginViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="Q1j-qK-Nq8" userLabel="Sign_in" customClass="LoginViewController" sceneMemberID="viewController">
                     <view key="view" contentMode="scaleToFill" id="vfL-PU-G6Q">
                         <rect key="frame" x="0.0" y="0.0" width="480" height="320"/>
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
@@ -791,7 +791,7 @@
                                 <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
                                 <color key="backgroundColor" red="0.59999999999999998" green="0.40000000000000002" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="20"/>
-                                <state key="normal" title="Login">
+                                <state key="normal" title="Sign in">
                                     <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                                     <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
                                 </state>
@@ -814,7 +814,7 @@
                                     <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
                                 </state>
                             </button>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Login" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="2AI-yS-Vfe">
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Sign in" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="2AI-yS-Vfe">
                                 <rect key="frame" x="60" y="67" width="65" height="26"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="20"/>
@@ -940,7 +940,7 @@
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" restorationIdentifier="property" text="property" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="v0v-80-iIZ">
-                                                    <rect key="frame" x="450" y="241" width="130" height="21"/>
+                                                    <rect key="frame" x="450" y="226" width="130" height="21"/>
                                                     <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                                     <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
@@ -961,7 +961,7 @@
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="prop val" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="EvS-UE-8Nb">
-                                                    <rect key="frame" x="588" y="241" width="130" height="21"/>
+                                                    <rect key="frame" x="588" y="226" width="130" height="21"/>
                                                     <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                                     <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
@@ -1075,13 +1075,11 @@
                                                     <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
                                                     <nil key="highlightedColor"/>
                                                 </label>
-                                                <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="center" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="PHs-2n-Oe4">
+                                                <view contentMode="scaleToFill" id="HE5-zj-CRh" userLabel="Description RTLabel" customClass="RTLabel">
                                                     <rect key="frame" x="35" y="40" width="698" height="56"/>
                                                     <autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
-                                                    <fontDescription key="fontDescription" type="system" pointSize="22"/>
-                                                    <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
-                                                    <nil key="highlightedColor"/>
-                                                </label>
+                                                    <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                                </view>
                                                 <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Price:" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="tuB-FV-n4t">
                                                     <rect key="frame" x="450" y="104" width="74" height="26"/>
                                                     <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
@@ -1104,9 +1102,10 @@
                                             <outlet property="btnaddWish" destination="AHJ-EJ-V5A" id="MWP-hv-a4g"/>
                                             <outlet property="count_Label" destination="U9s-Ng-Fzb" id="WZo-1v-DoQ"/>
                                             <outlet property="cqyt_label" destination="g3j-Vx-s9x" id="cC2-Dd-4xI"/>
-                                            <outlet property="descriptionLabel" destination="PHs-2n-Oe4" id="5a3-qg-BaT"/>
+                                            <outlet property="descriptionRTLabel" destination="HE5-zj-CRh" id="gk4-Sq-64o"/>
                                             <outlet property="eta_label" destination="Usu-57-rC5" id="cIJ-PM-tEy"/>
                                             <outlet property="etaval_label" destination="Ydc-b8-vOC" id="zhh-qS-HNd"/>
+                                            <outlet property="incoming_stock_label" destination="fNy-qU-zpJ" id="l0g-On-WxI"/>
                                             <outlet property="incomingcount_Label" destination="GP5-lh-dfh" id="K9p-dl-xxC"/>
                                             <outlet property="model_label" destination="ec3-Qs-dVj" id="8WN-ol-ISC"/>
                                             <outlet property="pageControl" destination="dlZ-DL-v21" id="sVb-8O-74F"/>
@@ -2331,7 +2330,7 @@
                                                             <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
                                                             <nil key="highlightedColor"/>
                                                         </label>
-                                                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Master pack:9999" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="qsG-i3-KAv">
+                                                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Sold in QTY of:9999" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="qsG-i3-KAv">
                                                             <rect key="frame" x="609" y="14" width="144" height="21"/>
                                                             <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
                                                             <fontDescription key="fontDescription" type="system" pointSize="17"/>
@@ -2413,8 +2412,8 @@
                                         <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
                                         <nil key="highlightedColor"/>
                                     </label>
-                                    <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Sub Total Price:" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="tXb-kL-1kM" userLabel="total price">
-                                        <rect key="frame" x="502" y="62" width="117" height="18"/>
+                                    <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Subtotal Price:" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="tXb-kL-1kM" userLabel="total price">
+                                        <rect key="frame" x="502" y="62" width="117" height="20"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
                                         <fontDescription key="fontDescription" type="system" pointSize="16"/>
                                         <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
@@ -2424,6 +2423,7 @@
                                         <rect key="frame" x="627" y="62" width="124" height="18"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
                                         <fontDescription key="fontDescription" type="system" pointSize="16"/>
+                                        <color key="textColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
                                         <nil key="highlightedColor"/>
                                     </label>
                                     <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="iCF-vq-woI" userLabel="value">
@@ -2445,9 +2445,9 @@
                                         <nil key="highlightedColor"/>
                                     </label>
                                     <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="jew-M1-our">
-                                        <rect key="frame" x="634" y="83" width="117" height="30"/>
+                                        <rect key="frame" x="627" y="83" width="120" height="30"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
-                                        <state key="normal" title="Place Order"/>
+                                        <state key="normal" backgroundImage="place_order"/>
                                         <userDefinedRuntimeAttributes>
                                             <userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
                                                 <integer key="value" value="15"/>
@@ -2498,19 +2498,6 @@
                                         <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
                                         <nil key="highlightedColor"/>
                                     </label>
-                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="Tqs-85-7UT">
-                                        <rect key="frame" x="502" y="83" width="117" height="30"/>
-                                        <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
-                                        <state key="normal" title="Edit"/>
-                                        <userDefinedRuntimeAttributes>
-                                            <userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
-                                                <integer key="value" value="15"/>
-                                            </userDefinedRuntimeAttribute>
-                                        </userDefinedRuntimeAttributes>
-                                        <connections>
-                                            <action selector="onEditClick:" destination="Cwo-Rn-ZMW" eventType="touchUpInside" id="P5Y-zO-eCp"/>
-                                        </connections>
-                                    </button>
                                     <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="7DL-ww-tGr">
                                         <rect key="frame" x="15" y="83" width="107" height="30"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
@@ -2540,6 +2527,19 @@
                                         <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
                                         <nil key="highlightedColor"/>
                                     </label>
+                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="Tqs-85-7UT">
+                                        <rect key="frame" x="15" y="10" width="170" height="30"/>
+                                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                        <state key="normal" title="Edit"/>
+                                        <userDefinedRuntimeAttributes>
+                                            <userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
+                                                <integer key="value" value="15"/>
+                                            </userDefinedRuntimeAttribute>
+                                        </userDefinedRuntimeAttributes>
+                                        <connections>
+                                            <action selector="onEditClick:" destination="Cwo-Rn-ZMW" eventType="touchUpInside" id="P5Y-zO-eCp"/>
+                                        </connections>
+                                    </button>
                                 </subviews>
                                 <color key="backgroundColor" red="0.94901960780000005" green="0.93333333330000001" blue="0.91764705879999997" alpha="1" colorSpace="calibratedRGB"/>
                             </view>
@@ -2641,6 +2641,56 @@
             </objects>
             <point key="canvasLocation" x="2288" y="2183"/>
         </scene>
+        <!--Black Box-->
+        <scene sceneID="cVU-iS-CVg">
+            <objects>
+                <viewController storyboardIdentifier="FunctionTestViewController" title="Black Box" useStoryboardIdentifierAsRestorationIdentifier="YES" id="kPm-vh-Xir" customClass="FunctionTestViewController" sceneMemberID="viewController">
+                    <view key="view" contentMode="scaleToFill" id="c5B-Gi-I5E">
+                        <rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="f2s-mC-wXH">
+                                <rect key="frame" x="60" y="262" width="250" height="30"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                <state key="normal" title="Background print"/>
+                                <connections>
+                                    <action selector="onBackgroundprintClick:" destination="kPm-vh-Xir" eventType="touchUpInside" id="ADx-Bs-IY1"/>
+                                </connections>
+                            </button>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="3Vw-af-LUM">
+                                <rect key="frame" x="60" y="201" width="250" height="30"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                <state key="normal" title="Printer Setting"/>
+                                <connections>
+                                    <action selector="onPrintersettingClick:" destination="kPm-vh-Xir" eventType="touchUpInside" id="ign-k9-WDe"/>
+                                </connections>
+                            </button>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="printer will show here" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="hx4-8E-afz">
+                                <rect key="frame" x="342" y="210" width="190" height="21"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="4aT-F9-r30">
+                                <rect key="frame" x="94" y="388" width="183" height="30"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                <state key="normal" title="Print"/>
+                                <connections>
+                                    <action selector="OnPrintParamsClick:" destination="kPm-vh-Xir" eventType="touchUpInside" id="5NP-He-9AA"/>
+                                </connections>
+                            </button>
+                        </subviews>
+                        <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                    </view>
+                    <connections>
+                        <outlet property="labelPrintername" destination="hx4-8E-afz" id="Uu8-1I-s5L"/>
+                    </connections>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="SqT-Vo-cY8" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="1215" y="4503"/>
+        </scene>
         <!--PDFListViewController-->
         <scene sceneID="Ltr-sL-Rlg">
             <objects>
@@ -2794,7 +2844,7 @@
                                 <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
                                 <color key="backgroundColor" red="0.94901960780000005" green="0.93333333330000001" blue="0.91764705879999997" alpha="1" colorSpace="calibratedRGB"/>
                                 <items>
-                                    <barButtonItem title="Status Filter" id="WKH-18-Hk1">
+                                    <barButtonItem title="Select Order Status" id="WKH-18-Hk1">
                                         <color key="tintColor" red="0.59999999999999998" green="0.40000000000000002" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
                                         <connections>
                                             <action selector="onStatusFilterClick:" destination="Jst-hh-WTF" id="yeU-H5-b4F"/>
@@ -2802,7 +2852,7 @@
                                     </barButtonItem>
                                     <barButtonItem style="plain" systemItem="flexibleSpace" id="XgM-Ds-OBI"/>
                                     <barButtonItem style="plain" id="dZA-gs-cR2">
-                                        <searchBar key="customView" contentMode="redraw" searchBarStyle="minimal" placeholder="Name, Address, Phone etc" id="afv-fP-PRn">
+                                        <searchBar key="customView" contentMode="redraw" searchBarStyle="minimal" placeholder="Sale order number, sales rep, create by, contact" id="afv-fP-PRn">
                                             <rect key="frame" x="292" y="0.0" width="364" height="44"/>
                                             <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
                                             <textInputTraits key="textInputTraits"/>
@@ -2830,7 +2880,7 @@
                                         <rect key="frame" x="0.0" y="22" width="768" height="66"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="H8t-DU-AtW" id="q6R-9a-SsD">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="65.5"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="768" height="66"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="WEB1509140024" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="fu3-Bf-ZH2" userLabel="So#">
@@ -2841,7 +2891,7 @@
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="12345678.00" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="N3e-hc-gFF" userLabel="price">
-                                                    <rect key="frame" x="492" y="31" width="100" height="21"/>
+                                                    <rect key="frame" x="492" y="23" width="100" height="21"/>
                                                     <autoresizingMask key="autoresizingMask" flexibleMinX="YES" heightSizable="YES"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="15"/>
                                                     <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
@@ -2868,7 +2918,7 @@
                                                     <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
                                                     <nil key="highlightedColor"/>
                                                 </label>
-                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="99999" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="kLZ-2K-sGp">
+                                                <label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="99999" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="kLZ-2K-sGp">
                                                     <rect key="frame" x="492" y="5" width="100" height="21"/>
                                                     <autoresizingMask key="autoresizingMask" flexibleMinX="YES" heightSizable="YES"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="15"/>
@@ -2920,15 +2970,15 @@
                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                 <color key="color" red="0.59999999999999998" green="0.40000000000000002" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
                             </activityIndicatorView>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Filter:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="KcV-bn-bA0">
-                                <rect key="frame" x="20" y="44" width="46" height="21"/>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Status Selected:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="KcV-bn-bA0">
+                                <rect key="frame" x="20" y="44" width="131" height="21"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                 <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
                                 <nil key="highlightedColor"/>
                             </label>
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="yE9-Jb-XL3">
-                                <rect key="frame" x="74" y="44" width="674" height="21"/>
+                                <rect key="frame" x="153" y="44" width="595" height="21"/>
                                 <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                 <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
@@ -4613,10 +4663,10 @@
                                 <color key="backgroundColor" red="0.93725490199999995" green="0.93725490199999995" blue="0.95686274510000002" alpha="1" colorSpace="calibratedRGB"/>
                                 <prototypes>
                                     <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="CommonEditorCellModel" rowHeight="140" id="n4c-77-hLv" customClass="CommonEditorCellModel">
-                                        <rect key="frame" x="0.0" y="49.5" width="768" height="140"/>
+                                        <rect key="frame" x="0.0" y="50" width="768" height="140"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="n4c-77-hLv" id="DvL-17-pkX">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="139.5"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="768" height="140"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" id="NKX-ck-Bay">
@@ -4673,10 +4723,10 @@
                                         </connections>
                                     </tableViewCell>
                                     <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="CommonEditorCellEnum" id="Xog-Cl-i5m" customClass="CommonEditorCellEnum">
-                                        <rect key="frame" x="0.0" y="189.5" width="768" height="44"/>
+                                        <rect key="frame" x="0.0" y="190" width="768" height="44"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Xog-Cl-i5m" id="POr-6Z-bgE">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="43.5"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="768" height="44"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="0dI-Tu-gdc">
@@ -4699,10 +4749,10 @@
                                         </connections>
                                     </tableViewCell>
                                     <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="CommonEditorCellSwitch" rowHeight="44" id="bU5-1H-8Ym" customClass="CommonEditorCellSwitch">
-                                        <rect key="frame" x="0.0" y="233.5" width="768" height="44"/>
+                                        <rect key="frame" x="0.0" y="234" width="768" height="44"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="bU5-1H-8Ym" id="ThQ-zS-Kmf">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="43.5"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="768" height="44"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="bFQ-1F-kTA">
@@ -4724,10 +4774,10 @@
                                         </connections>
                                     </tableViewCell>
                                     <tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="CommonEditorCellEdit" rowHeight="44" id="59Q-8C-fQM" customClass="CommonEditorCellEdit">
-                                        <rect key="frame" x="0.0" y="277.5" width="768" height="44"/>
+                                        <rect key="frame" x="0.0" y="278" width="768" height="44"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="59Q-8C-fQM" id="nqb-0z-RP8">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="43.5"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="768" height="44"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="hWg-2k-qYt">
@@ -4751,10 +4801,10 @@
                                         </connections>
                                     </tableViewCell>
                                     <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="CommonEditorCellSignature" rowHeight="140" id="1Ld-bY-s0l" customClass="CommonEditorCellSignature">
-                                        <rect key="frame" x="0.0" y="321.5" width="768" height="140"/>
+                                        <rect key="frame" x="0.0" y="322" width="768" height="140"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="1Ld-bY-s0l" id="keH-oZ-gZA">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="139.5"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="768" height="140"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="characterWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="U5y-QU-OQP">
@@ -4776,10 +4826,10 @@
                                         </connections>
                                     </tableViewCell>
                                     <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="CommonEditorCellLabel" id="n0g-se-pw1" customClass="CommonEditorCellLabel">
-                                        <rect key="frame" x="0.0" y="461.5" width="768" height="44"/>
+                                        <rect key="frame" x="0.0" y="462" width="768" height="44"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="n0g-se-pw1" id="MTt-Lc-1Mu">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="43.5"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="768" height="44"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="9Xs-tl-56v">
@@ -4804,10 +4854,10 @@
                                         </connections>
                                     </tableViewCell>
                                     <tableViewCell contentMode="scaleToFill" restorationIdentifier="nEditorCellAction" selectionStyle="default" indentationWidth="10" reuseIdentifier="CommonEditorCellAction" id="lUK-Sp-QMR" customClass="CommonEditorCellAction">
-                                        <rect key="frame" x="0.0" y="505.5" width="768" height="44"/>
+                                        <rect key="frame" x="0.0" y="506" width="768" height="44"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="lUK-Sp-QMR" id="SU0-Og-nm9">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="43.5"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="768" height="44"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="tfe-Hh-t2Z">
@@ -4847,10 +4897,10 @@
             </objects>
             <point key="canvasLocation" x="3490" y="2183"/>
         </scene>
-        <!--ItemSearch Filter-->
+        <!--Item Search Filter-->
         <scene sceneID="0Nu-tT-dtq">
             <objects>
-                <viewController storyboardIdentifier="ItemSearchFilterViewController" title="ItemSearch Filter" useStoryboardIdentifierAsRestorationIdentifier="YES" id="CpN-Ut-Elb" customClass="ItemSearchFilterViewController" sceneMemberID="viewController">
+                <viewController storyboardIdentifier="ItemSearchFilterViewController" title="Item Search Filter" useStoryboardIdentifierAsRestorationIdentifier="YES" id="CpN-Ut-Elb" customClass="ItemSearchFilterViewController" sceneMemberID="viewController">
                     <view key="view" contentMode="scaleToFill" id="jaY-O0-cYp">
                         <rect key="frame" x="0.0" y="0.0" width="540" height="620"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -4962,7 +5012,7 @@
                                 <rect key="frame" x="0.0" y="0.0" width="480" height="320"/>
                                 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                 <subviews>
-                                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="iSales-NPD" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="bFj-iV-Tgz">
+                                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="NPD Mobile" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="bFj-iV-Tgz">
                                         <rect key="frame" x="140" y="84" width="207" height="21"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <fontDescription key="fontDescription" type="system" pointSize="17"/>
@@ -5960,7 +6010,7 @@ redantsupport@united-us.net</string>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <view contentMode="scaleToFill" id="N1s-I8-bJv" customClass="RTLabel">
-                                                    <rect key="frame" x="15" y="8" width="738" height="28"/>
+                                                    <rect key="frame" x="15" y="8" width="738" height="28.5"/>
                                                     <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                                     <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                                                 </view>
@@ -6020,7 +6070,7 @@ redantsupport@united-us.net</string>
                                         <rect key="frame" x="0.0" y="22" width="768" height="140"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="aNn-5E-yfU" id="blR-1z-uB4">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="139.5"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="768" height="140"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" id="Joe-9c-mhx">
@@ -6105,7 +6155,7 @@ redantsupport@united-us.net</string>
                                         <rect key="frame" x="0.0" y="162" width="768" height="44"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="0El-DP-xYZ" id="WXt-bL-3En">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="43.5"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="768" height="44"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="e6Y-d9-upz">
@@ -6131,11 +6181,11 @@ redantsupport@united-us.net</string>
                                         <rect key="frame" x="0.0" y="206" width="768" height="44"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="J3d-cG-qdt" id="j4j-Ny-UDJ">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="43.5"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="768" height="44"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Way-zK-rPT">
-                                                    <rect key="frame" x="15" y="11" width="284" height="21"/>
+                                                    <rect key="frame" x="15" y="11" width="629" height="21"/>
                                                     <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                                     <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
@@ -6156,7 +6206,7 @@ redantsupport@united-us.net</string>
                                         <rect key="frame" x="0.0" y="250" width="768" height="44"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="xOa-Xr-gTr" id="j8Z-My-v13">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="43.5"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="768" height="44"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="9dp-dT-Iun">
@@ -6183,7 +6233,7 @@ redantsupport@united-us.net</string>
                                         <rect key="frame" x="0.0" y="294" width="768" height="140"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="INw-X5-a6L" id="dMk-dO-jRe">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="139.5"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="768" height="140"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="ims-8q-OTf">
@@ -6208,7 +6258,7 @@ redantsupport@united-us.net</string>
                                         <rect key="frame" x="0.0" y="434" width="768" height="44"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="WbT-Mq-Y44" id="qI1-h7-szu">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="43.5"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="768" height="44"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="b2f-XC-2x6">
@@ -6236,7 +6286,7 @@ redantsupport@united-us.net</string>
                                         <rect key="frame" x="0.0" y="478" width="768" height="44"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="sAj-KH-YeP" id="hWS-Yn-EOD">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="43.5"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="768" height="44"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="1DW-rj-4BZ">
@@ -6256,7 +6306,7 @@ redantsupport@united-us.net</string>
                                         <rect key="frame" x="0.0" y="522" width="768" height="44"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="1bG-aS-FTW" id="u8v-qb-zq2">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="43.5"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="768" height="44"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <button opaque="NO" tag="3" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="kvi-MS-wS3" userLabel="action3">
@@ -6304,7 +6354,7 @@ redantsupport@united-us.net</string>
                                         <rect key="frame" x="0.0" y="566" width="768" height="140"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="LoG-P8-L3l" id="uQB-ra-pgG">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="139.5"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="768" height="140"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Ara-TK-zIp">
@@ -7246,7 +7296,7 @@ redantsupport@united-us.net</string>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="HwF-54-hzr">
-                                                    <rect key="frame" x="48" y="0.0" width="632" height="43.5"/>
+                                                    <rect key="frame" x="48" y="0.0" width="632" height="44"/>
                                                     <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="16"/>
                                                     <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
@@ -7612,6 +7662,7 @@ redantsupport@united-us.net</string>
         <image name="npd_logo" width="69" height="50"/>
         <image name="order" width="72" height="72"/>
         <image name="pick_bg" width="280" height="280"/>
+        <image name="place_order" width="256" height="57"/>
         <image name="profle" width="64" height="64"/>
         <image name="red_ant_logo" width="72" height="72"/>
         <image name="s1.jpg" width="155" height="155"/>

+ 23 - 0
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/place_order.imageset/Contents.json

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

BIN
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/place_order.imageset/PLACE-ORDER(1).png


BIN
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/place_order.imageset/PLACE-ORDER(1)@2x.png


BIN
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/place_order.imageset/PLACE-ORDER(1)@3x.png


+ 23 - 0
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/taptosign_s.imageset/Contents.json

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

BIN
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/taptosign_s.imageset/top.png


BIN
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/taptosign_s.imageset/top@2x.png


BIN
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/taptosign_s.imageset/top@3x.png


+ 2 - 88
RedAnt ERP Mobile/iSales-NPD/config.h

@@ -94,6 +94,7 @@
 
 
 #define  URL_CUSTOMER_INFO  @"http://192.168.0.119:8080/site/isales/getCustomerInfoByContact.htm"
+#define  URL_CUSTOMER_PENDINGORDER  @"http://192.168.0.119:8080/site/isales/hasPendingOrderByContact.htm"
 #define  URL_NEW_CUSTOMER  @"http://192.168.0.119:8080/site/isales/getAddCustomer.htm"
 #define  URL_EDIT_CUSTOMER  @"http://192.168.0.119:8080/site/isales/getUpdateCustomerInfoByContact.htm"
 #define  URL_CUSTOMER_SAVE  @"http://192.168.0.119:8080/site/isales/saveCustomer.htm"
@@ -111,93 +112,6 @@
 
 
 
-
-//
-//
-//
-////------------------- test server-----------------------
-//#define  URL_UPDATE_AUTH  @"http://113.28.30.235/site/isales/login.htm"
-//#define  URL_LOGOUT  @"http://113.28.30.235/site/isales/loginOut.htm"
-//#define  URL_RETRIEVE_PASS  @"http://113.28.30.235/site/isales/forgotPassword.htm"
-//
-//#define  URL_REQUEST_CATMENU  @"http://113.28.30.235/site/isales/menu.htm"
-//#define  URL_LOAD_HOME  @"http://113.28.30.235/site/isales/homePage.htm"
-//#define  URL_CATEGORY @"http://113.28.30.235/site/isales/distinctCategory.htm"
-//#define  URL_SEARCH  @"http://113.28.30.235/site/isales/search.htm"
-//#define  URL_ITEM_SEARCH  @"http://113.28.30.235/site/isales/itemSearch.htm"
-//#define  URL_CATEGORY_LOADMORE  @"http://113.28.30.235/site/isales/categoryMore.htm"
-//
-//
-//
-//#define  URL_ORDER_LIST  @"http://113.28.30.235/site/isales/orderList.htm"
-//#define  URL_ORDER_DETAIL  @"http://113.28.30.235/site/isales/orderDetail.htm"
-//#define URL_COMMIT_ORDER @"http://113.28.30.235/site/isales/createOrder.htm"
-//#define URL_SAVE_ORDER @"http://113.28.30.235/site/isales/saveOrder.htm"
-//#define URL_UPDATE_ORDERCUSTOMER @"http://113.28.30.235/site/isales/updateOrderCustomerInfo.htm"
-//#define  URL_NEW_ORDER  @"http://113.28.30.235/site/isales/createNewOrder.htm"
-//#define  URL_OPEN_ORDER  @"http://113.28.30.235/site/isales/openOrder.htm"
-//#define  URL_RELEASE_ORDER  @"http://113.28.30.235/site/isales/closeOrder.htm"
-//#define  URL_DELETE_ORDER  @"http://113.28.30.235/site/isales/deleteOrder.htm"
-//#define  URL_CANCEL_ORDER  @"http://113.28.30.235/site/isales/cancelOrder.htm"
-//
-//
-//#define  URL_CART_SET_PRICE  @"http://113.28.30.235/site/isales/setPrice.htm"
-//#define  URL_CART_INCRESEMENT  @"http://113.28.30.235/site/isales/increment.htm"
-//#define  URL_CART  @"http://113.28.30.235/site/isales/cartDtail.htm"
-//#define  URL_CARTDELIVERY  @"http://113.28.30.235/site/isales/cartDelivery.htm"
-//#define  URL_ADD_TO_CART  @"http://113.28.30.235/site/isales/addToCart.htm"
-//#define  URL_CART_REMOVE  @"http://113.28.30.235/site/isales/deleteToCart.htm"
-//#define  URL_CART_CHECK  @"http://113.28.30.235/site/isales/checkCartItem.htm"
-//
-//#define  URL_CART2WISH  @"http://113.28.30.235/site/isales/cartRemoveToWishlist.htm"
-//#define  URL_WISH2CART  @"http://113.28.30.235/site/isales/wishlistRemoveToCart.htm"
-//
-//#define  URL_ITEM_DETAIL  @"http://113.28.30.235/site/isales/modelDetail.htm"
-//
-//#define  URL_ADD_TO_WATCHLIST  @"http://113.28.30.235/site/isales/addToWishList.htm"
-//#define  URL_WATCHLIST  @"http://113.28.30.235/site/isales/wishList.htm"
-//#define  URL_WATCHLIST_REMOVE  @"http://113.28.30.235/site/isales/deleteToWishList.htm"
-//
-//
-//
-//#define  URL_ADD_TO_PORTFOLIO @"http://113.28.30.235/site/isales/addToPortfolio.htm"
-//#define  URL_PORTFOLIO_REMOVE  @"http://113.28.30.235/site/isales/deleteToPortfolio.htm"
-//#define  URL_PORTFOLIO  @"http://113.28.30.235/site/isales/portfolios.htm"
-//#define  URL_PORTFOLIO_SET_PRICE  @"http://113.28.30.235/site/isales/setTearSheetPrice.htm"
-//#define  URL_DM_PARAMS @"http://113.28.30.235/site/isales/selectTearSheetParam.htm"
-//#define  URL_REQUEST_DM @"http://113.28.30.235/site/isales/getTearSheetPdf.htm"
-//#define  URL_SAVE_DM_DIRECT @"http://113.28.30.235/site/isales/getTearSheetPdf.htm"
-//#define  URL_SAVE_DM @"http://113.28.30.235/site/isales/saveTearSheetPdf.htm"
-//#define  URL_DM_LIST @"http://113.28.30.235/site/isales/tearSheetPdfList.htm"
-//
-//
-//#define  URL_CONTACT_LIST  @"http://113.28.30.235/site/isales/getAllContact.htm"
-//#define  URL_SHIPTO_LIST  @"http://113.28.30.235/site/isales/getShipToContact.htm"
-//
-//#define  URL_ADDRESS_EDOTOR  @"http://113.28.30.235/site/isales/getAddAddress.htm"
-//#define  URL_ADDRESS_SAVE  @"http://113.28.30.235/site/isales/saveAddress.htm"
-//
-//
-//#define  URL_CREDITCARD_EDOTOR  @"http://113.28.30.235/site/isales/creditCard.htm"
-//#define  URL_CREDITCARD_SAVE  @"http://113.28.30.235/site/isales/saveAddress.htm"
-//
-//
-//
-//#define  URL_CUSTOMER_INFO  @"http://113.28.30.235/site/isales/getCustomerInfoByContact.htm"
-//#define  URL_NEW_CUSTOMER  @"http://113.28.30.235/site/isales/getAddCustomer.htm"
-//#define  URL_CUSTOMER_SAVE  @"http://113.28.30.235/site/isales/saveCustomer.htm"
-//#define  URL_UPDATE_CUSTOMER_BCARD  @"http://113.28.30.235/site/isales/updateCustomerBusiCard.htm"
-//
-//
-//
-//
-//
-//
-//#define  URL_ERR_LOG  @"http://113.28.30.235/site/isales/er_log.htm"
-//
-//#define  URL_UPLOAD_IMG  @"http://113.28.30.235/site/isales/uploadImg.htm"
-
-
 //
 ////------------------- NPD server-----------------------
 //#define  URL_UPDATE_AUTH  @"https://www.newpacificdirect.com/isales/login.htm"
@@ -287,6 +201,6 @@
 //#define  URL_CART_GENERAL_NOTES  @"https://www.newpacificdirect.com/isales/updateGeneralNote.htm"
 //#define  URL_CART_ITEM_NOTES  @"https://www.newpacificdirect.com/isales/setItemNotes.htm"
 //#define  URL_EDIT_CUSTOMER  @"https://www.newpacificdirect.com/isales/getUpdateCustomerInfoByContact.htm"
-//
+//#define  URL_CUSTOMER_PENDINGORDER  @"https://www.newpacificdirect.com/isales/hasPendingOrderByContact.htm"
 
 #endif

+ 1 - 1
RedAnt ERP Mobile/iSales-NPD/iSales-NPD-Info.plist

@@ -21,7 +21,7 @@
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>160307</string>
+	<string>160317</string>
 	<key>LSRequiresIPhoneOS</key>
 	<true/>
 	<key>NSAppTransportSecurity</key>