Ray Zhang 10 anos atrás
pai
commit
cdb1627efe
50 arquivos alterados com 4740 adições e 1886 exclusões
  1. BIN
      RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/Ray.xcuserdatad/UserInterfaceState.xcuserstate
  2. 1543 7
      RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/Ray.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
  3. 1 0
      RedAnt ERP Mobile/common/CommonEditor/CommonEditorCellAction.h
  4. 1 0
      RedAnt ERP Mobile/common/CommonEditor/CommonEditorCellEdit.h
  5. 1 0
      RedAnt ERP Mobile/common/CommonEditor/CommonEditorCellEnum.h
  6. 1 0
      RedAnt ERP Mobile/common/CommonEditor/CommonEditorCellSignature.h
  7. 1 0
      RedAnt ERP Mobile/common/CommonEditor/CommonEditorCellSwitch.h
  8. 1 0
      RedAnt ERP Mobile/common/CommonEditor/CommonEditorCellTextView.h
  9. 10 2
      RedAnt ERP Mobile/common/CommonEditor/CommonEditorViewController.h
  10. 776 115
      RedAnt ERP Mobile/common/CommonEditor/CommonEditorViewController.m
  11. 4 2
      RedAnt ERP Mobile/common/Functions/MainViewController.m
  12. 8 0
      RedAnt ERP Mobile/common/Functions/PDF+Web/PDFViewController.m
  13. 84 79
      RedAnt ERP Mobile/common/Functions/address/AddressEditorViewController.m
  14. 2 2
      RedAnt ERP Mobile/common/Functions/camscan/ScannerViewController.m
  15. 8 0
      RedAnt ERP Mobile/common/Functions/cart/CartViewController.m
  16. 1 0
      RedAnt ERP Mobile/common/Functions/category/CategoryViewController.h
  17. 185 130
      RedAnt ERP Mobile/common/Functions/category/CategoryViewController.m
  18. 158 193
      RedAnt ERP Mobile/common/Functions/contact/ContactAdvanceSearchViewController.m
  19. 154 149
      RedAnt ERP Mobile/common/Functions/contact/CustomerEditViewController.m
  20. 76 74
      RedAnt ERP Mobile/common/Functions/creditcard/CreditCardEditorViewController.m
  21. 1 9
      RedAnt ERP Mobile/common/Functions/modelDetail/DetailHeaderCell.m
  22. 164 29
      RedAnt ERP Mobile/common/Functions/modelDetail/DetailViewController.m
  23. 307 251
      RedAnt ERP Mobile/common/Functions/order/CreateOrderViewController.m
  24. 1 1
      RedAnt ERP Mobile/common/Functions/order/OrderDetailViewController.h
  25. 16 9
      RedAnt ERP Mobile/common/Functions/order/OrderDetailViewController.m
  26. 2 1
      RedAnt ERP Mobile/common/Functions/order/OrderListViewController.m
  27. 13 1
      RedAnt ERP Mobile/common/Functions/portfolio/PortfolioEditQTYViewController.h
  28. 205 4
      RedAnt ERP Mobile/common/Functions/portfolio/PortfolioEditQTYViewController.m
  29. 116 95
      RedAnt ERP Mobile/common/Functions/portfolio/PortfolioViewController.m
  30. 247 236
      RedAnt ERP Mobile/common/Functions/portfolio/TearSheetParamViewController.m
  31. 0 120
      RedAnt ERP Mobile/common/Functions/search+itemsearch/ItemSearchFilterViewController.m
  32. 1 1
      RedAnt ERP Mobile/common/Functions/search+itemsearch/ItemSearchViewController.h
  33. 72 7
      RedAnt ERP Mobile/common/Functions/search+itemsearch/ItemSearchViewController.m
  34. 1 1
      RedAnt ERP Mobile/common/Functions/search+itemsearch/SearchViewController.h
  35. 73 16
      RedAnt ERP Mobile/common/Functions/search+itemsearch/SearchViewController.m
  36. 1 1
      RedAnt ERP Mobile/common/Functions/sidemenu/ScannerSettingViewController.m
  37. 1 1
      RedAnt ERP Mobile/common/Functions/watchlist/WatchListViewController.m
  38. 3 0
      RedAnt ERP Mobile/common/RAUtils.h
  39. 36 4
      RedAnt ERP Mobile/common/RAUtils.m
  40. 2 2
      RedAnt ERP Mobile/common/data_provider/iSalesNetwork.h
  41. 45 3
      RedAnt ERP Mobile/common/data_provider/iSalesNetwork.m
  42. 2 1
      RedAnt ERP Mobile/iSales-NPD/AppDelegate.h
  43. 39 1
      RedAnt ERP Mobile/iSales-NPD/AppDelegate.m
  44. 268 336
      RedAnt ERP Mobile/iSales-NPD/Base.lproj/Main.storyboard
  45. 23 0
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/mark_attention_24.imageset/Contents.json
  46. BIN
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/mark_attention_24.imageset/appicon-1.png
  47. BIN
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/mark_attention_24.imageset/appicon-2.png
  48. BIN
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/mark_attention_24.imageset/appicon.png
  49. 84 1
      RedAnt ERP Mobile/iSales-NPD/config.h
  50. 2 2
      RedAnt ERP Mobile/iSales-NPD/iSales-NPD-Info.plist

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


+ 1543 - 7
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/Ray.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -10,11 +10,11 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "common/Functions/search+itemsearch/SearchViewController.m"
-            timestampString = "480587177.973904"
+            timestampString = "482484894.77808"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1290"
-            endingLineNumber = "1290"
+            startingLineNumber = "1347"
+            endingLineNumber = "1347"
             landmarkName = "-collectionView:cellForItemAtIndexPath:"
             landmarkType = "5">
          </BreakpointContent>
@@ -22,15 +22,15 @@
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
-            shouldBeEnabled = "Yes"
+            shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "common/Functions/search+itemsearch/SearchViewController.m"
-            timestampString = "480587231.067636"
+            timestampString = "482484894.77808"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1307"
-            endingLineNumber = "1307"
+            startingLineNumber = "1364"
+            endingLineNumber = "1364"
             landmarkName = "-collectionView:cellForItemAtIndexPath:"
             landmarkType = "5">
          </BreakpointContent>
@@ -51,5 +51,1541 @@
             landmarkType = "5">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/modelDetail/DetailViewController.m"
+            timestampString = "482315999.935273"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1428"
+            endingLineNumber = "1428"
+            landmarkName = "-tableView:cellForRowAtIndexPath:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/modelDetail/DetailViewController.m"
+            timestampString = "482315999.935273"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1408"
+            endingLineNumber = "1408"
+            landmarkName = "-tableView:cellForRowAtIndexPath:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/modelDetail/DetailTopicCell.m"
+            timestampString = "480823690.97556"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "56"
+            endingLineNumber = "56"
+            landmarkName = "-collectionView:cellForItemAtIndexPath:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/modelDetail/DetailTopicCell.m"
+            timestampString = "480823716.100357"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "45"
+            endingLineNumber = "45"
+            landmarkName = "-collectionView:numberOfItemsInSection:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/modelDetail/DetailViewController.m"
+            timestampString = "480830251.974043"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "131"
+            endingLineNumber = "131"
+            landmarkName = "-reload"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/CommonEditor/CommonEditorViewController.m"
+            timestampString = "481876828.840831"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "381"
+            endingLineNumber = "381"
+            landmarkName = "-check_cancommit:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/CommonEditor/CommonEditorViewController.m"
+            timestampString = "482056235.178827"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "4772"
+            endingLineNumber = "4772"
+            landmarkName = "-EnumValueChanged:indexPath:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/CommonEditor/CommonEditorViewController.m"
+            timestampString = "482056235.178827"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "4774"
+            endingLineNumber = "4774"
+            landmarkName = "-EnumValueChanged:indexPath:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/CommonEditor/CommonEditorViewController.m"
+            timestampString = "482056235.178827"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "4586"
+            endingLineNumber = "4586"
+            landmarkName = "-MPValueChanged:indexPath:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/CommonEditor/CommonEditorViewController.m"
+            timestampString = "482056235.178827"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "3479"
+            endingLineNumber = "3479"
+            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 = "481876828.840831"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "384"
+            endingLineNumber = "384"
+            landmarkName = "-check_cancommit:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/CommonEditor/CommonEditorViewController.m"
+            timestampString = "481876828.840831"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "388"
+            endingLineNumber = "388"
+            landmarkName = "-check_cancommit:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/CommonEditor/CommonEditorViewController.m"
+            timestampString = "481876828.840831"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "390"
+            endingLineNumber = "390"
+            landmarkName = "-check_cancommit:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/CommonEditor/CommonEditorViewController.m"
+            timestampString = "481876828.840831"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "403"
+            endingLineNumber = "403"
+            landmarkName = "-check_cancommit:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/CommonEditor/CommonEditorViewController.m"
+            timestampString = "481876828.840831"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "699"
+            endingLineNumber = "699"
+            landmarkName = "-subitem_param:addto:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/CommonEditor/CommonEditorViewController.m"
+            timestampString = "481876828.840831"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "698"
+            endingLineNumber = "698"
+            landmarkName = "-subitem_param:addto:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/CommonEditor/CommonEditorViewController.m"
+            timestampString = "481876828.840831"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "404"
+            endingLineNumber = "404"
+            landmarkName = "-check_cancommit:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/CommonEditor/CommonEditorViewController.m"
+            timestampString = "481876828.840831"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "407"
+            endingLineNumber = "407"
+            landmarkName = "-check_cancommit:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/CommonEditor/CommonEditorViewController.m"
+            timestampString = "481876828.840831"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "216"
+            endingLineNumber = "216"
+            landmarkName = "-check_cancommit:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/CommonEditor/CommonEditorViewController.m"
+            timestampString = "481876828.840831"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "218"
+            endingLineNumber = "218"
+            landmarkName = "-check_cancommit:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/CommonEditor/CommonEditorViewController.m"
+            timestampString = "481876828.840831"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "401"
+            endingLineNumber = "401"
+            landmarkName = "-check_cancommit:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/CommonEditor/CommonEditorViewController.m"
+            timestampString = "481876828.840831"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "402"
+            endingLineNumber = "402"
+            landmarkName = "-check_cancommit:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/CommonEditor/CommonEditorViewController.m"
+            timestampString = "481876828.840831"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "720"
+            endingLineNumber = "720"
+            landmarkName = "-subitem_param:addto:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/CommonEditor/CommonEditorViewController.m"
+            timestampString = "481876828.840831"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "731"
+            endingLineNumber = "731"
+            landmarkName = "-subitem_param:addto:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/CommonEditor/CommonEditorViewController.m"
+            timestampString = "481876828.840831"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "732"
+            endingLineNumber = "732"
+            landmarkName = "-subitem_param:addto:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/CommonEditor/CommonEditorViewController.m"
+            timestampString = "481876828.840831"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "415"
+            endingLineNumber = "415"
+            landmarkName = "-check_cancommit:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/CommonEditor/CommonEditorViewController.m"
+            timestampString = "481876828.840831"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "396"
+            endingLineNumber = "396"
+            landmarkName = "-check_cancommit:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/CommonEditor/CommonEditorViewController.m"
+            timestampString = "482056235.178827"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1926"
+            endingLineNumber = "1926"
+            landmarkName = "-get_indexpath:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/CommonEditor/CommonEditorViewController.m"
+            timestampString = "482056235.178827"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1936"
+            endingLineNumber = "1936"
+            landmarkName = "-get_indexpath:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/portfolio/PortfolioEditQTYViewController.m"
+            timestampString = "481709583.36924"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "243"
+            endingLineNumber = "243"
+            landmarkName = "-textFieldDidEndEditing:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/order/CreateOrderViewController.m"
+            timestampString = "481775329.14742"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "367"
+            endingLineNumber = "367"
+            landmarkName = "-onSaveClick:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/MainViewController.m"
+            timestampString = "481713750.583098"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "544"
+            endingLineNumber = "544"
+            landmarkName = "-Loginout:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/MainViewController.m"
+            timestampString = "481713791.558019"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "559"
+            endingLineNumber = "559"
+            landmarkName = "-Loginout:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/MainViewController.m"
+            timestampString = "481713793.003998"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "560"
+            endingLineNumber = "560"
+            landmarkName = "-Loginout:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "iSales-NPD/AppDelegate.m"
+            timestampString = "481772776.061553"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "481"
+            endingLineNumber = "481"
+            landmarkName = "-Logout"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "iSales-NPD/AppDelegate.m"
+            timestampString = "481714062.037371"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "181"
+            endingLineNumber = "181"
+            landmarkName = "-SetMode:"
+            landmarkType = "5">
+            <Locations>
+               <Location
+                  shouldBeEnabled = "No"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "-[AppDelegate SetMode:]"
+                  moduleName = "NPD Mobile"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///ios_workspace/RedAnt%20ERP%20Mobile/iSales-NPD/AppDelegate.m"
+                  timestampString = "481772962.733128"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "181"
+                  endingLineNumber = "181"
+                  offsetFromSymbolStart = "66">
+               </Location>
+               <Location
+                  shouldBeEnabled = "No"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "__23-[AppDelegate SetMode:]_block_invoke"
+                  moduleName = "NPD Mobile"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///ios_workspace/RedAnt%20ERP%20Mobile/iSales-NPD/AppDelegate.m"
+                  timestampString = "481772962.73338"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "181"
+                  endingLineNumber = "181"
+                  offsetFromSymbolStart = "24">
+               </Location>
+            </Locations>
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "iSales-NPD/AppDelegate.m"
+            timestampString = "481714084.584624"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "182"
+            endingLineNumber = "182"
+            landmarkName = "-SetMode:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/MainViewController.m"
+            timestampString = "481772471.604782"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "627"
+            endingLineNumber = "627"
+            landmarkName = "-OnLoginClick:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/MainViewController.m"
+            timestampString = "481772473.278822"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "626"
+            endingLineNumber = "626"
+            landmarkName = "-OnLoginClick:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/MainViewController.m"
+            timestampString = "481772685.004563"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "225"
+            endingLineNumber = "225"
+            landmarkName = "-checklogin:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/MainViewController.m"
+            timestampString = "481772687.884333"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "862"
+            endingLineNumber = "862"
+            landmarkName = "-LoginViewControllerDidLogin:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/order/CreateOrderViewController.m"
+            timestampString = "481775329.14742"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "342"
+            endingLineNumber = "342"
+            landmarkName = "-onSaveClick:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/order/CreateOrderViewController.m"
+            timestampString = "481775390.963688"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "174"
+            endingLineNumber = "174"
+            landmarkName = "-onCloseClick:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/order/OrderDetailViewController.m"
+            timestampString = "482379520.873841"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "754"
+            endingLineNumber = "754"
+            landmarkName = "-loaddata"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/order/CreateOrderViewController.m"
+            timestampString = "482399284.037429"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "722"
+            endingLineNumber = "722"
+            landmarkName = "-alertView:clickedButtonAtIndex:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "iSales-NPD/AppDelegate.m"
+            timestampString = "482399284.037429"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1083"
+            endingLineNumber = "1083"
+            landmarkName = "-printPdf:company:send_to:soid:content:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/PDF+Web/PDFViewController.m"
+            timestampString = "481888037.969012"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "244"
+            endingLineNumber = "244"
+            landmarkName = "-viewWillAppear:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/CommonEditor/CommonEditorViewController.m"
+            timestampString = "482055861.952573"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1609"
+            endingLineNumber = "1609"
+            landmarkName = "-setValue:value:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/CommonEditor/CommonEditorViewController.m"
+            timestampString = "482056235.178827"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1633"
+            endingLineNumber = "1633"
+            landmarkName = "-setValue:value:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/CommonEditor/CommonEditorViewController.m"
+            timestampString = "482056235.178827"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1640"
+            endingLineNumber = "1640"
+            landmarkName = "-setValue:value:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/CommonEditor/CommonEditorViewController.m"
+            timestampString = "482056235.178827"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1639"
+            endingLineNumber = "1639"
+            landmarkName = "-setValue:value:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/CommonEditor/CommonEditorViewController.m"
+            timestampString = "482056109.566391"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1618"
+            endingLineNumber = "1618"
+            landmarkName = "-setValue:value:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/CommonEditor/CommonEditorViewController.m"
+            timestampString = "482056149.695622"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1615"
+            endingLineNumber = "1615"
+            landmarkName = "-setValue:value:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/CommonEditor/CommonEditorViewController.m"
+            timestampString = "482056208.955931"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1614"
+            endingLineNumber = "1614"
+            landmarkName = "-setValue:value:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/CommonEditor/CommonEditorViewController.m"
+            timestampString = "482057869.243009"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "4679"
+            endingLineNumber = "4679"
+            landmarkName = "-setEnumValue:indexPath:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/CommonEditor/CommonEditorViewController.m"
+            timestampString = "482058016.130945"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1894"
+            endingLineNumber = "1894"
+            landmarkName = "-textfieldSetValue:value:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/CommonEditor/CommonEditorViewController.m"
+            timestampString = "482058186.84414"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "4450"
+            endingLineNumber = "4450"
+            landmarkName = "-tableView:willSelectRowAtIndexPath:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/CommonEditor/CommonEditorViewController.m"
+            timestampString = "482058204.876744"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "127"
+            endingLineNumber = "127"
+            landmarkName = "-viewDidLoad"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/CommonEditor/CommonEditorViewController.m"
+            timestampString = "482058209.786913"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "638"
+            endingLineNumber = "638"
+            landmarkName = "-refresh:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/CommonEditor/CommonEditorViewController.m"
+            timestampString = "482058215.781073"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1755"
+            endingLineNumber = "1755"
+            landmarkName = "-textfieldSetValue:value:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/CommonEditor/CommonEditorViewController.m"
+            timestampString = "482058220.235147"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1874"
+            endingLineNumber = "1874"
+            landmarkName = "-textfieldSetValue:value:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/CommonEditor/CommonEditorViewController.m"
+            timestampString = "482058250.77618"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1884"
+            endingLineNumber = "1884"
+            landmarkName = "-textfieldSetValue:value:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/contact/ContactListViewController.m"
+            timestampString = "482119259.818476"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "576"
+            endingLineNumber = "576"
+            landmarkName = "-tableView:numberOfRowsInSection:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/contact/ContactListViewController.m"
+            timestampString = "482119262.514341"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "577"
+            endingLineNumber = "577"
+            landmarkName = "-tableView:numberOfRowsInSection:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/contact/ContactListViewController.m"
+            timestampString = "482119317.178088"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "571"
+            endingLineNumber = "571"
+            landmarkName = "-numberOfSectionsInTableView:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/contact/ContactListViewController.m"
+            timestampString = "482119324.628381"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "587"
+            endingLineNumber = "587"
+            landmarkName = "-tableView:cellForRowAtIndexPath:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/contact/ContactListViewController.m"
+            timestampString = "482119605.898565"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "579"
+            endingLineNumber = "579"
+            landmarkName = "-tableView:numberOfRowsInSection:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/contact/ContactListViewController.m"
+            timestampString = "482120320.790643"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "345"
+            endingLineNumber = "345"
+            landmarkName = "-loadmore"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/contact/ContactListViewController.m"
+            timestampString = "482120369.361871"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "235"
+            endingLineNumber = "235"
+            landmarkName = "-loadpage"
+            landmarkType = "5">
+            <Locations>
+               <Location
+                  shouldBeEnabled = "No"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "-[ContactListViewController loadpage]"
+                  moduleName = "NPD Mobile"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///ios_workspace/RedAnt%20ERP%20Mobile/common/Functions/contact/ContactListViewController.m"
+                  timestampString = "482120369.364405"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "235"
+                  endingLineNumber = "235"
+                  offsetFromSymbolStart = "35">
+               </Location>
+               <Location
+                  shouldBeEnabled = "No"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "__37-[ContactListViewController loadpage]_block_invoke"
+                  moduleName = "NPD Mobile"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///ios_workspace/RedAnt%20ERP%20Mobile/common/Functions/contact/ContactListViewController.m"
+                  timestampString = "482120369.364561"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "235"
+                  endingLineNumber = "235"
+                  offsetFromSymbolStart = "24">
+               </Location>
+            </Locations>
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/contact/ContactListViewController.m"
+            timestampString = "482120373.84799"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "237"
+            endingLineNumber = "237"
+            landmarkName = "-loadpage"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/contact/ContactListViewController.m"
+            timestampString = "482120375.356272"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "236"
+            endingLineNumber = "236"
+            landmarkName = "-loadpage"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/contact/ContactListViewController.m"
+            timestampString = "482120377.401596"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "239"
+            endingLineNumber = "239"
+            landmarkName = "-loadpage"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/contact/ContactListViewController.m"
+            timestampString = "482120401.568703"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "269"
+            endingLineNumber = "269"
+            landmarkName = "-loadpage"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/search+itemsearch/SearchViewController.m"
+            timestampString = "482219503.691766"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "270"
+            endingLineNumber = "270"
+            landmarkName = "-onSelectAllClick:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/search+itemsearch/SearchViewController.m"
+            timestampString = "482219601.720018"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "311"
+            endingLineNumber = "311"
+            landmarkName = "-onSelectAllClick:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/search+itemsearch/SearchViewController.m"
+            timestampString = "482219601.720018"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "272"
+            endingLineNumber = "272"
+            landmarkName = "-onSelectAllClick:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/portfolio/PortfolioViewController.m"
+            timestampString = "482221713.72521"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "749"
+            endingLineNumber = "749"
+            landmarkName = "-tableView:cellForRowAtIndexPath:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/modelDetail/DetailViewController.m"
+            timestampString = "482315999.935273"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1555"
+            endingLineNumber = "1555"
+            landmarkName = "-RefreshSction:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/modelDetail/DetailViewController.m"
+            timestampString = "482315999.935273"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1578"
+            endingLineNumber = "1578"
+            landmarkName = "-RefreshSction:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/order/OrderDetailViewController.m"
+            timestampString = "482379520.873841"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "343"
+            endingLineNumber = "343"
+            landmarkName = "-onDownloadOrderClick:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/order/OrderDetailViewController.m"
+            timestampString = "482382782.594137"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "313"
+            endingLineNumber = "313"
+            landmarkName = "-onDownloadOrderClick:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/PDF+Web/PDFViewController.m"
+            timestampString = "482395202.647711"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "313"
+            endingLineNumber = "313"
+            landmarkName = "-onEmailClick:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/PDF+Web/PDFViewController.m"
+            timestampString = "482395455.975306"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "351"
+            endingLineNumber = "351"
+            landmarkName = "-onEmailClick:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/order/CreateOrderViewController.m"
+            timestampString = "482399284.037429"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "915"
+            endingLineNumber = "915"
+            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 = "482399284.037429"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "902"
+            endingLineNumber = "902"
+            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 = "482399583.640697"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "941"
+            endingLineNumber = "941"
+            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 = "482399590.110536"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "954"
+            endingLineNumber = "954"
+            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 = "482399594.582797"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "947"
+            endingLineNumber = "947"
+            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 = "482399601.661108"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "948"
+            endingLineNumber = "948"
+            landmarkName = "-alertView:clickedButtonAtIndex:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "iSales-NPD/AppDelegate.m"
+            timestampString = "482399610.711586"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1084"
+            endingLineNumber = "1084"
+            landmarkName = "-printPdf:company:send_to:soid:content:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "iSales-NPD/AppDelegate.m"
+            timestampString = "482399650.003057"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1020"
+            endingLineNumber = "1020"
+            landmarkName = "-printPdf:company:send_to:soid:content:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/search+itemsearch/ItemSearchViewController.m"
+            timestampString = "482487074.677591"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "389"
+            endingLineNumber = "389"
+            landmarkName = "-loadMore"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
 </Bucket>

+ 1 - 0
RedAnt ERP Mobile/common/CommonEditor/CommonEditorCellAction.h

@@ -12,3 +12,4 @@
 @property (strong, nonatomic) IBOutlet UILabel *labelAction;
 @property (strong,nonatomic) NSString* action_code;
 @end
+

+ 1 - 0
RedAnt ERP Mobile/common/CommonEditor/CommonEditorCellEdit.h

@@ -11,5 +11,6 @@
 @interface CommonEditorCellEdit : UITableViewCell
 @property (strong, nonatomic) IBOutlet UILabel *labelTitle;
 @property (strong, nonatomic) IBOutlet UITextField *textfield;
+@property (strong, nonatomic) IBOutlet UILabel *starMark;
 
 @end

+ 1 - 0
RedAnt ERP Mobile/common/CommonEditor/CommonEditorCellEnum.h

@@ -11,5 +11,6 @@
 @interface CommonEditorCellEnum : UITableViewCell
 @property (strong, nonatomic) IBOutlet UILabel *labelTitle;
 @property (strong, nonatomic) IBOutlet UILabel *labelValue;
+@property (strong, nonatomic) IBOutlet UILabel *starMark;
 
 @end

+ 1 - 0
RedAnt ERP Mobile/common/CommonEditor/CommonEditorCellSignature.h

@@ -12,4 +12,5 @@
 @property (strong, nonatomic) IBOutlet UILabel *labelTitle;
 @property (strong, nonatomic) IBOutlet UIImageView *imageviewSignature;
 
+@property (strong, nonatomic) IBOutlet UILabel *starMark;
 @end

+ 1 - 0
RedAnt ERP Mobile/common/CommonEditor/CommonEditorCellSwitch.h

@@ -12,5 +12,6 @@
 @property (strong, nonatomic) IBOutlet UILabel *labelTitle;
 @property (strong, nonatomic) IBOutlet UISwitch *switchCtrl;
 
+@property (strong, nonatomic) IBOutlet UILabel *starMark;
 
 @end

+ 1 - 0
RedAnt ERP Mobile/common/CommonEditor/CommonEditorCellTextView.h

@@ -11,5 +11,6 @@
 @interface CommonEditorCellTextView : UITableViewCell
 @property (strong, nonatomic) IBOutlet UILabel *label_name;
 @property (strong, nonatomic) IBOutlet UITextView *textview;
+@property (strong, nonatomic) IBOutlet UILabel *starMark;
 
 @end

+ 10 - 2
RedAnt ERP Mobile/common/CommonEditor/CommonEditorViewController.h

@@ -11,6 +11,12 @@
 #import "EnumSelectViewController.h"
 #import "MonthPickerViewController.h"
 
+@interface subitem_data : NSObject
+@property (strong, nonatomic) NSMutableDictionary *params;
+@property (strong,nonatomic) NSMutableArray * missingfields;
+@end
+
+
 @class CommonEditorViewController;
 @protocol CommonEditorViewControllerDelegate <NSObject>
 
@@ -44,14 +50,16 @@
 @property int keyboard_h;
 @property (strong,nonatomic) NSMutableDictionary* requried;
 
+@property (strong,nonatomic) NSIndexPath* first_miss_pos;
+
 //@property (strong,nonatomic) NSMutableDictionary* data_init;
 
 -(void) prepareReturn:(NSMutableDictionary*) value;
 -(NSMutableArray*) translate_json: (NSDictionary*) injson changed:(NSDictionary*) changed_value;
 -(NSMutableDictionary*)create_cusromer_info_from_table;
 @property (strong,nonatomic) NSIndexPath* from;
--(NSMutableDictionary*) subitem_param:(NSDictionary*) itemjson addto:(NSMutableDictionary*) upparam;
-
+-(subitem_data*) subitem_param:(NSDictionary*) itemjson addto:(NSMutableDictionary*) upparam;
+-(NSMutableDictionary*) check_cancommit:(bool) alert;
 
 -(NSString*) getValue:(NSString*)name;
 

Diferenças do arquivo suprimidas por serem muito extensas
+ 776 - 115
RedAnt ERP Mobile/common/CommonEditor/CommonEditorViewController.m


+ 4 - 2
RedAnt ERP Mobile/common/Functions/MainViewController.m

@@ -587,7 +587,7 @@
                 }
                 else
                 {
-                    [RAUtils message_alert:[return_json valueForKey:@"err_msg"] title:@"Add To Cart" controller:self] ;
+                    [RAUtils message_alert:[return_json valueForKey:@"err_msg"] title:@"Sign Out" controller:self] ;
                 }
                 
                 
@@ -1021,6 +1021,8 @@
     self.categoryViewController.cagegoryLabel.text =self.categoryViewController.categoryString;
     //   NSString* sss =[@"Category" stringByAppendingString:[self categoryString:categoryid node:appDelegate.categoryMenu level:0]];
     self.categoryViewController.categoryid = categoryid ;
+    self.categoryViewController.loadall=false;
+//    self.categoryViewController.collectionview
     self.categoryViewController.p_alert = nil;
         self.categoryViewController.p_available = nil;
         self.categoryViewController.p_price = nil;
@@ -2190,7 +2192,7 @@
                     NSString* order_code = [return_json valueForKey:@"orderCode"];
                     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
                     appDelegate.order_code = order_code;
-                    
+                    appDelegate.order_status = [[return_json valueForKey:@"orderStatus"] intValue];
                     
                     self.previous_VC = self.current_VC;
                     [self flipFromViewController:self.current_VC toViewController:self.cartViewController withDirection:UIViewAnimationOptionTransitionCrossDissolve];

+ 8 - 0
RedAnt ERP Mobile/common/Functions/PDF+Web/PDFViewController.m

@@ -161,6 +161,8 @@
         
         dispatch_async(dispatch_get_main_queue(), ^{
             [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
+            
+            [[self navigationController] setNavigationBarHidden:self.hidenavi animated:NO];
             self.navigationItem.title = self.save_name;
             UIRefreshControl *reF = (UIRefreshControl *)[self.view viewWithTag:200];
           //  self.content=nil;
@@ -318,6 +320,12 @@
     
     
     MFMailComposeViewController *mc = [[MFMailComposeViewController alloc] init];
+    
+    if(mc==nil)
+    {
+        //[RAUtils message_alert:@"You must create an email account first."  title:@"Send Email" controller:self];
+        return;
+    }
     mc.mailComposeDelegate = self;
     [mc setSubject:self.mail_subject];
     

+ 84 - 79
RedAnt ERP Mobile/common/Functions/address/AddressEditorViewController.m

@@ -58,88 +58,93 @@
     // add params check here.
     [self.lastedit endEditing:true];
      [self.lasttextview endEditing:true];
-    self.cancommit=true;
-    NSMutableDictionary* upparams=[[NSMutableDictionary alloc] init];
-    //[upparams setValue:[self.params valueForKey:@"cart2Checkbox"] forKey:@"cart2Checkbox"];
-    int section_count=[[self.content_data_download valueForKey:@"section_count"] intValue];
-    for(int i=0;i<section_count;i++)
-    {
-        
-        NSMutableDictionary * sectionjson = [[self.content_data_download objectForKey:[NSString stringWithFormat:@"section_%d",i ]] mutableCopy];
-        int item_count = [[sectionjson valueForKey:@"count"] intValue];
-        for(int j=0;j<item_count;j++)
-        {
-            NSMutableDictionary * itemjson=[[sectionjson objectForKey:[NSString stringWithFormat:@"item_%d",j ]] mutableCopy];
-            NSString* key = [itemjson valueForKey:@"name"];
-            if(key==nil || key.length==0)
-                continue;
-            if([[itemjson valueForKey:@"control"] isEqualToString:@"enum"])
-            {
-                NSString* single_select = [itemjson valueForKey:@"single_select"];
-                if([single_select isEqualToString:@"true"])
-                {
-                    NSDictionary* cadejson=[itemjson objectForKey:@"cadedate"];
-                    int count = [[cadejson valueForKey:@"count"] intValue];
-                    bool setvalue = false;
-                    for(int cc=0;cc<count;cc++)
-                    {
-                        NSDictionary* valjson=[cadejson objectForKey:[NSString stringWithFormat:@"val_%d",cc]];
-                        if([[valjson valueForKey:@"check"]intValue]==1)
-                        {
-                            [upparams setValue:[valjson valueForKey:@"value_id"] forKey:[itemjson valueForKey:@"name"]];
-                            setvalue=true;
-                            break;
-                        }
-                    }
-                    if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] && setvalue==false)
-                    {
-                        self.cancommit = false;
-                    }
-                }
-                else
-                {
-                    //not support multi select for now;
-                }
-                /*
-                 upparams setValue:itemjson forKey:<#(NSString *)#>
-                 
-                 */
-            }
-            else
-            {
-                if([itemjson valueForKey:@"value"]!=nil && ![[itemjson valueForKey:@"value"]isEqualToString:@""])
-                    [upparams setValue:[itemjson valueForKey:@"value"] forKey:[itemjson valueForKey:@"name"]];
-                else
-                {
-                    if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] )
-                        self.cancommit = false;
-                }
-            }
-            
-            upparams= [self subitem_param:itemjson addto:upparams ];
-        }
-    }
-    
+//    self.cancommit=true;
+//    NSMutableDictionary* upparams=[[NSMutableDictionary alloc] init];
+//    //[upparams setValue:[self.params valueForKey:@"cart2Checkbox"] forKey:@"cart2Checkbox"];
+//    int section_count=[[self.content_data_download valueForKey:@"section_count"] intValue];
+//    for(int i=0;i<section_count;i++)
+//    {
+//        
+//        NSMutableDictionary * sectionjson = [[self.content_data_download objectForKey:[NSString stringWithFormat:@"section_%d",i ]] mutableCopy];
+//        int item_count = [[sectionjson valueForKey:@"count"] intValue];
+//        for(int j=0;j<item_count;j++)
+//        {
+//            NSMutableDictionary * itemjson=[[sectionjson objectForKey:[NSString stringWithFormat:@"item_%d",j ]] mutableCopy];
+//            NSString* key = [itemjson valueForKey:@"name"];
+//            if(key==nil || key.length==0)
+//                continue;
+//            if([[itemjson valueForKey:@"control"] isEqualToString:@"enum"])
+//            {
+//                NSString* single_select = [itemjson valueForKey:@"single_select"];
+//                if([single_select isEqualToString:@"true"])
+//                {
+//                    NSDictionary* cadejson=[itemjson objectForKey:@"cadedate"];
+//                    int count = [[cadejson valueForKey:@"count"] intValue];
+//                    bool setvalue = false;
+//                    for(int cc=0;cc<count;cc++)
+//                    {
+//                        NSDictionary* valjson=[cadejson objectForKey:[NSString stringWithFormat:@"val_%d",cc]];
+//                        if([[valjson valueForKey:@"check"]intValue]==1)
+//                        {
+//                            [upparams setValue:[valjson valueForKey:@"value_id"] forKey:[itemjson valueForKey:@"name"]];
+//                            setvalue=true;
+//                            break;
+//                        }
+//                    }
+//                    if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] && setvalue==false)
+//                    {
+//                        self.cancommit = false;
+//                    }
+//                }
+//                else
+//                {
+//                    //not support multi select for now;
+//                }
+//                /*
+//                 upparams setValue:itemjson forKey:<#(NSString *)#>
+//                 
+//                 */
+//            }
+//            else
+//            {
+//                if([itemjson valueForKey:@"value"]!=nil && ![[itemjson valueForKey:@"value"]isEqualToString:@""])
+//                    [upparams setValue:[itemjson valueForKey:@"value"] forKey:[itemjson valueForKey:@"name"]];
+//                else
+//                {
+//                    if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] )
+//                        self.cancommit = false;
+//                }
+//            }
+//            
+//            upparams= [self subitem_param:itemjson addto:upparams ];
+//        }
+//    }
+//    
+//    
+//    if(self.cancommit==false)
+//    {
+////        UIAlertView * alert = [[UIAlertView alloc] initWithTitle: @"Some requried field is missing" message:@"Fields with * mark cannot be empty." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
+////        //        UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Error!" message:@"User&Password can not be empty!" delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) , nil];
+////        [alert show];
+//        
+//        
+//        [RAUtils alert_view:@"Fields with * mark cannot be empty." title:@"Some Requried Fields Are Missing."];
+//        
+//        self.content_data_control = [self translate_json:self.content_data_download changed:self.changed_data];
+//        
+//        
+//        //    NSLog(@"CONTENT translate:%@",[iSalesNetwork DataTOjsonString:self.content_data]);
+////        [self.editorTable reloadData ];
+//        
+//        [self.editorTable reloadData];
+//        return;
+//
+//    }
+
     
+    NSMutableDictionary* upparams = [self check_cancommit:true];
     if(self.cancommit==false)
-    {
-//        UIAlertView * alert = [[UIAlertView alloc] initWithTitle: @"Some requried field is missing" message:@"Fields with * mark cannot be empty." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
-//        //        UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Error!" message:@"User&Password can not be empty!" delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) , nil];
-//        [alert show];
-        
-        
-        [RAUtils alert_view:@"Fields with * mark cannot be empty." title:@"Some Requried Fields Are Missing."];
-        
-        self.content_data_control = [self translate_json:self.content_data_download changed:self.changed_data];
-        
-        
-        //    NSLog(@"CONTENT translate:%@",[iSalesNetwork DataTOjsonString:self.content_data]);
-//        [self.editorTable reloadData ];
-        
-        [self.editorTable reloadData];
         return;
-
-    }
     
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
         

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

@@ -581,7 +581,7 @@
                     NSString* order_code = [return_json valueForKey:@"orderCode"];
                     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
                     appDelegate.order_code = order_code;
-                    
+                    appDelegate.order_status = [[return_json valueForKey:@"orderStatus"] intValue];
    
                     
                     [self addtocart];
@@ -845,7 +845,7 @@
             cvc.onCancel = ^(){
                 
                 UIViewController *vc= [RAUtils getViewController:self];
-                [RAUtils message_alert:@"Cannot create order without cursomer infomation." title:@"New Order Error." controller:vc];
+                [RAUtils message_alert:@"Cannot create order without cursomer infomation." title:@"New Order" controller:vc];
                 
             };
             cvc.onReset = ^(){

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

@@ -49,6 +49,12 @@
     
     
     long count = self.content_arr.count;//[[self.content_data valueForKey:@"count"] intValue];
+    
+    if(count==0)
+    {
+        [RAUtils message_alert:@"No item in the cart" title:@"Cart" controller:self] ;
+        return;
+    }
     for(int i=0;i<count;i++)
     {
         NSMutableDictionary * item_json = [self.content_arr[i] mutableCopy];//[[self.content_data objectForKey:[NSString stringWithFormat:@"item_%d",i]] mutableCopy];
@@ -1749,6 +1755,7 @@
                         [item_json setValue:[NSNumber numberWithDouble:discount ] forKey:@"discount"];
                          [item_json setValue:notes forKey:@"note"];
                         self.content_arr[indexPath.row ] = item_json;
+                        tableView.editing = false;
                         [tableView reloadRowsAtIndexPaths:@[indexPath]withRowAnimation:UITableViewRowAnimationMiddle];
                     }
                     else
@@ -1880,6 +1887,7 @@
         vc.onSaveNote=^(NSString* notes){
             [item_json setValue:notes forKey:@"note"];
             self.content_arr[indexPath.row ] = item_json;
+            tableView.editing = false;
                     [tableView reloadRowsAtIndexPaths:@[indexPath]withRowAnimation:UITableViewRowAnimationMiddle];
         };
         

+ 1 - 0
RedAnt ERP Mobile/common/Functions/category/CategoryViewController.h

@@ -31,6 +31,7 @@ typedef void (^add_to_cart_Handler)(void);
 @property BOOL loading;
 @property bool loadall;
 @property long offset;
+
 -(void) showDetailat:(NSString*) item_id category_id:(NSString*) category_id index:(long)index;
 -(void) showCategory;
 -(void) reload;

+ 185 - 130
RedAnt ERP Mobile/common/Functions/category/CategoryViewController.m

@@ -210,10 +210,15 @@
     
     //   int tag =self.selectallBtn.tag;
     
+    if(self.category_data==nil)
+        return;
     
     
     NSMutableDictionary* items =[[self.category_data objectForKey:@"items"] mutableCopy];
     
+    
+    if(items==nil)
+        return;
     int count = [[items valueForKey:@"count"] intValue];
     
     NSString* checked;
@@ -613,7 +618,17 @@
                     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
                     //                    appDelegate.order_code = order_code;
                     [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
-                    [RAUtils message_alert:nil title:@" Multiple items added to Cart" controller:self] ;
+                    NSString * msg = nil;
+                    if(checked.count==1)
+                    {
+                        msg=@"1 item added to Cart";
+                    }
+                    else
+                    {
+                        msg=[NSString stringWithFormat:@"%lu items added to Cart",(unsigned long)checked.count];
+                    }
+                    
+                    [RAUtils message_alert:nil title:msg controller:self] ;
                     
                     [self end_select:2];
                     
@@ -690,9 +705,17 @@
                 AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
                 
                 [((MainViewController*)appDelegate.main_vc) reloadPortfolio:true immediately:false];
+                NSString * msg = nil;
+                if(checked.count==1)
+                {
+                    msg=@"1 item added to Portfolio";
+                }
+                else
+                {
+                    msg=[NSString stringWithFormat:@"%lu items added to Portfolio",(unsigned long)checked.count];
+                }
                 
-                
-                [RAUtils message_alert:nil title:@" Multiple items added to Portfolio" controller:self] ;
+                [RAUtils message_alert:nil title:msg controller:self] ;
                 
                 
                 [self end_select:3 ];
@@ -757,7 +780,20 @@
                 AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
                 
                 [((MainViewController*)appDelegate.main_vc) reloadWish:true immediately:false];
-                [RAUtils message_alert:nil title:@" Multiple items added to \nWish List" controller:self] ;
+                
+                
+                
+                NSString * msg = nil;
+                if(checked.count==1)
+                {
+                    msg=@"1 item added to \nWish List";
+                }
+                else
+                {
+                    msg=[NSString stringWithFormat:@"%lu items added to \nWish List",(unsigned long)checked.count];
+                }
+                
+                [RAUtils message_alert:nil title:msg controller:self] ;
                 
                 
                 
@@ -775,7 +811,152 @@
         });
     });
 }
+#pragma mark get data
+-(void) loadMore
+{
+    dispatch_async(dispatch_get_main_queue(), ^{
+        if(self.loadall)
+        {
+            [RAUtils message_alert:@"All loaded" title:@"Loading Category" controller:self] ;
+            return;
+            
+        }
+        
+        self.mum.hidden = false;
+        [self.mum startAnimating];
+        self.mum.center = self.view.center;
 
+        self.isrefreshing=true;
+        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+            
+            NSDictionary* category_more=[iSalesNetwork Category:self.categoryid customid:0 price_template:0 sort:0 filter:nil keyword:nil offset:self.offset limit:20 alert:self.p_alert qty:self.p_QTY available:self.p_available price:self.p_price] ;
+            
+            dispatch_async(dispatch_get_main_queue(), ^{
+                [self.mum stopAnimating];
+                
+                NSDictionary* more_items=[category_more objectForKey:@"items"];
+                if([[category_more valueForKey:@"result"] intValue]==2)
+                {
+                    //  self.category_data = category_data;
+                    NSMutableDictionary* items_json= [[self.category_data objectForKey:@"items"] mutableCopy];
+                    
+                    int count =[[more_items valueForKey:@"count"] intValue];
+                    for(int i=0;i<count;i++)
+                    {
+                        
+                        NSDictionary * item_json = [more_items objectForKey:[NSString stringWithFormat:@"item_%d",i]];
+                        [items_json setObject:item_json forKey:[NSString stringWithFormat:@"item_%ld",i+self.offset]];
+                        
+                        
+                    }
+                    long newcount=[[[self.category_data objectForKey:@"items"] valueForKey:@"count"] intValue]+count;
+                    [items_json setValue: [NSString stringWithFormat:@"%ld",newcount] forKey:@"count"];
+                    [self.category_data setObject:items_json forKey:@"items"];
+                    self.offset+=count;
+                    
+                    if(count<20)
+                    {
+                        self.loadall=true;
+                        
+                    }
+                    //            NSDictionary * item_json = [self.category_data objectForKey:@"items"];
+                    
+                    
+                    
+                    
+                    //   NSLog(@"%@",self.category_data);
+                    
+                    [self.collectionview reloadData];
+                    
+                }
+                else
+                {
+                    [RAUtils message_alert:[category_more valueForKey:@"err_msg"] title:@"Loading Category" controller:self] ;
+                }
+                self.isrefreshing=false;
+                
+            });
+        });
+    });
+}
+-(void) reload
+{
+    
+    dispatch_async(dispatch_get_main_queue(), ^{
+        if(self.isrefreshing)
+            return;
+        self.isrefreshing=true;
+        
+        self.loadall = false;
+        //    UICollectionViewFlowLayout*  layout =(UICollectionViewFlowLayout*)self.collectionview.collectionViewLayout;
+        
+        
+        //    UICollectionViewFlowLayout *flowLayout =[self.collectionview collectionViewLayout];
+        
+        //    layout.scrollDirection= UICollectionViewScrollDirectionVertical;
+        UIRefreshControl *reF = (UIRefreshControl *)[self.view viewWithTag:200];
+        
+        [reF endRefreshing];
+        
+        reF.attributedTitle = [[NSAttributedString alloc]initWithString:@"Pull to refresh"];
+        //
+        //
+        
+        self.mum.hidden = false;
+        [self.mum startAnimating];
+        self.mum.center = self.view.center;
+        
+        self.label_net_err.hidden=true;
+        
+        self.collectionview.hidden=true;
+        
+        //        self.collectionview.userInteractionEnabled = false;
+        
+        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+            
+            NSDictionary* category_data=[iSalesNetwork Category:self.categoryid customid:0 price_template:0 sort:0 filter:nil keyword:nil offset:0 limit:20 alert:self.p_alert qty:self.p_QTY available:self.p_available price:self.p_price];
+            
+            dispatch_async(dispatch_get_main_queue(), ^{
+                
+                [self.mum stopAnimating];
+                
+                
+                //                self.collectionview.userInteractionEnabled = true;
+                self.category_data = [category_data mutableCopy];
+                [self.collectionview reloadData];
+                if([[category_data valueForKey:@"result"] intValue]==2)
+                {
+                    
+                    self.collectionview.hidden=false;
+                    NSDictionary * item_json = [self.category_data objectForKey:@"items"];
+                    self.offset =[[item_json valueForKey:@"count"] intValue];
+                    
+                    int total = [[self.category_data valueForKey:@"item_total_count"]intValue];
+                    
+                    if(total<2)
+                        self.labelTotal.text = [NSString stringWithFormat:@"Total %d item",total];
+                    else
+                        self.labelTotal.text = [NSString stringWithFormat:@"Total %d items",total];
+                    
+                }
+                else if([[category_data valueForKey:@"result"] intValue]==RESULT_NET_ERROR)
+                {
+                    self.collectionview.hidden=true;
+                    self.label_net_err.hidden=false;
+                }
+                else
+                {
+                    [RAUtils message_alert:[category_data valueForKey:@"err_msg"]  title:@"Loading Category" controller:self] ;
+                }
+                self.isrefreshing=false;
+                
+                
+                
+            });
+        });
+        
+    });
+}
 #pragma mark - CategoryMenuDelegate
 -(void)SelectCategory:(NSString *)category
 {
@@ -932,133 +1113,7 @@
     self.cagegoryLabel.hidden = false;
     
 }
--(void) loadMore
-{
-  dispatch_async(dispatch_get_main_queue(), ^{
-    self.isrefreshing=true;
-    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-        
-        NSDictionary* category_more=[iSalesNetwork Category:self.categoryid customid:0 price_template:0 sort:0 filter:nil keyword:nil offset:self.offset limit:20 alert:self.p_alert qty:self.p_QTY available:self.p_available price:self.p_price] ;
-        
-        dispatch_async(dispatch_get_main_queue(), ^{
-            
-            
-            NSDictionary* more_items=[category_more objectForKey:@"items"];
-            if([[category_more valueForKey:@"result"] intValue]==2)
-            {
-                //  self.category_data = category_data;
-                NSMutableDictionary* items_json= [[self.category_data objectForKey:@"items"] mutableCopy];
-                
-                int count =[[more_items valueForKey:@"count"] intValue];
-                for(int i=0;i<count;i++)
-                {
-                    
-                    NSDictionary * item_json = [more_items objectForKey:[NSString stringWithFormat:@"item_%d",i]];
-                    [items_json setObject:item_json forKey:[NSString stringWithFormat:@"item_%ld",i+self.offset]];
-                    
-                    
-                }
-                long newcount=[[[self.category_data objectForKey:@"items"] valueForKey:@"count"] intValue]+count;
-                [items_json setValue: [NSString stringWithFormat:@"%ld",newcount] forKey:@"count"];
-                [self.category_data setObject:items_json forKey:@"items"];
-                self.offset+=count;
-                //            NSDictionary * item_json = [self.category_data objectForKey:@"items"];
-                
-                
-                
-                
-             //   NSLog(@"%@",self.category_data);
-                
-                [self.collectionview reloadData];
-                
-            }
-            else
-            {
-                [RAUtils message_alert:[category_more valueForKey:@"err_msg"] title:@"Loading Category" controller:self] ;
-            }
-            self.isrefreshing=false;
-
-        });
-    });
-  });
-}
--(void) reload
-{
-    
-    dispatch_async(dispatch_get_main_queue(), ^{
-        if(self.isrefreshing)
-            return;
-        self.isrefreshing=true;
-        
-        //    UICollectionViewFlowLayout*  layout =(UICollectionViewFlowLayout*)self.collectionview.collectionViewLayout;
-        
-        
-        //    UICollectionViewFlowLayout *flowLayout =[self.collectionview collectionViewLayout];
-        
-        //    layout.scrollDirection= UICollectionViewScrollDirectionVertical;
-            UIRefreshControl *reF = (UIRefreshControl *)[self.view viewWithTag:200];
-        
-            [reF endRefreshing];
-        
-            reF.attributedTitle = [[NSAttributedString alloc]initWithString:@"Pull to refresh"];
-        //
-        //
-        
-        self.mum.hidden = false;
-        [self.mum startAnimating];
-        self.mum.center = self.view.center;
 
-        self.label_net_err.hidden=true;
-        
-         self.collectionview.hidden=true;
-        
-//        self.collectionview.userInteractionEnabled = false;
-        
-        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-            
-            NSDictionary* category_data=[iSalesNetwork Category:self.categoryid customid:0 price_template:0 sort:0 filter:nil keyword:nil offset:0 limit:20 alert:self.p_alert qty:self.p_QTY available:self.p_available price:self.p_price];
-            
-            dispatch_async(dispatch_get_main_queue(), ^{
-                
-                [self.mum stopAnimating];
-                
-                
-//                self.collectionview.userInteractionEnabled = true;
-                self.category_data = [category_data mutableCopy];
-                [self.collectionview reloadData];
-                if([[category_data valueForKey:@"result"] intValue]==2)
-                {
-                    
-                    self.collectionview.hidden=false;
-                    NSDictionary * item_json = [self.category_data objectForKey:@"items"];
-                    self.offset =[[item_json valueForKey:@"count"] intValue];
-                    
-                    int total = [[self.category_data valueForKey:@"item_total_count"]intValue];
-                    
-                    if(total<2)
-                        self.labelTotal.text = [NSString stringWithFormat:@"Total %d item",total];
-                    else
-                        self.labelTotal.text = [NSString stringWithFormat:@"Total %d items",total];
-                    
-                }
-                else if([[category_data valueForKey:@"result"] intValue]==RESULT_NET_ERROR)
-                {
-                    self.collectionview.hidden=true;
-                    self.label_net_err.hidden=false;
-                }
-                else
-                {
-                    [RAUtils message_alert:[category_data valueForKey:@"err_msg"]  title:@"Loading Category" controller:self] ;
-                }
-                self.isrefreshing=false;
-                
-                
-                
-            });
-        });
- 
-    });
-}
 - (IBAction)onChangeDisplay:(UIButton *)sender {
     UICollectionViewFlowLayout *flowLayout =(UICollectionViewFlowLayout*)[self.collectionview collectionViewLayout];
     

+ 158 - 193
RedAnt ERP Mobile/common/Functions/contact/ContactAdvanceSearchViewController.m

@@ -143,203 +143,168 @@
     // add params check here.
     [self.lastedit endEditing:true];
     [self.lasttextview endEditing:true];
-    self.cancommit=true;
-    NSMutableDictionary* upparams=[[NSMutableDictionary alloc] init];
-    //    [upparams setValue:[self.params valueForKey:@"cart2Checkbox"] forKey:@"cart2Checkbox"];
-    int section_count=[[self.content_data_download valueForKey:@"section_count"] intValue];
-    for(int i=0;i<section_count;i++)
-    {
-        NSMutableDictionary * sectionjson = [[self.content_data_download objectForKey:[NSString stringWithFormat:@"section_%d",i ]] mutableCopy];
-        int item_count = [[sectionjson valueForKey:@"count"] intValue];
-        for(int j=0;j<item_count;j++)
-        {
-            NSMutableDictionary * itemjson=[[sectionjson objectForKey:[NSString stringWithFormat:@"item_%d",j ]] mutableCopy];
-            NSString* key = [itemjson valueForKey:@"name"];
-            if(key==nil || key.length==0)
-                continue;
-            if([[itemjson valueForKey:@"control"] isEqualToString:@"enum"])
-            {
-                NSString* single_select = [itemjson valueForKey:@"single_select"];
-                if([single_select isEqualToString:@"true"])
-                {
-                    NSDictionary* cadejson=[itemjson objectForKey:@"cadedate"];
-                    int count = [[cadejson valueForKey:@"count"] intValue];
-                    bool setvalue = false;
-                    for(int cc=0;cc<count;cc++)
-                    {
-                        NSDictionary* valjson=[cadejson objectForKey:[NSString stringWithFormat:@"val_%d",cc]];
-                        if([[valjson valueForKey:@"check"]intValue]==1)
-                        {
-                            [upparams setValue:[valjson valueForKey:@"value_id"] forKey:[itemjson valueForKey:@"name"]];
-                            setvalue=true;
-                            break;
-                        }
-                    }
-                    if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] && setvalue==false)
-                    {
-                        self.cancommit = false;
-                    }
-                }
-                else
-                {
-                    
-                    NSMutableArray* checked = [[NSMutableArray alloc] init];
-                    NSDictionary* cadejson=[itemjson objectForKey:@"cadedate"];
-                    int count = [[cadejson valueForKey:@"count"] intValue];
-                    // bool setvalue = false;
-                    for(int cc=0;cc<count;cc++)
-                    {
-                        NSDictionary* valjson=[cadejson objectForKey:[NSString stringWithFormat:@"val_%d",cc]];
-                        if([[valjson valueForKey:@"check"]intValue]==1)
-                        {
-                            
-                            [checked addObject:[NSNumber numberWithInt:[[valjson valueForKey:@"value_id"] intValue]]];
-                            //                            [upparams setValue:[valjson valueForKey:@"value_id"] forKey:[itemjson valueForKey:@"name"]];
-                            //                            setvalue=true;
-                            //                            break;
-                        }
-                    }
-                    if([[itemjson valueForKey:@"required"] isEqualToString: @"true"]&&checked.count==0)
-                    {
-                        self.cancommit = false;
-                    }
-                    else
-                    {
-                        NSString * string = [checked componentsJoinedByString:@","];
-                        [upparams setValue:string forKey:[itemjson valueForKey:@"name"]];
-                    }
-                }
-                /*
-                 upparams setValue:itemjson forKey:<#(NSString *)#>
-                 
-                 */
-            }else
-                if([[itemjson valueForKey:@"control"] isEqualToString:@"action"])
-                {
-                    if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] && [itemjson objectForKeyedSubscript:@"data"]==nil)
-                        self.cancommit = false;
-                }
-                else if([[itemjson valueForKey:@"control"] isEqualToString:@"switch"])
-                {
-                    NSString* valuestr = [itemjson valueForKey:@"value"];
-                    [upparams setValue:valuestr forKey:[itemjson valueForKey:@"name"]];
-                    
-                    NSString* value = [itemjson valueForKey:@"value"];
-                    NSMutableDictionary* boolitem=nil;
-                    NSMutableDictionary* subjson=nil;
-                    if([value isEqualToString:@"true"])
-                    {
-                        boolitem =[[itemjson objectForKey:@"true"] mutableCopy];
-                        
-                    }
-                    else
-                    {
-                        boolitem =[[itemjson objectForKey:@"false"] mutableCopy];
-                        
-                    }
-                    subjson=[[boolitem objectForKey:@"sub_item"] mutableCopy];
-                    if( subjson!=nil /*&& !active*/)
-                    {
-                        int sub_count = [[subjson valueForKey:@"count"] intValue];
-                        for(int l=0;l<sub_count;l++)
-                        {
-                            NSMutableDictionary * modify_item=[[subjson objectForKey:[NSString stringWithFormat:@"item_%d",l ]] mutableCopy];
-                            
-                            
-                            
-                            
-                            if([modify_item valueForKey:@"value"]!=nil && ![[modify_item valueForKey:@"value"]isEqualToString:@""])
-                                [upparams setValue:[modify_item valueForKey:@"value"] forKey:[modify_item valueForKey:@"name"]];
-                            else
-                            {
-                                if([[modify_item valueForKey:@"required"] isEqualToString: @"true"] )
-                                    self.cancommit = false;
-                            }
-                        }
-                        
-                        
-                        
-                    }
-                }
-                else
-                    if([[itemjson valueForKey:@"control"] isEqualToString:@"img"])
-                    {
-                        if([itemjson valueForKey:@"avalue"]!=nil && ![[itemjson valueForKey:@"avalue"]isEqualToString:@""])
-                            [upparams setValue:[itemjson valueForKey:@"avalue"] forKey:[itemjson valueForKey:@"name"]];
-                        else
-                        {
-                            if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] )
-                                self.cancommit = false;
-                        }
-                    }
-                    else
-                    {
-                        if([itemjson valueForKey:@"value"]!=nil && ![[itemjson valueForKey:@"value"]isEqualToString:@""])
-                            [upparams setValue:[itemjson valueForKey:@"value"] forKey:[itemjson valueForKey:@"name"]];
-                        else
-                        {
-                            if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] )
-                                self.cancommit = false;
-                        }
-                    }
-            upparams= [self subitem_param:itemjson addto:upparams ];
-        }
-    }
-    if(self.cancommit==false)
-    {
-//        UIAlertView * alert = [[UIAlertView alloc] initWithTitle: @"Some requried field is missing" message:@"Fields with * mark can not be empty." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
-
-//        [alert show];
-        
-        
-        [RAUtils alert_view:@"Fields with * mark cannot be empty." title:@"Some Requried Fields Are Missing."];
-        
-        self.content_data_control = [self translate_json:self.content_data_download changed:self.changed_data];
-        //NSLog(@"CONTENT translate:%@",[iSalesNetwork DataTOjsonString:self.content_data]);
-        //[self.editorTable reloadData ];
-        [self.editorTable reloadData];
-        return;
-    }
-    
-//    if(upparams.count==0)
+//    self.cancommit=true;
+//    NSMutableDictionary* upparams=[[NSMutableDictionary alloc] init];
+//    //    [upparams setValue:[self.params valueForKey:@"cart2Checkbox"] forKey:@"cart2Checkbox"];
+//    int section_count=[[self.content_data_download valueForKey:@"section_count"] intValue];
+//    for(int i=0;i<section_count;i++)
 //    {
-//        RAUtils aler
-//        return;
+//        NSMutableDictionary * sectionjson = [[self.content_data_download objectForKey:[NSString stringWithFormat:@"section_%d",i ]] mutableCopy];
+//        int item_count = [[sectionjson valueForKey:@"count"] intValue];
+//        for(int j=0;j<item_count;j++)
+//        {
+//            NSMutableDictionary * itemjson=[[sectionjson objectForKey:[NSString stringWithFormat:@"item_%d",j ]] mutableCopy];
+//            NSString* key = [itemjson valueForKey:@"name"];
+//            if(key==nil || key.length==0)
+//                continue;
+//            if([[itemjson valueForKey:@"control"] isEqualToString:@"enum"])
+//            {
+//                NSString* single_select = [itemjson valueForKey:@"single_select"];
+//                if([single_select isEqualToString:@"true"])
+//                {
+//                    NSDictionary* cadejson=[itemjson objectForKey:@"cadedate"];
+//                    int count = [[cadejson valueForKey:@"count"] intValue];
+//                    bool setvalue = false;
+//                    for(int cc=0;cc<count;cc++)
+//                    {
+//                        NSDictionary* valjson=[cadejson objectForKey:[NSString stringWithFormat:@"val_%d",cc]];
+//                        if([[valjson valueForKey:@"check"]intValue]==1)
+//                        {
+//                            [upparams setValue:[valjson valueForKey:@"value_id"] forKey:[itemjson valueForKey:@"name"]];
+//                            setvalue=true;
+//                            break;
+//                        }
+//                    }
+//                    if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] && setvalue==false)
+//                    {
+//                        self.cancommit = false;
+//                    }
+//                }
+//                else
+//                {
+//                    
+//                    NSMutableArray* checked = [[NSMutableArray alloc] init];
+//                    NSDictionary* cadejson=[itemjson objectForKey:@"cadedate"];
+//                    int count = [[cadejson valueForKey:@"count"] intValue];
+//                    // bool setvalue = false;
+//                    for(int cc=0;cc<count;cc++)
+//                    {
+//                        NSDictionary* valjson=[cadejson objectForKey:[NSString stringWithFormat:@"val_%d",cc]];
+//                        if([[valjson valueForKey:@"check"]intValue]==1)
+//                        {
+//                            
+//                            [checked addObject:[NSNumber numberWithInt:[[valjson valueForKey:@"value_id"] intValue]]];
+//                            //                            [upparams setValue:[valjson valueForKey:@"value_id"] forKey:[itemjson valueForKey:@"name"]];
+//                            //                            setvalue=true;
+//                            //                            break;
+//                        }
+//                    }
+//                    if([[itemjson valueForKey:@"required"] isEqualToString: @"true"]&&checked.count==0)
+//                    {
+//                        self.cancommit = false;
+//                    }
+//                    else
+//                    {
+//                        NSString * string = [checked componentsJoinedByString:@","];
+//                        [upparams setValue:string forKey:[itemjson valueForKey:@"name"]];
+//                    }
+//                }
+//                /*
+//                 upparams setValue:itemjson forKey:<#(NSString *)#>
+//                 
+//                 */
+//            }else
+//                if([[itemjson valueForKey:@"control"] isEqualToString:@"action"])
+//                {
+//                    if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] && [itemjson objectForKeyedSubscript:@"data"]==nil)
+//                        self.cancommit = false;
+//                }
+//                else if([[itemjson valueForKey:@"control"] isEqualToString:@"switch"])
+//                {
+//                    NSString* valuestr = [itemjson valueForKey:@"value"];
+//                    [upparams setValue:valuestr forKey:[itemjson valueForKey:@"name"]];
+//                    
+//                    NSString* value = [itemjson valueForKey:@"value"];
+//                    NSMutableDictionary* boolitem=nil;
+//                    NSMutableDictionary* subjson=nil;
+//                    if([value isEqualToString:@"true"])
+//                    {
+//                        boolitem =[[itemjson objectForKey:@"true"] mutableCopy];
+//                        
+//                    }
+//                    else
+//                    {
+//                        boolitem =[[itemjson objectForKey:@"false"] mutableCopy];
+//                        
+//                    }
+//                    subjson=[[boolitem objectForKey:@"sub_item"] mutableCopy];
+//                    if( subjson!=nil /*&& !active*/)
+//                    {
+//                        int sub_count = [[subjson valueForKey:@"count"] intValue];
+//                        for(int l=0;l<sub_count;l++)
+//                        {
+//                            NSMutableDictionary * modify_item=[[subjson objectForKey:[NSString stringWithFormat:@"item_%d",l ]] mutableCopy];
+//                            
+//                            
+//                            
+//                            
+//                            if([modify_item valueForKey:@"value"]!=nil && ![[modify_item valueForKey:@"value"]isEqualToString:@""])
+//                                [upparams setValue:[modify_item valueForKey:@"value"] forKey:[modify_item valueForKey:@"name"]];
+//                            else
+//                            {
+//                                if([[modify_item valueForKey:@"required"] isEqualToString: @"true"] )
+//                                    self.cancommit = false;
+//                            }
+//                        }
+//                        
+//                        
+//                        
+//                    }
+//                }
+//                else
+//                    if([[itemjson valueForKey:@"control"] isEqualToString:@"img"])
+//                    {
+//                        if([itemjson valueForKey:@"avalue"]!=nil && ![[itemjson valueForKey:@"avalue"]isEqualToString:@""])
+//                            [upparams setValue:[itemjson valueForKey:@"avalue"] forKey:[itemjson valueForKey:@"name"]];
+//                        else
+//                        {
+//                            if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] )
+//                                self.cancommit = false;
+//                        }
+//                    }
+//                    else
+//                    {
+//                        if([itemjson valueForKey:@"value"]!=nil && ![[itemjson valueForKey:@"value"]isEqualToString:@""])
+//                            [upparams setValue:[itemjson valueForKey:@"value"] forKey:[itemjson valueForKey:@"name"]];
+//                        else
+//                        {
+//                            if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] )
+//                                self.cancommit = false;
+//                        }
+//                    }
+//            upparams= [self subitem_param:itemjson addto:upparams ];
+//        }
 //    }
-    
-//    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+//    if(self.cancommit==false)
+//    {
+////        UIAlertView * alert = [[UIAlertView alloc] initWithTitle: @"Some requried field is missing" message:@"Fields with * mark can not be empty." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
+//
+////        [alert show];
 //        
-//        NSDictionary* editor_json = [iSalesNetwork save_Customer:upparams];
 //        
-//        dispatch_async(dispatch_get_main_queue(), ^{
-//            
-//            
-//            
-//            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"];
-//                //    //     self.labelContact.text=appDelegate.contact_name;
-//                //
-//                //    NSDictionary * customerinfo = appDelegate.customerInfo;
-//                [self prepareReturn:nil];
-//                [self.navigationController popViewControllerAnimated:false];
-//                
-//            }
-//            else
-//            {
-//                [RAUtils message_alert:[editor_json valueForKey:@"err_msg"] title:@"Save order failed." controller:self] ;
-//            }
-//            
-//            
-//            
-//            
-//        });
-//    });
+//        [RAUtils alert_view:@"Fields with * mark cannot be empty." title:@"Some Requried Fields Are Missing."];
+//        
+//        self.content_data_control = [self translate_json:self.content_data_download changed:self.changed_data];
+//        //NSLog(@"CONTENT translate:%@",[iSalesNetwork DataTOjsonString:self.content_data]);
+//        //[self.editorTable reloadData ];
+//        [self.editorTable reloadData];
+//        return;
+//    }
+    
+    
+    NSMutableDictionary* upparams = [self check_cancommit:true];
+    if(self.cancommit==false)
+        return;
     
     if(self.returnValue)
         self.returnValue(upparams);

+ 154 - 149
RedAnt ERP Mobile/common/Functions/contact/CustomerEditViewController.m

@@ -98,157 +98,162 @@
     // add params check here.
     [self.lastedit endEditing:true];
     [self.lasttextview endEditing:true];
-    self.cancommit=true;
-    NSMutableDictionary* upparams=[[NSMutableDictionary alloc] init];
-    //    [upparams setValue:[self.params valueForKey:@"cart2Checkbox"] forKey:@"cart2Checkbox"];
-    int section_count=[[self.content_data_download valueForKey:@"section_count"] intValue];
-    for(int i=0;i<section_count;i++)
-    {
-        NSMutableDictionary * sectionjson = [[self.content_data_download objectForKey:[NSString stringWithFormat:@"section_%d",i ]] mutableCopy];
-        int item_count = [[sectionjson valueForKey:@"count"] intValue];
-        for(int j=0;j<item_count;j++)
-        {
-            NSMutableDictionary * itemjson=[[sectionjson objectForKey:[NSString stringWithFormat:@"item_%d",j ]] mutableCopy];
-            NSString* key = [itemjson valueForKey:@"name"];
-            if(key==nil || key.length==0)
-                continue;
-            if([[itemjson valueForKey:@"control"] isEqualToString:@"enum"])
-            {
-                NSString* single_select = [itemjson valueForKey:@"single_select"];
-                if([single_select isEqualToString:@"true"])
-                {
-                    NSDictionary* cadejson=[itemjson objectForKey:@"cadedate"];
-                    int count = [[cadejson valueForKey:@"count"] intValue];
-                    bool setvalue = false;
-                    for(int cc=0;cc<count;cc++)
-                    {
-                        NSDictionary* valjson=[cadejson objectForKey:[NSString stringWithFormat:@"val_%d",cc]];
-                        if([[valjson valueForKey:@"check"]intValue]==1)
-                        {
-                            [upparams setValue:[valjson valueForKey:@"value_id"] forKey:[itemjson valueForKey:@"name"]];
-                            setvalue=true;
-                            break;
-                        }
-                    }
-                    if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] && setvalue==false)
-                    {
-                        self.cancommit = false;
-                    }
-                }
-                else
-                {
-                    
-                    NSMutableArray* checked = [[NSMutableArray alloc] init];
-                    NSDictionary* cadejson=[itemjson objectForKey:@"cadedate"];
-                    int count = [[cadejson valueForKey:@"count"] intValue];
-                    // bool setvalue = false;
-                    for(int cc=0;cc<count;cc++)
-                    {
-                        NSDictionary* valjson=[cadejson objectForKey:[NSString stringWithFormat:@"val_%d",cc]];
-                        if([[valjson valueForKey:@"check"]intValue]==1)
-                        {
-                            
-                            [checked addObject:[NSNumber numberWithInt:[[valjson valueForKey:@"value_id"] intValue]]];
-                            //                            [upparams setValue:[valjson valueForKey:@"value_id"] forKey:[itemjson valueForKey:@"name"]];
-                            //                            setvalue=true;
-                            //                            break;
-                        }
-                    }
-                    if([[itemjson valueForKey:@"required"] isEqualToString: @"true"]&&checked.count==0)
-                    {
-                        self.cancommit = false;
-                    }
-                    else
-                    {
-                        NSString * string = [checked componentsJoinedByString:@","];
-                        [upparams setValue:string forKey:[itemjson valueForKey:@"name"]];
-                    }
-                }
-                /*
-                 upparams setValue:itemjson forKey:<#(NSString *)#>
-                 
-                 */
-            }else
-                if([[itemjson valueForKey:@"control"] isEqualToString:@"action"])
-                {
-                    if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] && [itemjson objectForKeyedSubscript:@"data"]==nil)
-                        self.cancommit = false;
-                }
-                else if([[itemjson valueForKey:@"control"] isEqualToString:@"switch"])
-                {
-                    NSString* valuestr = [itemjson valueForKey:@"value"];
-                    [upparams setValue:valuestr forKey:[itemjson valueForKey:@"name"]];
-                    
-                    NSString* value = [itemjson valueForKey:@"value"];
-                    NSMutableDictionary* boolitem=nil;
-                    NSMutableDictionary* subjson=nil;
-                    if([value isEqualToString:@"true"])
-                    {
-                        boolitem =[[itemjson objectForKey:@"true"] mutableCopy];
-                        
-                    }
-                    else
-                    {
-                        boolitem =[[itemjson objectForKey:@"false"] mutableCopy];
-                        
-                    }
-                    subjson=[[boolitem objectForKey:@"sub_item"] mutableCopy];
-                    if( subjson!=nil /*&& !active*/)
-                    {
-                        int sub_count = [[subjson valueForKey:@"count"] intValue];
-                        for(int l=0;l<sub_count;l++)
-                        {
-                            NSMutableDictionary * modify_item=[[subjson objectForKey:[NSString stringWithFormat:@"item_%d",l ]] mutableCopy];
-                            
-                            
-                            
-                            
-                            if([modify_item valueForKey:@"value"]!=nil && ![[modify_item valueForKey:@"value"]isEqualToString:@""])
-                                [upparams setValue:[modify_item valueForKey:@"value"] forKey:[modify_item valueForKey:@"name"]];
-                            else
-                            {
-                                if([[modify_item valueForKey:@"required"] isEqualToString: @"true"] )
-                                    self.cancommit = false;
-                            }
-                        }
-                        
-                        
-                        
-                    }
-                }
-                else
-                    if([[itemjson valueForKey:@"control"] isEqualToString:@"img"])
-                    {
-                        if([itemjson valueForKey:@"avalue"]!=nil && ![[itemjson valueForKey:@"avalue"]isEqualToString:@""])
-                            [upparams setValue:[itemjson valueForKey:@"avalue"] forKey:[itemjson valueForKey:@"name"]];
-                        else
-                        {
-                            if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] )
-                                self.cancommit = false;
-                        }
-                    }
-                    else
-                    {
-                        if([itemjson valueForKey:@"value"]!=nil && ![[itemjson valueForKey:@"value"]isEqualToString:@""])
-                            [upparams setValue:[itemjson valueForKey:@"value"] forKey:[itemjson valueForKey:@"name"]];
-                        else
-                        {
-                            if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] )
-                                self.cancommit = false;
-                        }
-                    }
-            upparams= [self subitem_param:itemjson addto:upparams ];
-        }
-    }
+//    self.cancommit=true;
+//    NSMutableDictionary* upparams=[[NSMutableDictionary alloc] init];
+//    //    [upparams setValue:[self.params valueForKey:@"cart2Checkbox"] forKey:@"cart2Checkbox"];
+//    int section_count=[[self.content_data_download valueForKey:@"section_count"] intValue];
+//    for(int i=0;i<section_count;i++)
+//    {
+//        NSMutableDictionary * sectionjson = [[self.content_data_download objectForKey:[NSString stringWithFormat:@"section_%d",i ]] mutableCopy];
+//        int item_count = [[sectionjson valueForKey:@"count"] intValue];
+//        for(int j=0;j<item_count;j++)
+//        {
+//            NSMutableDictionary * itemjson=[[sectionjson objectForKey:[NSString stringWithFormat:@"item_%d",j ]] mutableCopy];
+//            NSString* key = [itemjson valueForKey:@"name"];
+//            if(key==nil || key.length==0)
+//                continue;
+//            if([[itemjson valueForKey:@"control"] isEqualToString:@"enum"])
+//            {
+//                NSString* single_select = [itemjson valueForKey:@"single_select"];
+//                if([single_select isEqualToString:@"true"])
+//                {
+//                    NSDictionary* cadejson=[itemjson objectForKey:@"cadedate"];
+//                    int count = [[cadejson valueForKey:@"count"] intValue];
+//                    bool setvalue = false;
+//                    for(int cc=0;cc<count;cc++)
+//                    {
+//                        NSDictionary* valjson=[cadejson objectForKey:[NSString stringWithFormat:@"val_%d",cc]];
+//                        if([[valjson valueForKey:@"check"]intValue]==1)
+//                        {
+//                            [upparams setValue:[valjson valueForKey:@"value_id"] forKey:[itemjson valueForKey:@"name"]];
+//                            setvalue=true;
+//                            break;
+//                        }
+//                    }
+//                    if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] && setvalue==false)
+//                    {
+//                        self.cancommit = false;
+//                    }
+//                }
+//                else
+//                {
+//                    
+//                    NSMutableArray* checked = [[NSMutableArray alloc] init];
+//                    NSDictionary* cadejson=[itemjson objectForKey:@"cadedate"];
+//                    int count = [[cadejson valueForKey:@"count"] intValue];
+//                    // bool setvalue = false;
+//                    for(int cc=0;cc<count;cc++)
+//                    {
+//                        NSDictionary* valjson=[cadejson objectForKey:[NSString stringWithFormat:@"val_%d",cc]];
+//                        if([[valjson valueForKey:@"check"]intValue]==1)
+//                        {
+//                            
+//                            [checked addObject:[NSNumber numberWithInt:[[valjson valueForKey:@"value_id"] intValue]]];
+//                            //                            [upparams setValue:[valjson valueForKey:@"value_id"] forKey:[itemjson valueForKey:@"name"]];
+//                            //                            setvalue=true;
+//                            //                            break;
+//                        }
+//                    }
+//                    if([[itemjson valueForKey:@"required"] isEqualToString: @"true"]&&checked.count==0)
+//                    {
+//                        self.cancommit = false;
+//                    }
+//                    else
+//                    {
+//                        NSString * string = [checked componentsJoinedByString:@","];
+//                        [upparams setValue:string forKey:[itemjson valueForKey:@"name"]];
+//                    }
+//                }
+//                /*
+//                 upparams setValue:itemjson forKey:<#(NSString *)#>
+//                 
+//                 */
+//            }else
+//                if([[itemjson valueForKey:@"control"] isEqualToString:@"action"])
+//                {
+//                    if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] && [itemjson objectForKeyedSubscript:@"data"]==nil)
+//                        self.cancommit = false;
+//                }
+//                else if([[itemjson valueForKey:@"control"] isEqualToString:@"switch"])
+//                {
+//                    NSString* valuestr = [itemjson valueForKey:@"value"];
+//                    [upparams setValue:valuestr forKey:[itemjson valueForKey:@"name"]];
+//                    
+//                    NSString* value = [itemjson valueForKey:@"value"];
+//                    NSMutableDictionary* boolitem=nil;
+//                    NSMutableDictionary* subjson=nil;
+//                    if([value isEqualToString:@"true"])
+//                    {
+//                        boolitem =[[itemjson objectForKey:@"true"] mutableCopy];
+//                        
+//                    }
+//                    else
+//                    {
+//                        boolitem =[[itemjson objectForKey:@"false"] mutableCopy];
+//                        
+//                    }
+//                    subjson=[[boolitem objectForKey:@"sub_item"] mutableCopy];
+//                    if( subjson!=nil /*&& !active*/)
+//                    {
+//                        int sub_count = [[subjson valueForKey:@"count"] intValue];
+//                        for(int l=0;l<sub_count;l++)
+//                        {
+//                            NSMutableDictionary * modify_item=[[subjson objectForKey:[NSString stringWithFormat:@"item_%d",l ]] mutableCopy];
+//                            
+//                            
+//                            
+//                            
+//                            if([modify_item valueForKey:@"value"]!=nil && ![[modify_item valueForKey:@"value"]isEqualToString:@""])
+//                                [upparams setValue:[modify_item valueForKey:@"value"] forKey:[modify_item valueForKey:@"name"]];
+//                            else
+//                            {
+//                                if([[modify_item valueForKey:@"required"] isEqualToString: @"true"] )
+//                                    self.cancommit = false;
+//                            }
+//                        }
+//                        
+//                        
+//                        
+//                    }
+//                }
+//                else
+//                    if([[itemjson valueForKey:@"control"] isEqualToString:@"img"])
+//                    {
+//                        if([itemjson valueForKey:@"avalue"]!=nil && ![[itemjson valueForKey:@"avalue"]isEqualToString:@""])
+//                            [upparams setValue:[itemjson valueForKey:@"avalue"] forKey:[itemjson valueForKey:@"name"]];
+//                        else
+//                        {
+//                            if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] )
+//                                self.cancommit = false;
+//                        }
+//                    }
+//                    else
+//                    {
+//                        if([itemjson valueForKey:@"value"]!=nil && ![[itemjson valueForKey:@"value"]isEqualToString:@""])
+//                            [upparams setValue:[itemjson valueForKey:@"value"] forKey:[itemjson valueForKey:@"name"]];
+//                        else
+//                        {
+//                            if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] )
+//                                self.cancommit = false;
+//                        }
+//                    }
+//            upparams= [self subitem_param:itemjson addto:upparams ];
+//        }
+//    }
+//    if(self.cancommit==false)
+//    {
+//        [RAUtils alert_view:@"Fields with * mark cannot be empty." title:@"Some Requried Fields Are Missing."];
+//        self.content_data_control = [self translate_json:self.content_data_download changed:self.changed_data];
+//        //NSLog(@"CONTENT translate:%@",[iSalesNetwork DataTOjsonString:self.content_data]);
+//        //[self.editorTable reloadData ];
+//        [self.editorTable reloadData];
+//        return;
+//    }
+    
+    
+    NSMutableDictionary* upparams = [self check_cancommit:true];
     if(self.cancommit==false)
-    {
-        [RAUtils alert_view:@"Fields with * mark cannot be empty." title:@"Some Requried Fields Are Missing."];
-        self.content_data_control = [self translate_json:self.content_data_download changed:self.changed_data];
-        //NSLog(@"CONTENT translate:%@",[iSalesNetwork DataTOjsonString:self.content_data]);
-        //[self.editorTable reloadData ];
-        [self.editorTable reloadData];
         return;
-    }
     UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait" title:@"Saving Contact"];
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
         

+ 76 - 74
RedAnt ERP Mobile/common/Functions/creditcard/CreditCardEditorViewController.m

@@ -40,82 +40,84 @@
     
     [self.lastedit endEditing:true];
      [self.lasttextview endEditing:true];
-    self.cancommit=true;
-    NSMutableDictionary* upparams=[[NSMutableDictionary alloc] init];
-    int section_count=[[self.content_data_download valueForKey:@"section_count"] intValue];
-    for(int i=0;i<section_count;i++)
-    {
-        NSMutableDictionary * sectionjson = [[self.content_data_download objectForKey:[NSString stringWithFormat:@"section_%d",i ]] mutableCopy];
-        int item_count = [[sectionjson valueForKey:@"count"] intValue];
-        for(int j=0;j<item_count;j++)
-        {
-            NSMutableDictionary * itemjson=[[sectionjson objectForKey:[NSString stringWithFormat:@"item_%d",j ]] mutableCopy];
-            NSString* key = [itemjson valueForKey:@"name"];
-            if(key==nil || key.length==0)
-                continue;
-            if([[itemjson valueForKey:@"control"] isEqualToString:@"enum"])
-            {
-                NSString* single_select = [itemjson valueForKey:@"single_select"];
-                if([single_select isEqualToString:@"true"])
-                {
-                    NSDictionary* cadejson=[itemjson objectForKey:@"cadedate"];
-                    int count = [[cadejson valueForKey:@"count"] intValue];
-                    bool setvalue = false;
-                    for(int cc=0;cc<count;cc++)
-                    {
-                        NSDictionary* valjson=[cadejson objectForKey:[NSString stringWithFormat:@"val_%d",cc]];
-                        if([[valjson valueForKey:@"check"]intValue]==1)
-                        {
-                            [upparams setValue:[valjson valueForKey:@"value_id"] forKey:[itemjson valueForKey:@"name"]];
-                            setvalue=true;
-                            break;
-                        }
-                    }
-                    if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] && setvalue==false)
-                    {
-                        self.cancommit = false;
-                    }
-                }
-                else
-                {
-                    //not support multi select for now;
-                }
-                /*
-                 upparams setValue:itemjson forKey:<#(NSString *)#>
-                 
-                 */
-            }
-            else
-            {
-                if([itemjson valueForKey:@"value"]!=nil && ![[itemjson valueForKey:@"value"]isEqualToString:@""])
-                    [upparams setValue:[itemjson valueForKey:@"value"] forKey:[itemjson valueForKey:@"name"]];
-                else
-                {
-                    if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] )
-                        self.cancommit = false;
-                }
-            }
-            upparams= [self subitem_param:itemjson addto:upparams ];
-        }
-    }
-    
-    
+//    self.cancommit=true;
+//    NSMutableDictionary* upparams=[[NSMutableDictionary alloc] init];
+//    int section_count=[[self.content_data_download valueForKey:@"section_count"] intValue];
+//    for(int i=0;i<section_count;i++)
+//    {
+//        NSMutableDictionary * sectionjson = [[self.content_data_download objectForKey:[NSString stringWithFormat:@"section_%d",i ]] mutableCopy];
+//        int item_count = [[sectionjson valueForKey:@"count"] intValue];
+//        for(int j=0;j<item_count;j++)
+//        {
+//            NSMutableDictionary * itemjson=[[sectionjson objectForKey:[NSString stringWithFormat:@"item_%d",j ]] mutableCopy];
+//            NSString* key = [itemjson valueForKey:@"name"];
+//            if(key==nil || key.length==0)
+//                continue;
+//            if([[itemjson valueForKey:@"control"] isEqualToString:@"enum"])
+//            {
+//                NSString* single_select = [itemjson valueForKey:@"single_select"];
+//                if([single_select isEqualToString:@"true"])
+//                {
+//                    NSDictionary* cadejson=[itemjson objectForKey:@"cadedate"];
+//                    int count = [[cadejson valueForKey:@"count"] intValue];
+//                    bool setvalue = false;
+//                    for(int cc=0;cc<count;cc++)
+//                    {
+//                        NSDictionary* valjson=[cadejson objectForKey:[NSString stringWithFormat:@"val_%d",cc]];
+//                        if([[valjson valueForKey:@"check"]intValue]==1)
+//                        {
+//                            [upparams setValue:[valjson valueForKey:@"value_id"] forKey:[itemjson valueForKey:@"name"]];
+//                            setvalue=true;
+//                            break;
+//                        }
+//                    }
+//                    if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] && setvalue==false)
+//                    {
+//                        self.cancommit = false;
+//                    }
+//                }
+//                else
+//                {
+//                    //not support multi select for now;
+//                }
+//                /*
+//                 upparams setValue:itemjson forKey:<#(NSString *)#>
+//                 
+//                 */
+//            }
+//            else
+//            {
+//                if([itemjson valueForKey:@"value"]!=nil && ![[itemjson valueForKey:@"value"]isEqualToString:@""])
+//                    [upparams setValue:[itemjson valueForKey:@"value"] forKey:[itemjson valueForKey:@"name"]];
+//                else
+//                {
+//                    if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] )
+//                        self.cancommit = false;
+//                }
+//            }
+//            upparams= [self subitem_param:itemjson addto:upparams ];
+//        }
+//    }
+//    
+//    
+//    if(self.cancommit==false)
+//    {
+//[RAUtils alert_view:@"Fields with * mark cannot be empty." title:@"Some Requried Fields Are Missing."];
+//        
+//        self.content_data_control = [self translate_json:self.content_data_download changed:self.changed_data];
+//        
+//        
+//        //    NSLog(@"CONTENT translate:%@",[iSalesNetwork DataTOjsonString:self.content_data]);
+//        //        [self.editorTable reloadData ];
+//        
+//        [self.editorTable reloadData];
+//        return;
+//        
+//    }
+
+    NSMutableDictionary* upparams = [self check_cancommit:true];
     if(self.cancommit==false)
-    {
-[RAUtils alert_view:@"Fields with * mark cannot be empty." title:@"Some Requried Fields Are Missing."];
-        
-        self.content_data_control = [self translate_json:self.content_data_download changed:self.changed_data];
-        
-        
-        //    NSLog(@"CONTENT translate:%@",[iSalesNetwork DataTOjsonString:self.content_data]);
-        //        [self.editorTable reloadData ];
-        
-        [self.editorTable reloadData];
         return;
-        
-    }
-
-    
     
     [self prepareReturn:self.content_data_download];
     [self.navigationController popViewControllerAnimated:(false)];

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

@@ -421,10 +421,6 @@
                                 
                                 //    NSString* order_code = [return_json valueForKey:@"order_code"];
                                 AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
-                                //                            appDelegate.order_code = order_code;
-                                //
-                                //                        AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-                                //                        appDelegate.order_code = order_code;
                                 [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
                                 
                                 
@@ -492,10 +488,6 @@
                 
                                         //    NSString* order_code = [return_json valueForKey:@"order_code"];
                                             AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
-                //                            appDelegate.order_code = order_code;
-                //
-                //                        AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-                //                        appDelegate.order_code = order_code;
                                         [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
                 
                 
@@ -1038,7 +1030,7 @@
             cvc.onCancel = ^(){
                 
                 UIViewController *vc= [RAUtils getViewController:self];
-                [RAUtils message_alert:@"Cannot create order without cursomer infomation." title:@"New Order Error." controller:vc];
+                [RAUtils message_alert:@"Cannot create order without cursomer infomation." title:@"New Order" controller:vc];
                 
             };
             cvc.onReset = ^(){

+ 164 - 29
RedAnt ERP Mobile/common/Functions/modelDetail/DetailViewController.m

@@ -125,7 +125,7 @@ dispatch_async(dispatch_get_main_queue(), ^{
                 
                 NSString* model_name = self.detail_data[@"img_section"][@"model_name"];
                 
-                 NSString* img_url = self.detail_data[@"img_section"][@"model_img"];
+                 NSString* img_url = self.detail_data[@"img_section"][@"model_s_img"];
                 
                 
                 NSMutableDictionary* item = [[NSMutableDictionary alloc]init];
@@ -134,25 +134,28 @@ dispatch_async(dispatch_get_main_queue(), ^{
                 [item setValue:model_name forKey:@"fash_name"];
                 [item setValue:img_url forKey:@"picture_path"];
                 
+                [RAUtils add_recent_model:item];
                 
-                AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-                int count=[appDelegate.recent_model[@"count"] intValue];
-                bool bexist = false;
-                for(int i=0;i<count;i++)
-                {
-                    NSMutableDictionary * mitem= appDelegate.recent_model[[NSString stringWithFormat:@"item_%d",i]];
-                    if([mitem[@"product_id"] isEqualToString:self.product_id])
-                    {
-                        bexist=true;
-                        break;
-                    }
-                }
                 
-                if(!bexist)
-                {
-                [appDelegate.recent_model setObject:item forKey:[NSString stringWithFormat:@"item_%d",count]];
-                appDelegate.recent_model[@"count"]=[NSString stringWithFormat:@"%d",count+1];
-                }
+                
+//                AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+//                int count=[appDelegate.recent_model[@"count"] intValue];
+//                bool bexist = false;
+//                for(int i=0;i<count;i++)
+//                {
+//                    NSMutableDictionary * mitem= appDelegate.recent_model[[NSString stringWithFormat:@"item_%d",i]];
+//                    if([mitem[@"product_id"] isEqualToString:self.product_id])
+//                    {
+//                        bexist=true;
+//                        break;
+//                    }
+//                }
+//                
+//                if(!bexist)
+//                {
+//                [appDelegate.recent_model setObject:item forKey:[NSString stringWithFormat:@"item_%d",count]];
+//                appDelegate.recent_model[@"count"]=[NSString stringWithFormat:@"%d",count+1];
+//                }
 
             }
             else
@@ -468,14 +471,31 @@ self.isrefreshing=false;
 #pragma mark - Topic cell delegate
 -(void) TopicItemClicked:(NSString*) product_id category:(NSString*) category
 {
-    DetailViewController* dvc = [self.storyboard instantiateViewControllerWithIdentifier:@"DetailViewController" ];
-    //            dvc
-    
-    dvc.product_id=product_id;
-    dvc.category_id=category;
-    dvc.ispush=true;
-    [dvc reload];
-    [self.navigationController pushViewController:dvc animated:true];
+//    DetailViewController* dvc = [self.storyboard instantiateViewControllerWithIdentifier:@"DetailViewController" ];
+//    //            dvc
+//    
+//    
+//    dvc.OnBack=^(bool add_cart,bool add_wish,bool update_data)
+//    {
+//        
+//        
+//    [self reload_container_getdata:false]
+//    };
+//    
+//    
+//    dvc.product_id=product_id;
+//    dvc.category_id=category;
+//    dvc.ispush=true;
+//    [dvc reload];
+//    [self.navigationController pushViewController:dvc animated:true];
+    
+    
+    
+   // self.model_name = value;
+    self.product_id = product_id;
+    self.category_id=category;
+    [self reload];
+    NSLog(@"color selected");
 }
 
 #pragma mark - Table view data source
@@ -556,6 +576,27 @@ self.isrefreshing=false;
     titlelabel.backgroundColor = [UIColor clearColor];
     titlelabel.text=sectionTitle;
     [titlelabel sizeToFit];
+    
+    
+    
+    NSDictionary* section_json = [self.detail_data objectForKey:[NSString stringWithFormat:@"detail_%ld",(long)(section-1)]];
+    bool refresh= [[section_json valueForKey:@"partial_refresh"] boolValue] ;
+    
+    
+    if(refresh)
+    {
+    NSString* btntitle=@"Refresh" ;
+
+    
+    
+    UIButton * btn =[[UIButton alloc] initWithFrame:CGRectMake(tableView.bounds.size.width-100-15, 0, 100, 33)];
+        btn.contentHorizontalAlignment=UIControlContentHorizontalAlignmentRight;
+    btn.tag=section;
+    [btn addTarget:self action:@selector(RefreshSction:) forControlEvents:UIControlEventTouchUpInside];
+    [btn setTitle:btntitle forState:UIControlStateNormal];
+    [myView addSubview:btn];
+    }
+    
     [myView addSubview:titlelabel];
 
     
@@ -1193,7 +1234,7 @@ self.isrefreshing=false;
         
         
         
-        NSDictionary* section_json = [self.detail_data objectForKey:[NSString stringWithFormat:@"detail_%ld",(long)indexPath.section-1]];
+        NSDictionary* section_json  = [self.detail_data objectForKey:[NSString stringWithFormat:@"detail_%ld",(long)indexPath.section-1]];
         
         NSDictionary* item_json =[section_json objectForKey:[NSString stringWithFormat:@"item_%ld",(long)indexPath.row ]];
         
@@ -1363,7 +1404,23 @@ self.isrefreshing=false;
 
                 NSString *CellIdentifier = @"DetailTopicCell";
     
-    
+            NSString* data=[section_json valueForKey:@"data"] ;
+            if([data isEqualToString:@"local"])
+            {
+                [appDelegate.recent_model addEntriesFromDictionary:section_json];
+                
+                // NSDictionary* section_json = [self.detail_data objectForKey:@"related_model"];
+                DetailTopicCell * cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
+                cell.itemdelegate = self;
+                cell.related_data = appDelegate.recent_model;
+                [cell.topicCollectionView reloadData];
+                
+                cell.backgroundColor = [UIColor whiteColor];
+                return cell;
+                
+            }
+            else
+            {
     
                 // NSDictionary* section_json = [self.detail_data objectForKey:@"related_model"];
                 DetailTopicCell * cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
@@ -1373,7 +1430,7 @@ self.isrefreshing=false;
             
             cell.backgroundColor = [UIColor whiteColor];
                 return cell;
-                
+            }
             
         }
         return nil;
@@ -1464,6 +1521,84 @@ self.isrefreshing=false;
 //        shakeAnimation.autoreverses = YES;
 //        [_btn.layer addAnimation:shakeAnimation forKey:nil];
     }
+}
+#pragma mark - hide section button clicked
+- (void)RefreshSction:(UIButton *)sender {
+    
+    
+    
+    NSDictionary* section_json = nil;
+    
+    
+    NSDictionary* related_json = [self.detail_data objectForKey:@"related_model"];
+    if(related_json==nil)
+    {
+        
+         section_json = [self.detail_data objectForKey:[NSString stringWithFormat:@"detail_%ld",(long)(sender.tag-1)]];
+       
+    }
+    else
+    {
+        if(sender.tag==1)
+        {
+            section_json = related_json ;
+        }
+        else
+        {
+            section_json = [self.detail_data objectForKey:[NSString stringWithFormat:@"detail_%ld",(long)sender.tag-2]];
+        }
+    }
+    
+    
+
+    NSString* url = section_json[@"data_interface"];
+    NSMutableDictionary* params = [section_json[@"params"] mutableCopy];
+    
+    
+    if(params==nil)
+        params = [[NSMutableDictionary alloc] init];
+    
+    
+    
+    UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait..."title:@"Refreshing"];
+    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+        
+        NSDictionary* editor_json = [iSalesNetwork commoneditor_partialrefresh:params url:url];
+        
+        dispatch_async(dispatch_get_main_queue(), ^{
+            
+            [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
+            
+            
+            if([[editor_json valueForKey:@"result"] intValue]==2)
+            {
+                
+                [self.detail_data addEntriesFromDictionary:editor_json];
+                
+                    NSRange range = NSMakeRange(sender.tag, 1);
+                    NSIndexSet *sectionToReload = [NSIndexSet indexSetWithIndexesInRange:range];
+                    [self.detailTable reloadSections:sectionToReload withRowAnimation:UITableViewRowAnimationAutomatic];
+                
+            }
+            else
+            {
+                [RAUtils message_alert:[editor_json valueForKey:@"err_msg"] title:nil controller:self] ;
+            }
+            
+            
+        });
+    });
+
+    
+    
+    
+//    self.showMore=!self.showMore;
+//    NSRange range = NSMakeRange(1, 1);
+//    NSIndexSet *sectionToReload = [NSIndexSet indexSetWithIndexesInRange:range];
+//    [self.detailTable reloadSections:sectionToReload withRowAnimation:UITableViewRowAnimationAutomatic];
+    
+    
+    
 }
 #pragma mark - Support scanner
 -(void) onDecodedData:(NSString*) value

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

@@ -150,8 +150,39 @@
     
 }
 - (void)onCloseClick:(UIButton *)sender {
-    UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Choose your action", nil) message:NSLocalizedString(@"", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Switch to cart", nil),@"Switch to order history",NSLocalizedString(@"Close and release order", nil), nil];
     
+     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+    
+    
+    
+//    
+//    NSRange range = [tempStr rangeOfString:@")\">"];//判断字符串是否包含
+//    
+//    //if (range.location ==NSNotFound)//不包含
+//    if (range.length >0)//包含
+//    {
+//        
+//        
+//        
+//    }
+//    else//不包含
+//    {
+//        
+//    }
+
+    UIAlertView * alert = nil;
+    if(appDelegate.order_status==0)
+    {
+        alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Choose your action", nil) message:NSLocalizedString(@"", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Switch to cart", nil),@"Switch to order history",NSLocalizedString(@"Close and cancel order", nil), nil];
+        
+    }
+    else
+    {
+        alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Choose your action", nil) message:NSLocalizedString(@"", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Switch to cart", nil),@"Switch to order history",NSLocalizedString(@"Close and release order", nil), nil];
+        
+    }
+    
+
     
     alert.tag = CLOSE_ACTION;
     // alert.
@@ -174,131 +205,136 @@
     // add params check here.
     [self.lastedit endEditing:true];
     [self.lasttextview endEditing:true];
-    self.cancommit=true;
-    NSMutableDictionary* upparams=[[NSMutableDictionary alloc] init];
-    [upparams setValue:[self.params valueForKey:@"cart2Checkbox"] forKey:@"cart2Checkbox"];
-    int section_count=[[self.content_data_download valueForKey:@"section_count"] intValue];
-    for(int i=0;i<section_count;i++)
-    {
-        NSMutableDictionary * sectionjson = [[self.content_data_download objectForKey:[NSString stringWithFormat:@"section_%d",i ]] mutableCopy];
-        int item_count = [[sectionjson valueForKey:@"count"] intValue];
-        for(int j=0;j<item_count;j++)
-        {
-            NSMutableDictionary * itemjson=[[sectionjson objectForKey:[NSString stringWithFormat:@"item_%d",j ]] mutableCopy];
-            NSString* key = [itemjson valueForKey:@"name"];
-            if(key==nil || key.length==0)
-                continue;
-            if([[itemjson valueForKey:@"control"] isEqualToString:@"enum"])
-            {
-                NSString* single_select = [itemjson valueForKey:@"single_select"];
-                if([single_select isEqualToString:@"true"])
-                {
-                    NSDictionary* cadejson=[itemjson objectForKey:@"cadedate"];
-                    int count = [[cadejson valueForKey:@"count"] intValue];
-                    bool setvalue = false;
-                    for(int cc=0;cc<count;cc++)
-                    {
-                        NSDictionary* valjson=[cadejson objectForKey:[NSString stringWithFormat:@"val_%d",cc]];
-                        if([[valjson valueForKey:@"check"]intValue]==1)
-                        {
-                            [upparams setValue:[valjson valueForKey:@"value_id"] forKey:[itemjson valueForKey:@"name"]];
-                            setvalue=true;
-                            break;
-                        }
-                    }
-                    if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] && setvalue==false)
-                    {
-                        self.cancommit = false;
-                    }
-                }
-                else
-                {
-                    //not support multi select for now;
-                }
-                /*
-                 upparams setValue:itemjson forKey:<#(NSString *)#>
-                 
-                 */
-            }else
-                if([[itemjson valueForKey:@"control"] isEqualToString:@"action"])
-                {
-                    if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] && [itemjson objectForKeyedSubscript:@"data"]==nil)
-                        self.cancommit = false;
-                }
-                else if([[itemjson valueForKey:@"control"] isEqualToString:@"signature"])
-                {
-                    if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] && [itemjson objectForKeyedSubscript:@"value"]==nil)
-                        self.cancommit = false;
-                    
-                    NSString* valuestr = [itemjson valueForKey:@"value"];
-                    [upparams setValue:valuestr forKey:[itemjson valueForKey:@"name"]];
-                }
-                else if([[itemjson valueForKey:@"control"] isEqualToString:@"switch"])
-                {
-                    NSString* valuestr = [itemjson valueForKey:@"value"];
-                    [upparams setValue:valuestr forKey:[itemjson valueForKey:@"name"]];
-                    
-                    NSString* value = [itemjson valueForKey:@"value"];
-                    NSMutableDictionary* boolitem=nil;
-                    NSMutableDictionary* subjson=nil;
-                    if([value isEqualToString:@"true"])
-                    {
-                        boolitem =[[itemjson objectForKey:@"true"] mutableCopy];
-                        
-                    }
-                    else
-                    {
-                        boolitem =[[itemjson objectForKey:@"false"] mutableCopy];
-                        
-                    }
-                    subjson=[[boolitem objectForKey:@"sub_item"] mutableCopy];
-                    if( subjson!=nil /*&& !active*/)
-                    {
-                        int sub_count = [[subjson valueForKey:@"count"] intValue];
-                        for(int l=0;l<sub_count;l++)
-                        {
-                            NSMutableDictionary * modify_item=[[subjson objectForKey:[NSString stringWithFormat:@"item_%d",l ]] mutableCopy];
-                            
-                            
-                            
-                            
-                            if([modify_item valueForKey:@"value"]!=nil && ![[modify_item valueForKey:@"value"]isEqualToString:@""])
-                                [upparams setValue:[modify_item valueForKey:@"value"] forKey:[modify_item valueForKey:@"name"]];
-                            else
-                            {
-                                if([[modify_item valueForKey:@"required"] isEqualToString: @"true"] )
-                                    self.cancommit = false;
-                            }
-                        }
-                        
-                        
-                        
-                    }
-                }
-                else
-                {
-                    if([itemjson valueForKey:@"value"]!=nil && ![[itemjson valueForKey:@"value"]isEqualToString:@""])
-                        [upparams setValue:[itemjson valueForKey:@"value"] forKey:[itemjson valueForKey:@"name"]];
-                    else
-                    {
-                        if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] )
-                            self.cancommit = false;
-                    }
-                }
-            upparams= [self subitem_param:itemjson addto:upparams ];
-        }
-    }
-    // save order 不检查必填项;
-    self.cancommit=true;
-    if(self.cancommit==false)
-    {
-        [RAUtils alert_view:@"Fields with * mark cannot be empty." title:@"Some Requried Fields Are Missing."];
-        self.content_data_control = [self translate_json:self.content_data_download changed:self.changed_data];
-        //NSLog(@"CONTENT translate:%@",[iSalesNetwork DataTOjsonString:self.content_data]);
-        //[self.editorTable reloadData ];
-        [self.editorTable reloadData];
-        return;
-    }
+//    self.cancommit=true;
+//    NSMutableDictionary* upparams=[[NSMutableDictionary alloc] init];
+//    [upparams setValue:[self.params valueForKey:@"cart2Checkbox"] forKey:@"cart2Checkbox"];
+//    int section_count=[[self.content_data_download valueForKey:@"section_count"] intValue];
+//    for(int i=0;i<section_count;i++)
+//    {
+//        NSMutableDictionary * sectionjson = [[self.content_data_download objectForKey:[NSString stringWithFormat:@"section_%d",i ]] mutableCopy];
+//        int item_count = [[sectionjson valueForKey:@"count"] intValue];
+//        for(int j=0;j<item_count;j++)
+//        {
+//            NSMutableDictionary * itemjson=[[sectionjson objectForKey:[NSString stringWithFormat:@"item_%d",j ]] mutableCopy];
+//            NSString* key = [itemjson valueForKey:@"name"];
+//            if(key==nil || key.length==0)
+//                continue;
+//            if([[itemjson valueForKey:@"control"] isEqualToString:@"enum"])
+//            {
+//                NSString* single_select = [itemjson valueForKey:@"single_select"];
+//                if([single_select isEqualToString:@"true"])
+//                {
+//                    NSDictionary* cadejson=[itemjson objectForKey:@"cadedate"];
+//                    int count = [[cadejson valueForKey:@"count"] intValue];
+//                    bool setvalue = false;
+//                    for(int cc=0;cc<count;cc++)
+//                    {
+//                        NSDictionary* valjson=[cadejson objectForKey:[NSString stringWithFormat:@"val_%d",cc]];
+//                        if([[valjson valueForKey:@"check"]intValue]==1)
+//                        {
+//                            [upparams setValue:[valjson valueForKey:@"value_id"] forKey:[itemjson valueForKey:@"name"]];
+//                            setvalue=true;
+//                            break;
+//                        }
+//                    }
+//                    if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] && setvalue==false)
+//                    {
+//                        self.cancommit = false;
+//                    }
+//                }
+//                else
+//                {
+//                    //not support multi select for now;
+//                }
+//                /*
+//                 upparams setValue:itemjson forKey:<#(NSString *)#>
+//                 
+//                 */
+//            }else
+//                if([[itemjson valueForKey:@"control"] isEqualToString:@"action"])
+//                {
+//                    if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] && [itemjson objectForKeyedSubscript:@"data"]==nil)
+//                        self.cancommit = false;
+//                }
+//                else if([[itemjson valueForKey:@"control"] isEqualToString:@"signature"])
+//                {
+//                    if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] && [itemjson objectForKeyedSubscript:@"value"]==nil)
+//                        self.cancommit = false;
+//                    
+//                    NSString* valuestr = [itemjson valueForKey:@"value"];
+//                    [upparams setValue:valuestr forKey:[itemjson valueForKey:@"name"]];
+//                }
+//                else if([[itemjson valueForKey:@"control"] isEqualToString:@"switch"])
+//                {
+//                    NSString* valuestr = [itemjson valueForKey:@"value"];
+//                    [upparams setValue:valuestr forKey:[itemjson valueForKey:@"name"]];
+//                    
+//                    NSString* value = [itemjson valueForKey:@"value"];
+//                    NSMutableDictionary* boolitem=nil;
+//                    NSMutableDictionary* subjson=nil;
+//                    if([value isEqualToString:@"true"])
+//                    {
+//                        boolitem =[[itemjson objectForKey:@"true"] mutableCopy];
+//                        
+//                    }
+//                    else
+//                    {
+//                        boolitem =[[itemjson objectForKey:@"false"] mutableCopy];
+//                        
+//                    }
+//                    subjson=[[boolitem objectForKey:@"sub_item"] mutableCopy];
+//                    if( subjson!=nil /*&& !active*/)
+//                    {
+//                        int sub_count = [[subjson valueForKey:@"count"] intValue];
+//                        for(int l=0;l<sub_count;l++)
+//                        {
+//                            NSMutableDictionary * modify_item=[[subjson objectForKey:[NSString stringWithFormat:@"item_%d",l ]] mutableCopy];
+//                            
+//                            
+//                            
+//                            
+//                            if([modify_item valueForKey:@"value"]!=nil && ![[modify_item valueForKey:@"value"]isEqualToString:@""])
+//                                [upparams setValue:[modify_item valueForKey:@"value"] forKey:[modify_item valueForKey:@"name"]];
+//                            else
+//                            {
+//                                if([[modify_item valueForKey:@"required"] isEqualToString: @"true"] )
+//                                    self.cancommit = false;
+//                            }
+//                        }
+//                        
+//                        
+//                        
+//                    }
+//                }
+//                else
+//                {
+//                    if([itemjson valueForKey:@"value"]!=nil && ![[itemjson valueForKey:@"value"]isEqualToString:@""])
+//                        [upparams setValue:[itemjson valueForKey:@"value"] forKey:[itemjson valueForKey:@"name"]];
+//                    else
+//                    {
+//                        if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] )
+//                            self.cancommit = false;
+//                    }
+//                }
+//            upparams= [self subitem_param:itemjson addto:upparams ];
+//        }
+//    }
+//    // save order 不检查必填项;
+//    self.cancommit=true;
+//    if(self.cancommit==false)
+//    {
+//        [RAUtils alert_view:@"Fields with * mark cannot be empty." title:@"Some Requried Fields Are Missing."];
+//        self.content_data_control = [self translate_json:self.content_data_download changed:self.changed_data];
+//        //NSLog(@"CONTENT translate:%@",[iSalesNetwork DataTOjsonString:self.content_data]);
+//        //[self.editorTable reloadData ];
+//        [self.editorTable reloadData];
+//        return;
+//    }
+    
+    NSMutableDictionary* upparams = [self check_cancommit:false];
+//    if(self.cancommit==false)
+//        return;
+    
     if([upparams[@"shipping"] isEqualToString:@"Shipping To Be Quoted"])
         upparams[@"shipping"] = nil;
     
@@ -496,130 +532,138 @@
         // add params check here.
         [self.lastedit endEditing:true];
         [self.lasttextview endEditing:true];
-        self.cancommit=true;
-        NSMutableDictionary* upparams=[[NSMutableDictionary alloc] init];
-        [upparams setValue:[self.params valueForKey:@"cart2Checkbox"] forKey:@"cart2Checkbox"];
-        int section_count=[[self.content_data_download valueForKey:@"section_count"] intValue];
-        for(int i=0;i<section_count;i++)
-        {
-            NSMutableDictionary * sectionjson = [[self.content_data_download objectForKey:[NSString stringWithFormat:@"section_%d",i ]] mutableCopy];
-            int item_count = [[sectionjson valueForKey:@"count"] intValue];
-            for(int j=0;j<item_count;j++)
-            {
-                NSMutableDictionary * itemjson=[[sectionjson objectForKey:[NSString stringWithFormat:@"item_%d",j ]] mutableCopy];
-                NSString* key = [itemjson valueForKey:@"name"];
-                if(key==nil || key.length==0)
-                    continue;
-                if([[itemjson valueForKey:@"control"] isEqualToString:@"enum"])
-                {
-                    NSString* single_select = [itemjson valueForKey:@"single_select"];
-                    if([single_select isEqualToString:@"true"])
-                    {
-                        NSDictionary* cadejson=[itemjson objectForKey:@"cadedate"];
-                        int count = [[cadejson valueForKey:@"count"] intValue];
-                        bool setvalue = false;
-                        for(int cc=0;cc<count;cc++)
-                        {
-                            NSDictionary* valjson=[cadejson objectForKey:[NSString stringWithFormat:@"val_%d",cc]];
-                            if([[valjson valueForKey:@"check"]intValue]==1)
-                            {
-                                [upparams setValue:[valjson valueForKey:@"value_id"] forKey:[itemjson valueForKey:@"name"]];
-                                setvalue=true;
-                                break;
-                            }
-                        }
-                        if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] && setvalue==false)
-                        {
-                            self.cancommit = false;
-                        }
-                    }
-                    else
-                    {
-                        //not support multi select for now;
-                    }
-                    /*
-                     upparams setValue:itemjson forKey:<#(NSString *)#>
-                     
-                     */
-                }else
-                    if([[itemjson valueForKey:@"control"] isEqualToString:@"action"])
-                    {
-                        if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] && [itemjson objectForKeyedSubscript:@"data"]==nil)
-                            self.cancommit = false;
-                    }
-                    else if([[itemjson valueForKey:@"control"] isEqualToString:@"signature"])
-                    {
-                        if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] && [itemjson objectForKeyedSubscript:@"value"] ==nil)
-                            self.cancommit = false;
-                        
-                        NSString* valuestr = [itemjson valueForKey:@"value"];
-                        [upparams setValue:valuestr forKey:[itemjson valueForKey:@"name"]];
-                    }
-                    else if([[itemjson valueForKey:@"control"] isEqualToString:@"switch"])
-                    {
-                        NSString* valuestr = [itemjson valueForKey:@"value"];
-                        [upparams setValue:valuestr forKey:[itemjson valueForKey:@"name"]];
-                        
-                        NSString* value = [itemjson valueForKey:@"value"];
-                        NSMutableDictionary* boolitem=nil;
-                        NSMutableDictionary* subjson=nil;
-                        if([value isEqualToString:@"true"])
-                        {
-                            boolitem =[[itemjson objectForKey:@"true"] mutableCopy];
-                            
-                        }
-                        else
-                        {
-                            boolitem =[[itemjson objectForKey:@"false"] mutableCopy];
-                            
-                        }
-                        subjson=[[boolitem objectForKey:@"sub_item"] mutableCopy];
-                        if( subjson!=nil /*&& !active*/)
-                        {
-                            int sub_count = [[subjson valueForKey:@"count"] intValue];
-                            for(int l=0;l<sub_count;l++)
-                            {
-                                NSMutableDictionary * modify_item=[[subjson objectForKey:[NSString stringWithFormat:@"item_%d",l ]] mutableCopy];
-                                
-                                
-                                
-                                
-                                if([modify_item valueForKey:@"value"]!=nil && ![[modify_item valueForKey:@"value"]isEqualToString:@""])
-                                    [upparams setValue:[modify_item valueForKey:@"value"] forKey:[modify_item valueForKey:@"name"]];
-                                else
-                                {
-                                    if([[modify_item valueForKey:@"required"] isEqualToString: @"true"] )
-                                        self.cancommit = false;
-                                }
-                            }
-                            
-                            
-                            
-                        }
-                    }
-                    else
-                    {
-                        if([itemjson valueForKey:@"value"]!=nil && ![[itemjson valueForKey:@"value"]isEqualToString:@""])
-                            [upparams setValue:[itemjson valueForKey:@"value"] forKey:[itemjson valueForKey:@"name"]];
-                        else
-                        {
-                            if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] )
-                                self.cancommit = false;
-                        }
-                    }
-                upparams= [self subitem_param:itemjson addto:upparams ];
-            }
-        }
+        
+        
+
+//        self.cancommit=true;
+//        NSMutableDictionary* upparams=[[NSMutableDictionary alloc] init];
+//        [upparams setValue:[self.params valueForKey:@"cart2Checkbox"] forKey:@"cart2Checkbox"];
+//        int section_count=[[self.content_data_download valueForKey:@"section_count"] intValue];
+//        for(int i=0;i<section_count;i++)
+//        {
+//            NSMutableDictionary * sectionjson = [[self.content_data_download objectForKey:[NSString stringWithFormat:@"section_%d",i ]] mutableCopy];
+//            int item_count = [[sectionjson valueForKey:@"count"] intValue];
+//            for(int j=0;j<item_count;j++)
+//            {
+//                NSMutableDictionary * itemjson=[[sectionjson objectForKey:[NSString stringWithFormat:@"item_%d",j ]] mutableCopy];
+//                NSString* key = [itemjson valueForKey:@"name"];
+//                if(key==nil || key.length==0)
+//                    continue;
+//                if([[itemjson valueForKey:@"control"] isEqualToString:@"enum"])
+//                {
+//                    NSString* single_select = [itemjson valueForKey:@"single_select"];
+//                    if([single_select isEqualToString:@"true"])
+//                    {
+//                        NSDictionary* cadejson=[itemjson objectForKey:@"cadedate"];
+//                        int count = [[cadejson valueForKey:@"count"] intValue];
+//                        bool setvalue = false;
+//                        for(int cc=0;cc<count;cc++)
+//                        {
+//                            NSDictionary* valjson=[cadejson objectForKey:[NSString stringWithFormat:@"val_%d",cc]];
+//                            if([[valjson valueForKey:@"check"]intValue]==1)
+//                            {
+//                                [upparams setValue:[valjson valueForKey:@"value_id"] forKey:[itemjson valueForKey:@"name"]];
+//                                setvalue=true;
+//                                break;
+//                            }
+//                        }
+//                        if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] && setvalue==false)
+//                        {
+//                            self.cancommit = false;
+//                        }
+//                    }
+//                    else
+//                    {
+//                        //not support multi select for now;
+//                    }
+//                    /*
+//                     upparams setValue:itemjson forKey:<#(NSString *)#>
+//                     
+//                     */
+//                }else
+//                    if([[itemjson valueForKey:@"control"] isEqualToString:@"action"])
+//                    {
+//                        if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] && [itemjson objectForKeyedSubscript:@"data"]==nil)
+//                            self.cancommit = false;
+//                    }
+//                    else if([[itemjson valueForKey:@"control"] isEqualToString:@"signature"])
+//                    {
+//                        if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] && [itemjson objectForKeyedSubscript:@"value"] ==nil)
+//                            self.cancommit = false;
+//                        
+//                        NSString* valuestr = [itemjson valueForKey:@"value"];
+//                        [upparams setValue:valuestr forKey:[itemjson valueForKey:@"name"]];
+//                    }
+//                    else if([[itemjson valueForKey:@"control"] isEqualToString:@"switch"])
+//                    {
+//                        NSString* valuestr = [itemjson valueForKey:@"value"];
+//                        [upparams setValue:valuestr forKey:[itemjson valueForKey:@"name"]];
+//                        
+//                        NSString* value = [itemjson valueForKey:@"value"];
+//                        NSMutableDictionary* boolitem=nil;
+//                        NSMutableDictionary* subjson=nil;
+//                        if([value isEqualToString:@"true"])
+//                        {
+//                            boolitem =[[itemjson objectForKey:@"true"] mutableCopy];
+//                            
+//                        }
+//                        else
+//                        {
+//                            boolitem =[[itemjson objectForKey:@"false"] mutableCopy];
+//                            
+//                        }
+//                        subjson=[[boolitem objectForKey:@"sub_item"] mutableCopy];
+//                        if( subjson!=nil /*&& !active*/)
+//                        {
+//                            int sub_count = [[subjson valueForKey:@"count"] intValue];
+//                            for(int l=0;l<sub_count;l++)
+//                            {
+//                                NSMutableDictionary * modify_item=[[subjson objectForKey:[NSString stringWithFormat:@"item_%d",l ]] mutableCopy];
+//                                
+//                                
+//                                
+//                                
+//                                if([modify_item valueForKey:@"value"]!=nil && ![[modify_item valueForKey:@"value"]isEqualToString:@""])
+//                                    [upparams setValue:[modify_item valueForKey:@"value"] forKey:[modify_item valueForKey:@"name"]];
+//                                else
+//                                {
+//                                    if([[modify_item valueForKey:@"required"] isEqualToString: @"true"] )
+//                                        self.cancommit = false;
+//                                }
+//                            }
+//                            
+//                            
+//                            
+//                        }
+//                    }
+//                    else
+//                    {
+//                        if([itemjson valueForKey:@"value"]!=nil && ![[itemjson valueForKey:@"value"]isEqualToString:@""])
+//                            [upparams setValue:[itemjson valueForKey:@"value"] forKey:[itemjson valueForKey:@"name"]];
+//                        else
+//                        {
+//                            if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] )
+//                                self.cancommit = false;
+//                        }
+//                    }
+//                upparams= [self subitem_param:itemjson addto:upparams ];
+//            }
+//        }
+//        if(self.cancommit==false)
+//        {
+//            [RAUtils alert_view:@"Fields with * mark cannot be empty." title:@"Some Requried Fields Are Missing."];
+//            self.content_data_control = [self translate_json:self.content_data_download changed:self.changed_data];
+//            //NSLog(@"CONTENT translate:%@",[iSalesNetwork DataTOjsonString:self.content_data]);
+//            //[self.editorTable reloadData ];
+//            [self.editorTable reloadData];
+//            //  [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
+//            return;
+//        }
+        
+        NSMutableDictionary* upparams = [self check_cancommit:true];
         if(self.cancommit==false)
-        {
-            [RAUtils alert_view:@"Fields with * mark cannot be empty." title:@"Some Requried Fields Are Missing."];
-            self.content_data_control = [self translate_json:self.content_data_download changed:self.changed_data];
-            //NSLog(@"CONTENT translate:%@",[iSalesNetwork DataTOjsonString:self.content_data]);
-            //[self.editorTable reloadData ];
-            [self.editorTable reloadData];
-            //  [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
             return;
-        }
+        
         if(upparams[@"shipping"]==nil)
             goto commit_order;
         if([upparams[@"shipping"] isEqualToString:@"Shipping To Be Quoted"])
@@ -661,6 +705,9 @@
                                                                 
                                                                 // debug aaa
                                                                 AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+                                                                NSString* company= appDelegate.customerInfo[@"customer_name"];
+                                                                NSString* send_to =appDelegate.customerInfo[@"customer_email"];
+                                                                
                                                                 //                                appDelegate.customerInfo = customerInfo;
                                                                 //                                appDelegate.contact_id = [customerInfo valueForKey:@"customer_cid"];
                                                                 //                                appDelegate.order_code = nil;
@@ -672,6 +719,8 @@
                                                                 [alert show];
                                                                 
                                                                 NSString* pdf_url = [editor_json valueForKey:@"pdf_url"];
+                                                                NSString* email_content =[editor_json valueForKey:@"email_content"];
+                                                                NSString* soid=[editor_json valueForKey:@"so#"];
 //                                                                if(pdf_url.length>0)
 //                                                                {
 //                                                                    
@@ -708,8 +757,8 @@
                                                                     {
                                                                         
                                                                         [alert dismissWithClickedButtonIndex:0 animated:FALSE];
-                                                                        
-                                                                        [appDelegate printPdf:pdf_url];
+                                                                        [appDelegate printPdf:pdf_url company:company send_to:send_to soid:soid content:email_content];
+                                                                      //  [appDelegate printPdf:pdf_url];
                                                                         
                                                                     }
                                                                 }
@@ -768,6 +817,7 @@
                                                             
                                                             NSString* orderCode = [editor_json valueForKey:@"orderCode"];
                                                             appDelegate.order_code = orderCode;
+                                                            appDelegate.order_status = [[editor_json valueForKey:@"orderStatus"] intValue];
                                                             [((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];
                                                             
@@ -849,6 +899,8 @@
                                     
                                     
                                     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+                                    NSString* company= appDelegate.customerInfo[@"customer_name"];
+                                    NSString* send_to =appDelegate.customerInfo[@"customer_email"];
                                     //                                appDelegate.customerInfo = customerInfo;
                                     //                                appDelegate.contact_id = [customerInfo valueForKey:@"customer_cid"];
                                     //                                appDelegate.order_code = nil;
@@ -860,6 +912,8 @@
                                     [alert show];
                                     
                                     NSString* pdf_url = [editor_json valueForKey:@"pdf_url"];
+                                    NSString* email_content =[editor_json valueForKey:@"email_content"];
+                                    NSString* soid=[editor_json valueForKey:@"so#"];
 //                                    if(pdf_url.length>0)
 //                                    {
 //                                        
@@ -899,7 +953,8 @@
                                             
                                             [alert dismissWithClickedButtonIndex:0 animated:FALSE];
                                             
-                                            [appDelegate printPdf:pdf_url];
+                                            [appDelegate printPdf:pdf_url company:company send_to:send_to soid:soid content:email_content];
+                                          
                                            
                                         }
                                         
@@ -968,6 +1023,7 @@
                                 
                                 NSString* orderCode = [editor_json valueForKey:@"orderCode"];
                                 appDelegate.order_code = orderCode;
+                                appDelegate.order_status = [[editor_json valueForKey:@"orderStatus"] intValue];
                                 [((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];
                                 

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

@@ -14,7 +14,7 @@
 @property (strong,nonatomic) NSMutableDictionary* content_data;
 @property (strong,nonatomic) NSString* orderid;
 @property (strong,nonatomic) NSString* order_code;
-
+@property int order_status;
 @property (strong,nonatomic) NSString* orderstatus;
 //@property bool isTempOrder;
 @property (strong, nonatomic) IBOutlet UIBarButtonItem *btnOpen;

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

@@ -315,14 +315,19 @@
     if(company==nil)
         company=@"";
     NSString* customer_email=    [self.content_data[@"customerInfo"] valueForKey:@"customer_email"];
-    NSMutableArray* arr_subject = [[NSMutableArray alloc]init];
-    
-    if(company.length>0)
-        [arr_subject addObject:company];
-    if(so.length>0)
-        [arr_subject addObject:so];
+//    NSMutableArray* arr_subject = [[NSMutableArray alloc]init];
     
+//    if(company.length>0)
+//        [arr_subject addObject:company];
+//    if(so.length>0)
+//        [arr_subject addObject:so];
     
+    if(company.length==0)
+        company=@"";
+    if(so.length==0)
+        so=@"";
+
+
     
     NSMutableArray* send_to = [[NSMutableArray alloc]init];
     if(customer_email.length>0)
@@ -333,7 +338,7 @@
     }
     ViewController.mail_to = send_to;
     
-    NSString* subject=[arr_subject componentsJoinedByString:@" : "];
+    NSString* subject=[NSString stringWithFormat:@"%@ -- SO# %@ from NEW PACIFIC DIRECT,INC.",company,so];//[arr_subject componentsJoinedByString:@" : "];
     
     ViewController.mail_subject = subject;
     
@@ -628,6 +633,7 @@
                     {
                         AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
                         appDelegate.order_code = self.order_code;
+                        appDelegate.order_status = self.order_status;
                         [appDelegate SetSo:[self.content_data valueForKey:@"so#"]];
                         
                         
@@ -746,9 +752,10 @@
                 //            [self.btnPDF setImage:[[UIImage imageNamed:@"download"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
                 
                 NSString* status = [self.content_data valueForKey:@"order_status"];
+                int status_code = [[self.content_data valueForKey:@"orderStatus"] intValue];
                 NSString* lock_user = [self.content_data valueForKey:@"opened_customer"];
                 AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-                if([status isEqualToString:@"Saved Order"])
+                if(status_code==1)//[status isEqualToString:@"Saved Order"])
                 {
                     //                        [self.btnOpen setImage:[[UIImage imageNamed:@"edit"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
                     //
@@ -764,7 +771,7 @@
                     //                     self.btnCommit.enabled =false;
                 }
                 else
-                    if([status isEqualToString:@"Quote Saved"])
+                    if(status_code==0)//[status isEqualToString:@"Quote Saved"])
                     {
                         //                    [self.btnOpen setImage:[[UIImage imageNamed:@"edit"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
                         //

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

@@ -471,7 +471,7 @@ dispatch_async(dispatch_get_main_queue(), ^{
                     NSString* order_code = [return_json valueForKey:@"orderCode"];
                     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
                     appDelegate.order_code = order_code;
-                    
+                    appDelegate.order_status = [[return_json valueForKey:@"orderStatus"] intValue];
                      MainViewController* main_vc=(MainViewController*)appDelegate.main_vc;
                     [main_vc reloadCart:true immediately:false];
                     [self ReloadData];
@@ -906,6 +906,7 @@ dispatch_async(dispatch_get_main_queue(), ^{
     
     
     dvc.order_code = order_code;
+    dvc.order_status =[[self.content_data[indexPath.row] valueForKey:@"orderStatus"] intValue];
 //    bool temp_order = false ;
 //    NSString* order_status=[self.content_data[indexPath.row] valueForKey:@"order_status"];
 //    if([order_status isEqualToString:@"Saved"]||[order_status isEqualToString:@"Quoted"])

+ 13 - 1
RedAnt ERP Mobile/common/Functions/portfolio/PortfolioEditQTYViewController.h

@@ -11,8 +11,20 @@
 @interface PortfolioEditQTYViewController : UIViewController<UITextFieldDelegate>
 @property int qty;
 @property (strong, nonatomic) IBOutlet UITextField *editQTY;
-@property (nonatomic , copy) void (^onSetValue)(int qty);
+@property (nonatomic , copy) void (^onSetValue)(int qty , double price, double discount);
 @property (strong, nonatomic) IBOutlet UILabel *labelQueryQTY;
 @property (strong, nonatomic) IBOutlet UIButton *buttonRefresh;
 @property (strong, nonatomic)  NSString * fashionid;
+
+
+@property  double price;
+
+@property  double discount;
+
+@property (strong, nonatomic) IBOutlet UITextField *editPrice;
+@property (strong, nonatomic) IBOutlet UITextField *editDiscount;
+@property (strong, nonatomic) IBOutlet UILabel *labelDiscount;
+@property (strong, nonatomic) IBOutlet UILabel *labelCalPrice;
+
+@property (strong, nonatomic) IBOutlet UILabel *labelNewPrice;
 @end

+ 205 - 4
RedAnt ERP Mobile/common/Functions/portfolio/PortfolioEditQTYViewController.m

@@ -8,7 +8,8 @@
 
 #import "PortfolioEditQTYViewController.h"
 #import "iSalesNetwork.h"
-#define NUMBERS @"0123456789\n"
+#define INTNUMBERS @"0123456789\n"
+#define NUMBERS @"0123456789.\n"
 @interface PortfolioEditQTYViewController ()
 
 @end
@@ -17,8 +18,28 @@
 
 - (void)viewDidLoad {
     [super viewDidLoad];
+    self.edgesForExtendedLayout = UIRectEdgeNone;
     self.editQTY.text = [NSString stringWithFormat:@"%d",self.qty];
     [self requestqty];
+    
+    
+    self.editPrice.text = [NSString stringWithFormat:@"%.2f", self.price ];
+    
+    
+    self.editDiscount.text = [NSString stringWithFormat:@"%@", [RAUtils FloatFormat:self.discount] ];
+    
+    self.labelNewPrice.text = [NSString stringWithFormat:@"%.2f",self.price* (1.0-self.discount/100)];
+    
+//    if(self.hide_discount)
+//    {
+//        self.editDiscount.hidden=true;
+//        self.labelDiscount.hidden=true;
+//        self.labelCalPrice.text = @"New price:";
+//        
+//        
+//        
+//    }
+    
     // Do any additional setup after loading the view.
 }
 - (IBAction)onRefreshClick:(id)sender {
@@ -84,6 +105,25 @@
 //    [self update_newprice];
     
     
+    if([self.editDiscount.text floatValue]>100.0)
+    {
+        //        UIAlertView * alert = [[UIAlertView alloc] initWithTitle: @"Discount error" message:@"Discount must less than 100" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
+        //
+        //
+        //        [alert show];
+        
+        [RAUtils alert_view:@"Fields with * mark cannot be empty." title:@"Some Requried Fields Are Missing."];
+        
+        self.editDiscount.text=@"0";
+        
+        return;
+    }
+    
+    
+    [self update_newprice];
+    
+    
+    
     if(self.editQTY.text.length==0)
         self.qty=0;
     else
@@ -91,7 +131,7 @@
     [self dismissViewControllerAnimated:NO
                              completion:^{
                                  if(self.onSetValue)
-                                     self.onSetValue( self.qty);
+                                     self.onSetValue( self.qty,self.price,self.discount);
                                  
                              }];
 }
@@ -118,12 +158,63 @@
 }
 -(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
     
-
+    //    int tag = textField.tag;
+    //
+    //    int len = textField.text.length;
+    //
+    //    if(textField.tag==2&&textField.text.length>=2 && string.length>0)
+    //        return false;
     
     if(textField.text.length==0 && [string isEqualToString:@"."])
         return false;
     
-      NSCharacterSet *cs;
+    //    NSLog(@"text:%@",textField.text);
+    //
+    //
+    //
+    //
+    //
+    //    UITableViewCell *cell = (UITableViewCell *) textField.superview.superview;
+    //
+    //    NSIndexPath *   indexPath = [self.editorTable indexPathForCell:cell];
+    //    //            NSLog(@"shouldchangeedit %d_%d",indexPath.section,indexPath.row);
+    //    NSDictionary* item_json =((NSMutableArray*)self.content_data_control[indexPath.section])[indexPath.row];
+    //
+    //    NSString* required = [item_json valueForKey:@"required"];
+    //
+    //    if([required isEqualToString:@"true"] && string.length==0 && (textField.text.length<=1|| textField.text==nil))
+    //    {
+    //        CALayer *layer = [cell.contentView layer];
+    //        //            layer.borderColor = [[UIColor redColor] CGColor];
+    //        //            layer.borderWidth = 1.0;
+    //
+    //        layer.shadowColor = [UIColor redColor].CGColor;
+    //        layer.shadowOffset = CGSizeMake(0, 0);
+    //        layer.shadowOpacity = 1;
+    //        layer.shadowRadius = 2.0;
+    //    }
+    //    else
+    //    {
+    //        CALayer *layer = [cell.contentView layer];
+    //        //            layer.borderColor = [[UIColor redColor] CGColor];
+    //        //            layer.borderWidth = 1.0;
+    //
+    //        layer.shadowColor = [UIColor clearColor].CGColor;
+    //        layer.shadowOffset = CGSizeMake(0, 0);
+    //        layer.shadowOpacity = 1;
+    //        layer.shadowRadius = 2.0;
+    //    }
+    //
+    //
+    //    NSString* keyboard = [item_json valueForKey:@"keyboard"];
+    //    if(![keyboard isEqualToString:@"number"])
+    //        return TRUE;
+    NSCharacterSet *cs;
+    if(textField.tag==199)
+    {
+        cs = [[NSCharacterSet characterSetWithCharactersInString:INTNUMBERS]invertedSet];
+    }
+    else
     cs = [[NSCharacterSet characterSetWithCharactersInString:NUMBERS]invertedSet];
     //
     NSString *filtered = [[string componentsSeparatedByCharactersInSet:cs]componentsJoinedByString:@""];
@@ -136,6 +227,116 @@
     return canChange;
     //    return true;
 }
+-(void) update_newprice
+{
+    self.price = [self.editPrice.text doubleValue];
+    
+    self.discount = [self.editDiscount.text doubleValue];
+    
+    
+    self.labelNewPrice.text = [NSString stringWithFormat:@"%.2f",self.price* (1.0-self.discount/100)];
+    
+}
+- (void)textFieldDidEndEditing:(UITextField *)textField
+{
+    
+    if(textField.tag==2)
+    {
+        if(textField.text.length==0)
+            textField.text=@"0";
+        
+        if([textField.text floatValue]>100.0)
+        {
+            //            UIAlertView * alert = [[UIAlertView alloc] initWithTitle: @"Discount error" message:@"Discount must less than 100" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
+            //            //        UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Error!" message:@"User&Password can not be empty!" delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) , nil];
+            //            [alert show];
+            
+            
+            
+            [RAUtils alert_view:@"Discount must less than 100." title:@"Input Error."];
+            textField.text=@"0";
+        }
+    }
+    else
+    {
+        if(textField.tag==199)
+        {
+            int i = [textField.text intValue];
+            textField.text=[NSString stringWithFormat:@"%d",i];
+        }
+        else
+        {
+        float f = [textField.text floatValue];
+        textField.text=[NSString stringWithFormat:@"%.2f",f];
+        }
+    }
+    
+    [self update_newprice];
+    
+    //    UITableViewCell *cell = (UITableViewCell *) textField.superview.superview;
+    //    NSIndexPath *   indexPath = [self.editorTable indexPathForCell:cell];
+    //
+    //
+    //    NSMutableDictionary* section_json=nil;
+    //
+    //
+    //    //    NSLog(@"endedit %d_%d",indexPath.section,indexPath.row);
+    //    NSMutableDictionary* item_json =[((NSMutableArray*)self.content_data_control[indexPath.section])[indexPath.row] mutableCopy];
+    //
+    //
+    //    [item_json setValue:@"true" forKey:@"dirty"];
+    //    [item_json setValue:textField.text forKey:@"value"];
+    //    section_json = [[self.content_data_download objectForKey:[NSString stringWithFormat:@"section_%ld",(long)indexPath.section ]] mutableCopy];
+    //    int count=0;
+    //
+    //    count=[[section_json valueForKey:@"count"] intValue];
+    //
+    //    for(int i=0;i<count;i++)
+    //    {
+    //        NSDictionary * olditem=[section_json objectForKey:[NSString stringWithFormat:@"item_%d",i ]];
+    //        if([[olditem valueForKey:@"name"] isEqualToString:[item_json valueForKey:@"name" ]])
+    //            [section_json setObject:item_json  forKey:[NSString stringWithFormat:@"item_%d",i ]];
+    //        
+    //        
+    //    }
+    //    
+    //    [self.content_data_download setObject:section_json forKey:[NSString stringWithFormat:@"section_%ld",(long)indexPath.section ]];
+}
+
+- (void)textFieldDidBeginEditing:(UITextField *)textField
+{
+    //
+    //    self.lastedit = textField;
+}
+
+
+
+//
+//#pragma mark textField delegate
+//- (BOOL)textFieldShouldReturn:(UITextField *)textField {
+//    [textField resignFirstResponder];
+//    return NO;
+//}
+//-(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
+//    
+//
+//    
+//    if(textField.text.length==0 && [string isEqualToString:@"."])
+//        return false;
+//    
+//      NSCharacterSet *cs;
+//    cs = [[NSCharacterSet characterSetWithCharactersInString:NUMBERS]invertedSet];
+//    //
+//    NSString *filtered = [[string componentsSeparatedByCharactersInSet:cs]componentsJoinedByString:@""];
+//    
+//    BOOL canChange = [string isEqualToString:filtered];
+//    //
+//    //
+//    //
+//    //
+//    return canChange;
+//    //    return true;
+//}
 
 //- (void)textFieldDidEndEditing:(UITextField *)textField
 //{

+ 116 - 95
RedAnt ERP Mobile/common/Functions/portfolio/PortfolioViewController.m

@@ -238,7 +238,19 @@
 //                AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
 //                appDelegate.order_code = order_code;
                 [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false ];
-                    [RAUtils message_alert:nil title:@" Multiple items added to Cart" controller:self] ;
+                
+                
+                NSString * msg = nil;
+                if(checked.count==1)
+                {
+                    msg=@"1 item added to Cart";
+                }
+                else
+                {
+                    msg=[NSString stringWithFormat:@"%lu items added to Cart",(unsigned long)checked.count];
+                }
+                
+                    [RAUtils message_alert:nil title:msg controller:self] ;
                     
                     //                    [self end_select];
                     
@@ -772,6 +784,8 @@
         
     }
     NSString* str_price =[NSString stringWithFormat:@"%.2f",price * (1.0-discount/100)];
+    if(price<0)
+        str_price=@"No Price";
     if(appDelegate.can_see_price&&appDelegate.price_hidden==false)
     {
         
@@ -779,7 +793,7 @@
     else
     {
         str_price=nil;
-           }
+    }
     cell.labelPrice.text = str_price;
 //    cell.labelPrice.text = price;
     //    cell.editCount.text =[NSString stringWithFormat:@"%d",count];
@@ -910,96 +924,98 @@
     }];
     deleteRowAction.backgroundColor = UIColorFromRGB(0x336699);
     
-    // 添加一个编辑按钮
+//    // 添加一个编辑按钮
+//    
+//    UITableViewRowAction *editRowAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"  Edit   "handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
+//        
+//        NSLog(@"edit click");
+//        
+//        
+//        
+//        UIViewController* parentvc=self;
+//        
+//        
+//        
+//        
+//        EditModelPriceViewController * vc =[ parentvc.storyboard instantiateViewControllerWithIdentifier:@"EditModelPriceViewController"];
+//        
+//        
+//        NSMutableDictionary * item_json = [[self.content_data objectForKey:[NSString stringWithFormat:@"item_%ld",(long)indexPath.row]] mutableCopy];
+//        
+//        
+//        
+//        vc.set_watch_list=true;
+//        vc.discount=[[item_json valueForKey:@"tear_sheet_discount"] floatValue];
+//        vc.price = [[item_json valueForKey:@"tear_sheet_price"] floatValue];
+//        vc.cart_id = [NSString stringWithFormat:@"%d",[[item_json valueForKey:@"item_id"] intValue]];
+//        //    vc.delegate = parentvc.self;
+//        //    loginvc.modalPresentationStyle = UIModalPresentationFormSheet;//有三种状态,自己看看是哪种
+//        vc.onSetValue = ^(double price,double discount){
+//            
+//
+//            UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait" title:@"Update Price"];
+//            
+//            dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+//                
+//                NSDictionary* cart_json = nil;
+//                
+//                cart_json= [iSalesNetwork portfolio_setPrice:[NSString stringWithFormat:@"%d",[[item_json valueForKey:@"item_id"] intValue]] price:price discount:discount];
+//                
+//                dispatch_async(dispatch_get_main_queue(), ^{
+//                    [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
+//                    
+//                    
+//                    if([[cart_json valueForKey:@"result"] intValue]==2)
+//                    {
+//                        [self reload_data];
+//                    }
+//                    else
+//                    {
+//                        [RAUtils message_alert:[cart_json valueForKey:@"err_msg"] title:@"Edit Price" controller:self] ;
+//                    }
+//                    
+//                    
+//                    
+//                    
+//                });
+//            });
+//            
+//            
+//            
+//           
+//        };
+//        
+//        
+//        UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:vc] ;
+//        
+//        
+//        
+//        
+//        
+//        //    [self hackModalSheetSize:CGSizeMake(450, 200) ofVC:navi];
+//        
+//        navi.modalPresentationStyle = UIModalTransitionStyleCrossDissolve;//有三种状态,自己看看是哪种
+//        [parentvc presentViewController:navi animated:YES completion:^{
+//            
+//            //        navi.view.superview.bounds = CGRectMake(0, 0, 480, 320);
+//            
+//            NSLog(@"EditModelPriceViewController present.........");
+//            
+//            //   self.btop = false;
+//            //  <#code#>
+//        }];
+//        
+//        [tableView reloadRowsAtIndexPaths:@[indexPath]withRowAnimation:UITableViewRowAnimationMiddle];
+//        
+//        
+//    }];
+//    editRowAction.backgroundColor = UIColorFromRGB(0xff9933);
+//
     
-    UITableViewRowAction *editRowAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"  Edit   "handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
-        
-        NSLog(@"edit click");
-        
-        
-        
-        UIViewController* parentvc=self;
-        
-        
-        
-        
-        EditModelPriceViewController * vc =[ parentvc.storyboard instantiateViewControllerWithIdentifier:@"EditModelPriceViewController"];
-        
-        
-        NSMutableDictionary * item_json = [[self.content_data objectForKey:[NSString stringWithFormat:@"item_%ld",(long)indexPath.row]] mutableCopy];
-        
-        
-        
-        vc.set_watch_list=true;
-        vc.discount=[[item_json valueForKey:@"tear_sheet_discount"] floatValue];
-        vc.price = [[item_json valueForKey:@"tear_sheet_price"] floatValue];
-        vc.cart_id = [NSString stringWithFormat:@"%d",[[item_json valueForKey:@"item_id"] intValue]];
-        //    vc.delegate = parentvc.self;
-        //    loginvc.modalPresentationStyle = UIModalPresentationFormSheet;//有三种状态,自己看看是哪种
-        vc.onSetValue = ^(double price,double discount){
-            
-
-            UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait" title:@"Update Price"];
-            
-            dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-                
-                NSDictionary* cart_json = nil;
-                
-                cart_json= [iSalesNetwork portfolio_setPrice:[NSString stringWithFormat:@"%d",[[item_json valueForKey:@"item_id"] intValue]] price:price discount:discount];
-                
-                dispatch_async(dispatch_get_main_queue(), ^{
-                    [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
-                    
-                    
-                    if([[cart_json valueForKey:@"result"] intValue]==2)
-                    {
-                        [self reload_data];
-                    }
-                    else
-                    {
-                        [RAUtils message_alert:[cart_json valueForKey:@"err_msg"] title:@"Edit Price" controller:self] ;
-                    }
-                    
-                    
-                    
-                    
-                });
-            });
-            
-            
-            
-           
-        };
-        
-        
-        UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:vc] ;
-        
-        
-        
-        
-        
-        //    [self hackModalSheetSize:CGSizeMake(450, 200) ofVC:navi];
-        
-        navi.modalPresentationStyle = UIModalTransitionStyleCrossDissolve;//有三种状态,自己看看是哪种
-        [parentvc presentViewController:navi animated:YES completion:^{
-            
-            //        navi.view.superview.bounds = CGRectMake(0, 0, 480, 320);
-            
-            NSLog(@"EditModelPriceViewController present.........");
-            
-            //   self.btop = false;
-            //  <#code#>
-        }];
-        
-        [tableView reloadRowsAtIndexPaths:@[indexPath]withRowAnimation:UITableViewRowAnimationMiddle];
-        
-        
-    }];
-    editRowAction.backgroundColor = UIColorFromRGB(0xff9933);
     
     // edit qty
     
-    UITableViewRowAction *EditQTYAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"Edit QTY" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
+    UITableViewRowAction *EditQTYAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"   Edit   " handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
         
         NSLog(@"edit click");
         
@@ -1018,18 +1034,23 @@
 
         vc.fashionid =        [NSString stringWithFormat:@"%d",[[item_json valueForKey:@"fashion_id"] intValue]];
         vc.qty = [[item_json valueForKey:@"available_qty"] intValue];
+        
+        vc.discount=[[item_json valueForKey:@"tear_sheet_discount"] floatValue];
+        vc.price = [[item_json valueForKey:@"tear_sheet_price"] floatValue];
+        
+        
         //    vc.delegate = parentvc.self;
         //    loginvc.modalPresentationStyle = UIModalPresentationFormSheet;//有三种状态,自己看看是哪种
-        vc.onSetValue = ^(int qty){
+        vc.onSetValue = ^(int qty,double price, double discount){
             
             
-            UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait" title:@"Update QTY"];
+            UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait" title:@"Updating Quantity"];
             
             dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
                 
                 NSDictionary* cart_json = nil;
                 
-                cart_json= [iSalesNetwork portfolio_setQTY:[NSString stringWithFormat:@"%d",[[item_json valueForKey:@"item_id"] intValue]] QTY:qty];
+                cart_json= [iSalesNetwork portfolio_setPrice:[NSString stringWithFormat:@"%d",[[item_json valueForKey:@"item_id"] intValue]] price:price discount:discount QTY:qty];
                 
                 dispatch_async(dispatch_get_main_queue(), ^{
                     [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
@@ -1081,7 +1102,7 @@
         
         
     }];
-    EditQTYAction.backgroundColor = UIColorFromRGB(0x336699);
+    EditQTYAction.backgroundColor = UIColorFromRGB(0xff9933);
     
     
     
@@ -1096,10 +1117,10 @@
         [arr addObject:deleteRowAction];
         if(appDelegate.can_set_tearsheet_price)
         {
-            [arr addObject:editRowAction];
-            
+            //[arr addObject:editRowAction];
+            [arr addObject:EditQTYAction];
         }
-        [arr addObject:EditQTYAction];
+        
         return arr;
       //  return @[deleteRowAction, editRowAction];
     }

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

@@ -84,130 +84,135 @@
     // add params check here.
     [self.lastedit endEditing:true];
     [self.lasttextview endEditing:true];
-    self.cancommit=true;
-    NSMutableDictionary* upparams=[[NSMutableDictionary alloc] init];
-    //  [upparams setValue:[self.params valueForKey:@"cart2Checkbox"] forKey:@"cart2Checkbox"];
-    int section_count=[[self.content_data_download valueForKey:@"section_count"] intValue];
-    for(int i=0;i<section_count;i++)
-    {
-        NSMutableDictionary * sectionjson = [[self.content_data_download objectForKey:[NSString stringWithFormat:@"section_%d",i ]] mutableCopy];
-        int item_count = [[sectionjson valueForKey:@"count"] intValue];
-        for(int j=0;j<item_count;j++)
-        {
-            NSMutableDictionary * itemjson=[[sectionjson objectForKey:[NSString stringWithFormat:@"item_%d",j ]] mutableCopy];
-            NSString* key = [itemjson valueForKey:@"name"];
-            if(key==nil || key.length==0)
-                continue;
-            if([[itemjson valueForKey:@"control"] isEqualToString:@"enum"])
-            {
-                NSString* single_select = [itemjson valueForKey:@"single_select"];
-                if([single_select isEqualToString:@"true"])
-                {
-                    NSDictionary* cadejson=[itemjson objectForKey:@"cadedate"];
-                    int count = [[cadejson valueForKey:@"count"] intValue];
-                    bool setvalue = false;
-                    for(int cc=0;cc<count;cc++)
-                    {
-                        NSDictionary* valjson=[cadejson objectForKey:[NSString stringWithFormat:@"val_%d",cc]];
-                        if([[valjson valueForKey:@"check"]intValue]==1)
-                        {
-                            [upparams setValue:[valjson valueForKey:@"value_id"] forKey:[itemjson valueForKey:@"name"]];
-                            setvalue=true;
-                            break;
-                        }
-                    }
-                    if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] && setvalue==false)
-                    {
-                        self.cancommit = false;
-                    }
-                }
-                else
-                {
-                    //not support multi select for now;
-                }
-                /*
-                 upparams setValue:itemjson forKey:<#(NSString *)#>
-                 
-                 */
-            }else
-                if([[itemjson valueForKey:@"control"] isEqualToString:@"action"])
-                {
-                    if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] && [itemjson objectForKeyedSubscript:@"data"]==nil)
-                        self.cancommit = false;
-                }
-                else if([[itemjson valueForKey:@"control"] isEqualToString:@"switch"])
-                {
-                    NSString* valuestr = [itemjson valueForKey:@"value"];
-                    [upparams setValue:valuestr forKey:[itemjson valueForKey:@"name"]];
-                    
-                    NSString* value = [itemjson valueForKey:@"value"];
-                    NSMutableDictionary* boolitem=nil;
-                    NSMutableDictionary* subjson=nil;
-                    if([value isEqualToString:@"true"])
-                    {
-                        boolitem =[[itemjson objectForKey:@"true"] mutableCopy];
-                        
-                    }
-                    else
-                    {
-                        boolitem =[[itemjson objectForKey:@"false"] mutableCopy];
-                        
-                    }
-                    subjson=[[boolitem objectForKey:@"sub_item"] mutableCopy];
-                    if( subjson!=nil /*&& !active*/)
-                    {
-                        int sub_count = [[subjson valueForKey:@"count"] intValue];
-                        for(int l=0;l<sub_count;l++)
-                        {
-                            NSMutableDictionary * modify_item=[[subjson objectForKey:[NSString stringWithFormat:@"item_%d",l ]] mutableCopy];
-                            
-                            
-                            
-                            
-                            if([modify_item valueForKey:@"value"]!=nil && ![[modify_item valueForKey:@"value"]isEqualToString:@""])
-                                [upparams setValue:[modify_item valueForKey:@"value"] forKey:[modify_item valueForKey:@"name"]];
-                            else
-                            {
-                                if([[modify_item valueForKey:@"required"] isEqualToString: @"true"] )
-                                    self.cancommit = false;
-                            }
-                        }
-                        
-                        
-                        
-                    }
-                }
-                else
-                {
-                    if([itemjson valueForKey:@"value"]!=nil && ![[itemjson valueForKey:@"value"]isEqualToString:@""])
-                        [upparams setValue:[itemjson valueForKey:@"value"] forKey:[itemjson valueForKey:@"name"]];
-                    else
-                    {
-                        if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] )
-                            self.cancommit = false;
-                    }
-                }
-            upparams= [self subitem_param:itemjson addto:upparams ];
-        }
-    }
+    
+
+//    self.cancommit=true;
+//    NSMutableDictionary* upparams=[[NSMutableDictionary alloc] init];
+//    //  [upparams setValue:[self.params valueForKey:@"cart2Checkbox"] forKey:@"cart2Checkbox"];
+//    int section_count=[[self.content_data_download valueForKey:@"section_count"] intValue];
+//    for(int i=0;i<section_count;i++)
+//    {
+//        NSMutableDictionary * sectionjson = [[self.content_data_download objectForKey:[NSString stringWithFormat:@"section_%d",i ]] mutableCopy];
+//        int item_count = [[sectionjson valueForKey:@"count"] intValue];
+//        for(int j=0;j<item_count;j++)
+//        {
+//            NSMutableDictionary * itemjson=[[sectionjson objectForKey:[NSString stringWithFormat:@"item_%d",j ]] mutableCopy];
+//            NSString* key = [itemjson valueForKey:@"name"];
+//            if(key==nil || key.length==0)
+//                continue;
+//            if([[itemjson valueForKey:@"control"] isEqualToString:@"enum"])
+//            {
+//                NSString* single_select = [itemjson valueForKey:@"single_select"];
+//                if([single_select isEqualToString:@"true"])
+//                {
+//                    NSDictionary* cadejson=[itemjson objectForKey:@"cadedate"];
+//                    int count = [[cadejson valueForKey:@"count"] intValue];
+//                    bool setvalue = false;
+//                    for(int cc=0;cc<count;cc++)
+//                    {
+//                        NSDictionary* valjson=[cadejson objectForKey:[NSString stringWithFormat:@"val_%d",cc]];
+//                        if([[valjson valueForKey:@"check"]intValue]==1)
+//                        {
+//                            [upparams setValue:[valjson valueForKey:@"value_id"] forKey:[itemjson valueForKey:@"name"]];
+//                            setvalue=true;
+//                            break;
+//                        }
+//                    }
+//                    if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] && setvalue==false)
+//                    {
+//                        self.cancommit = false;
+//                    }
+//                }
+//                else
+//                {
+//                    //not support multi select for now;
+//                }
+//                /*
+//                 upparams setValue:itemjson forKey:<#(NSString *)#>
+//                 
+//                 */
+//            }else
+//                if([[itemjson valueForKey:@"control"] isEqualToString:@"action"])
+//                {
+//                    if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] && [itemjson objectForKeyedSubscript:@"data"]==nil)
+//                        self.cancommit = false;
+//                }
+//                else if([[itemjson valueForKey:@"control"] isEqualToString:@"switch"])
+//                {
+//                    NSString* valuestr = [itemjson valueForKey:@"value"];
+//                    [upparams setValue:valuestr forKey:[itemjson valueForKey:@"name"]];
+//                    
+//                    NSString* value = [itemjson valueForKey:@"value"];
+//                    NSMutableDictionary* boolitem=nil;
+//                    NSMutableDictionary* subjson=nil;
+//                    if([value isEqualToString:@"true"])
+//                    {
+//                        boolitem =[[itemjson objectForKey:@"true"] mutableCopy];
+//                        
+//                    }
+//                    else
+//                    {
+//                        boolitem =[[itemjson objectForKey:@"false"] mutableCopy];
+//                        
+//                    }
+//                    subjson=[[boolitem objectForKey:@"sub_item"] mutableCopy];
+//                    if( subjson!=nil /*&& !active*/)
+//                    {
+//                        int sub_count = [[subjson valueForKey:@"count"] intValue];
+//                        for(int l=0;l<sub_count;l++)
+//                        {
+//                            NSMutableDictionary * modify_item=[[subjson objectForKey:[NSString stringWithFormat:@"item_%d",l ]] mutableCopy];
+//                            
+//                            
+//                            
+//                            
+//                            if([modify_item valueForKey:@"value"]!=nil && ![[modify_item valueForKey:@"value"]isEqualToString:@""])
+//                                [upparams setValue:[modify_item valueForKey:@"value"] forKey:[modify_item valueForKey:@"name"]];
+//                            else
+//                            {
+//                                if([[modify_item valueForKey:@"required"] isEqualToString: @"true"] )
+//                                    self.cancommit = false;
+//                            }
+//                        }
+//                        
+//                        
+//                        
+//                    }
+//                }
+//                else
+//                {
+//                    if([itemjson valueForKey:@"value"]!=nil && ![[itemjson valueForKey:@"value"]isEqualToString:@""])
+//                        [upparams setValue:[itemjson valueForKey:@"value"] forKey:[itemjson valueForKey:@"name"]];
+//                    else
+//                    {
+//                        if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] )
+//                            self.cancommit = false;
+//                    }
+//                }
+//            upparams= [self subitem_param:itemjson addto:upparams ];
+//        }
+//    }
+//    if(self.cancommit==false)
+//    {
+////        UIAlertView * alert = [[UIAlertView alloc] initWithTitle: @"Some requried field is missing" message:@"Fields with * mark cannot be empty." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
+////        //UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Error!" message:@"User&Password can not be empty!" delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) , nil];
+////        [alert show];
+//        
+//        
+//        [RAUtils alert_view:@"Fields with * mark cannot be empty." title:@"Some Requried Fields Are Missing."];
+//        self.content_data_control = [self translate_json:self.content_data_download changed:self.changed_data];
+//        //NSLog(@"CONTENT translate:%@",[iSalesNetwork DataTOjsonString:self.content_data]);
+//        //[self.editorTable reloadData ];
+//        [self.editorTable reloadData];
+//        return;
+//    }
+    NSMutableDictionary* upparams = [self check_cancommit:true];
     if(self.cancommit==false)
-    {
-//        UIAlertView * alert = [[UIAlertView alloc] initWithTitle: @"Some requried field is missing" message:@"Fields with * mark cannot be empty." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
-//        //UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Error!" message:@"User&Password can not be empty!" delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) , nil];
-//        [alert show];
-        
-        
-        [RAUtils alert_view:@"Fields with * mark cannot be empty." title:@"Some Requried Fields Are Missing."];
-        self.content_data_control = [self translate_json:self.content_data_download changed:self.changed_data];
-        //NSLog(@"CONTENT translate:%@",[iSalesNetwork DataTOjsonString:self.content_data]);
-        //[self.editorTable reloadData ];
-        [self.editorTable reloadData];
         return;
-    }
     
     NSMutableString* pdf_url = [[self.content_data_download valueForKey:@"pdf_url"] mutableCopy];
     
-    NSLog([RAUtils dict2string:self.content_data_download]);
+  //  NSLog([RAUtils dict2string:self.content_data_download]);
     
     bool bremove=false;
     
@@ -423,125 +428,131 @@
     // add params check here.
     [self.lastedit endEditing:true];
     [self.lasttextview endEditing:true];
-    self.cancommit=true;
-    NSMutableDictionary* upparams=[[NSMutableDictionary alloc] init];
-    //  [upparams setValue:[self.params valueForKey:@"cart2Checkbox"] forKey:@"cart2Checkbox"];
-    int section_count=[[self.content_data_download valueForKey:@"section_count"] intValue];
-    for(int i=0;i<section_count;i++)
-    {
-        NSMutableDictionary * sectionjson = [[self.content_data_download objectForKey:[NSString stringWithFormat:@"section_%d",i ]] mutableCopy];
-        int item_count = [[sectionjson valueForKey:@"count"] intValue];
-        for(int j=0;j<item_count;j++)
-        {
-            NSMutableDictionary * itemjson=[[sectionjson objectForKey:[NSString stringWithFormat:@"item_%d",j ]] mutableCopy];
-            NSString* key = [itemjson valueForKey:@"name"];
-            if(key==nil || key.length==0)
-                continue;
-            if([[itemjson valueForKey:@"control"] isEqualToString:@"enum"])
-            {
-                NSString* single_select = [itemjson valueForKey:@"single_select"];
-                if([single_select isEqualToString:@"true"])
-                {
-                    NSDictionary* cadejson=[itemjson objectForKey:@"cadedate"];
-                    int count = [[cadejson valueForKey:@"count"] intValue];
-                    bool setvalue = false;
-                    for(int cc=0;cc<count;cc++)
-                    {
-                        NSDictionary* valjson=[cadejson objectForKey:[NSString stringWithFormat:@"val_%d",cc]];
-                        if([[valjson valueForKey:@"check"]intValue]==1)
-                        {
-                            [upparams setValue:[valjson valueForKey:@"value_id"] forKey:[itemjson valueForKey:@"name"]];
-                            setvalue=true;
-                            break;
-                        }
-                    }
-                    if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] && setvalue==false)
-                    {
-                        self.cancommit = false;
-                    }
-                }
-                else
-                {
-                    //not support multi select for now;
-                }
-                /*
-                 upparams setValue:itemjson forKey:<#(NSString *)#>
-                 
-                 */
-            }else
-                if([[itemjson valueForKey:@"control"] isEqualToString:@"action"])
-                {
-                    if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] && [itemjson objectForKeyedSubscript:@"data"]==nil)
-                        self.cancommit = false;
-                }
-                else if([[itemjson valueForKey:@"control"] isEqualToString:@"switch"])
-                {
-                    NSString* valuestr = [itemjson valueForKey:@"value"];
-                    [upparams setValue:valuestr forKey:[itemjson valueForKey:@"name"]];
-                    
-                    NSString* value = [itemjson valueForKey:@"value"];
-                    NSMutableDictionary* boolitem=nil;
-                    NSMutableDictionary* subjson=nil;
-                    if([value isEqualToString:@"true"])
-                    {
-                        boolitem =[[itemjson objectForKey:@"true"] mutableCopy];
-                        
-                    }
-                    else
-                    {
-                        boolitem =[[itemjson objectForKey:@"false"] mutableCopy];
-                        
-                    }
-                    subjson=[[boolitem objectForKey:@"sub_item"] mutableCopy];
-                    if( subjson!=nil /*&& !active*/)
-                    {
-                        int sub_count = [[subjson valueForKey:@"count"] intValue];
-                        for(int l=0;l<sub_count;l++)
-                        {
-                            NSMutableDictionary * modify_item=[[subjson objectForKey:[NSString stringWithFormat:@"item_%d",l ]] mutableCopy];
-                            
-                            
-                            
-                            
-                            if([modify_item valueForKey:@"value"]!=nil && ![[modify_item valueForKey:@"value"]isEqualToString:@""])
-                                [upparams setValue:[modify_item valueForKey:@"value"] forKey:[modify_item valueForKey:@"name"]];
-                            else
-                            {
-                                if([[modify_item valueForKey:@"required"] isEqualToString: @"true"] )
-                                    self.cancommit = false;
-                            }
-                        }
-                        
-                        
-                        
-                    }
-                }
-                else
-                {
-                    if([itemjson valueForKey:@"value"]!=nil && ![[itemjson valueForKey:@"value"]isEqualToString:@""])
-                        [upparams setValue:[itemjson valueForKey:@"value"] forKey:[itemjson valueForKey:@"name"]];
-                    else
-                    {
-                        if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] )
-                            self.cancommit = false;
-                    }
-                }
-            upparams= [self subitem_param:itemjson addto:upparams ];
-        }
-    }
+//    self.cancommit=true;
+//    NSMutableDictionary* upparams=[[NSMutableDictionary alloc] init];
+//    //  [upparams setValue:[self.params valueForKey:@"cart2Checkbox"] forKey:@"cart2Checkbox"];
+//    int section_count=[[self.content_data_download valueForKey:@"section_count"] intValue];
+//    for(int i=0;i<section_count;i++)
+//    {
+//        NSMutableDictionary * sectionjson = [[self.content_data_download objectForKey:[NSString stringWithFormat:@"section_%d",i ]] mutableCopy];
+//        int item_count = [[sectionjson valueForKey:@"count"] intValue];
+//        for(int j=0;j<item_count;j++)
+//        {
+//            NSMutableDictionary * itemjson=[[sectionjson objectForKey:[NSString stringWithFormat:@"item_%d",j ]] mutableCopy];
+//            NSString* key = [itemjson valueForKey:@"name"];
+//            if(key==nil || key.length==0)
+//                continue;
+//            if([[itemjson valueForKey:@"control"] isEqualToString:@"enum"])
+//            {
+//                NSString* single_select = [itemjson valueForKey:@"single_select"];
+//                if([single_select isEqualToString:@"true"])
+//                {
+//                    NSDictionary* cadejson=[itemjson objectForKey:@"cadedate"];
+//                    int count = [[cadejson valueForKey:@"count"] intValue];
+//                    bool setvalue = false;
+//                    for(int cc=0;cc<count;cc++)
+//                    {
+//                        NSDictionary* valjson=[cadejson objectForKey:[NSString stringWithFormat:@"val_%d",cc]];
+//                        if([[valjson valueForKey:@"check"]intValue]==1)
+//                        {
+//                            [upparams setValue:[valjson valueForKey:@"value_id"] forKey:[itemjson valueForKey:@"name"]];
+//                            setvalue=true;
+//                            break;
+//                        }
+//                    }
+//                    if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] && setvalue==false)
+//                    {
+//                        self.cancommit = false;
+//                    }
+//                }
+//                else
+//                {
+//                    //not support multi select for now;
+//                }
+//                /*
+//                 upparams setValue:itemjson forKey:<#(NSString *)#>
+//                 
+//                 */
+//            }else
+//                if([[itemjson valueForKey:@"control"] isEqualToString:@"action"])
+//                {
+//                    if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] && [itemjson objectForKeyedSubscript:@"data"]==nil)
+//                        self.cancommit = false;
+//                }
+//                else if([[itemjson valueForKey:@"control"] isEqualToString:@"switch"])
+//                {
+//                    NSString* valuestr = [itemjson valueForKey:@"value"];
+//                    [upparams setValue:valuestr forKey:[itemjson valueForKey:@"name"]];
+//                    
+//                    NSString* value = [itemjson valueForKey:@"value"];
+//                    NSMutableDictionary* boolitem=nil;
+//                    NSMutableDictionary* subjson=nil;
+//                    if([value isEqualToString:@"true"])
+//                    {
+//                        boolitem =[[itemjson objectForKey:@"true"] mutableCopy];
+//                        
+//                    }
+//                    else
+//                    {
+//                        boolitem =[[itemjson objectForKey:@"false"] mutableCopy];
+//                        
+//                    }
+//                    subjson=[[boolitem objectForKey:@"sub_item"] mutableCopy];
+//                    if( subjson!=nil /*&& !active*/)
+//                    {
+//                        int sub_count = [[subjson valueForKey:@"count"] intValue];
+//                        for(int l=0;l<sub_count;l++)
+//                        {
+//                            NSMutableDictionary * modify_item=[[subjson objectForKey:[NSString stringWithFormat:@"item_%d",l ]] mutableCopy];
+//                            
+//                            
+//                            
+//                            
+//                            if([modify_item valueForKey:@"value"]!=nil && ![[modify_item valueForKey:@"value"]isEqualToString:@""])
+//                                [upparams setValue:[modify_item valueForKey:@"value"] forKey:[modify_item valueForKey:@"name"]];
+//                            else
+//                            {
+//                                if([[modify_item valueForKey:@"required"] isEqualToString: @"true"] )
+//                                    self.cancommit = false;
+//                            }
+//                        }
+//                        
+//                        
+//                        
+//                    }
+//                }
+//                else
+//                {
+//                    if([itemjson valueForKey:@"value"]!=nil && ![[itemjson valueForKey:@"value"]isEqualToString:@""])
+//                        [upparams setValue:[itemjson valueForKey:@"value"] forKey:[itemjson valueForKey:@"name"]];
+//                    else
+//                    {
+//                        if([[itemjson valueForKey:@"required"] isEqualToString: @"true"] )
+//                            self.cancommit = false;
+//                    }
+//                }
+//            upparams= [self subitem_param:itemjson addto:upparams ];
+//        }
+//    }
+//    if(self.cancommit==false)
+//    {
+////        UIAlertView * alert = [[UIAlertView alloc] initWithTitle: @"Some requried field is missing" message:@"Fields with * mark can not be empty." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
+////        //UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Error!" message:@"User&Password can not be empty!" delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) , nil];
+////        [alert show];
+//        
+//        [RAUtils alert_view:@"Fields with * mark cannot be empty." title:@"Some Requried Fields Are Missing."];
+//        self.content_data_control = [self translate_json:self.content_data_download changed:self.changed_data];
+//        //NSLog(@"CONTENT translate:%@",[iSalesNetwork DataTOjsonString:self.content_data]);
+//        //[self.editorTable reloadData ];
+//        [self.editorTable reloadData];
+//        return;
+//    }
+    
+    
+    
+    NSMutableDictionary* upparams = [self check_cancommit:true];
     if(self.cancommit==false)
-    {
-//        UIAlertView * alert = [[UIAlertView alloc] initWithTitle: @"Some requried field is missing" message:@"Fields with * mark can not be empty." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
-//        //UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Error!" message:@"User&Password can not be empty!" delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) , nil];
-//        [alert show];
-        
-        [RAUtils alert_view:@"Fields with * mark cannot be empty." title:@"Some Requried Fields Are Missing."];
-        self.content_data_control = [self translate_json:self.content_data_download changed:self.changed_data];
-        //NSLog(@"CONTENT translate:%@",[iSalesNetwork DataTOjsonString:self.content_data]);
-        //[self.editorTable reloadData ];
-        [self.editorTable reloadData];
         return;
-    }
     
     NSMutableString* pdf_url = [[self.content_data_download valueForKey:@"pdf_url"] mutableCopy];
     

+ 0 - 120
RedAnt ERP Mobile/common/Functions/search+itemsearch/ItemSearchFilterViewController.m

@@ -438,126 +438,6 @@
     
     [self.buttonAlert setTitle:alert forState:UIControlStateNormal];
     
-//    UITableViewCell *cell = [self.editorTable cellForRowAtIndexPath:indexPath];
-//
-//
-//    //    if(/*self.cancommit==false &&*/ string.length==0 && (textField.text.length<=1|| textField.text==nil))
-//    //    {
-//    //        CALayer *layer = [cell.contentView layer];
-//    //        //            layer.borderColor = [[UIColor redColor] CGColor];
-//    //        //            layer.borderWidth = 1.0;
-//    //
-//    //        layer.shadowColor = [UIColor redColor].CGColor;
-//    //        layer.shadowOffset = CGSizeMake(0, 0);
-//    //        layer.shadowOpacity = 1;
-//    //        layer.shadowRadius = 2.0;
-//    //    }
-//    //    else
-//    {
-//        CALayer *layer = [cell.contentView layer];
-//        //            layer.borderColor = [[UIColor redColor] CGColor];
-//        //            layer.borderWidth = 1.0;
-//        
-//        layer.shadowColor = [UIColor clearColor].CGColor;
-//        layer.shadowOffset = CGSizeMake(0, 0);
-//        layer.shadowOpacity = 1;
-//        layer.shadowRadius = 2.0;
-//    }
-//    
-//    NSLog(@"enum changed %ld_%ld",(long)indexPath.section,(long)indexPath.row);
-//    
-//    NSMutableDictionary* section_json=nil;
-//    
-//    NSMutableDictionary* item_json =[((NSMutableArray*)self.content_data_control[indexPath.section])[indexPath.row] mutableCopy];
-//    
-//    
-//    //    NSString* param_name=[item_json valueForKey:@"name"];
-//    //    NSString* param_val=nil;
-//    //
-//    //    bool single_select =[[item_json valueForKey:@"single_select"] boolValue];
-//    //
-//    //    int cade_count = [[value valueForKey:@"count"] intValue];
-//    //
-//    //    NSMutableArray* arr_val = [[NSMutableArray alloc] init];
-//    //
-//    //
-//    //    for(int cc=0;cc<cade_count;cc++)
-//    //    {
-//    //        NSDictionary * valjson=[value objectForKey:[NSString stringWithFormat:@"val_%d",cc ]];
-//    //        if([[valjson valueForKey:@"check"] boolValue])
-//    //        {
-//    //            [arr_val addObject: [valjson valueForKey:@"value_id"]];
-//    //            if(single_select)
-//    //                break;
-//    //        }
-//    //
-//    //    }
-//    //
-//    //    param_val = [arr_val componentsJoinedByString:@","];
-//    //
-//    //    [self.changed_data setObject:param_val forKey:param_name];
-//    
-//    int refresh = [[item_json valueForKey:@"refresh"] intValue];
-//    
-//    
-//    NSString* subid=[item_json valueForKey:@"subid"];
-//    
-//    [item_json setObject:value forKey:@"cadedate"];
-//    
-//    
-//    if(subid==nil)
-//    {
-//        [item_json setValue:@"true" forKey:@"dirty"];
-//        section_json = [[self.content_data_download objectForKey:[NSString stringWithFormat:@"section_%ld",(long)indexPath.section ]] mutableCopy];
-//        int count=0;
-//        
-//        count=[[section_json valueForKey:@"count"] intValue];
-//        
-//        for(int i=0;i<count;i++)
-//        {
-//            NSDictionary * olditem=[section_json objectForKey:[NSString stringWithFormat:@"item_%d",i ]];
-//            if([[olditem valueForKey:@"name"] isEqualToString:[item_json valueForKey:@"name" ]])
-//                [section_json setObject:item_json  forKey:[NSString stringWithFormat:@"item_%d",i ]];
-//            
-//            
-//        }
-//    }
-//    else
-//    {
-//        NSArray* idarr=[subid componentsSeparatedByString:@"_"];
-//        int section = [(NSString*)idarr[0] intValue];
-//        int item=[(NSString*)idarr[1] intValue];
-//        
-//        
-//        section_json = [[self.content_data_download objectForKey:[NSString stringWithFormat:@"section_%d", section]] mutableCopy];
-//        NSDictionary * olditem=[section_json objectForKey:[NSString stringWithFormat:@"item_%d",item ]];
-//        item_json= [self enum_subitem_changed:[olditem mutableCopy] subid:idarr value:item_json step:2];
-//        [item_json setValue:@"true" forKey:@"dirty"];
-//        [section_json setObject:item_json  forKey:[NSString stringWithFormat:@"item_%d",item ]];
-//        
-//    }
-//    
-//    
-//    //    [section_json setObject:item_json forKey:[NSString stringWithFormat:@"item_%ld",(long)indexPath.row ]];
-//    
-//    [self.content_data_download setObject:section_json forKey:[NSString stringWithFormat:@"section_%ld",(long)indexPath.section ]];
-//    
-//    self.content_data_control = [self translate_json:self.content_data_download changed:self.changed_data];
-//    
-//    
-//    if(refresh==1)
-//    {
-//        [self refresh] ;
-//        return ;
-//    }
-//    
-//    
-//    NSLog(@"CONTENT UPDATE:%@",[iSalesNetwork DataTOjsonString:self.content_data_download]);
-//    
-//    
-//    
-//    //    NSLog(@"CONTENT translate:%@",[iSalesNetwork DataTOjsonString:self.content_data]);
-//    [self.editorTable reloadData ];
     
 }
 @end

+ 1 - 1
RedAnt ERP Mobile/common/Functions/search+itemsearch/ItemSearchViewController.h

@@ -14,7 +14,7 @@
 @property (strong, nonatomic) IBOutlet UICollectionView *collectionview;
 @property (strong, nonatomic) IBOutlet UISearchBar *searchBar;
 @property long offset;
-
+@property bool loadall;
 @property int categoryViewType;
 
 @property (strong, nonatomic) IBOutlet UIView *headerView;

+ 72 - 7
RedAnt ERP Mobile/common/Functions/search+itemsearch/ItemSearchViewController.m

@@ -141,9 +141,15 @@
     //   int tag =self.selectallBtn.tag;
     
     
+    if(self.category_data==nil)
+        return;
+    
     
     NSMutableDictionary* items =[[self.category_data objectForKey:@"items"] mutableCopy];
     
+    
+    if(items==nil)
+        return;
     int count = [[items valueForKey:@"count"] intValue];
     
     NSString* checked;
@@ -369,15 +375,29 @@
     // Dispose of any resources that can be recreated.
 }
 
-
+#pragma mark get data
 -(void) loadMore
 {
-    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+    dispatch_async(dispatch_get_main_queue(), ^{
+        if(self.loadall)
+        {
+            [RAUtils message_alert:@"All loaded" title:@"Loading Category" controller:self] ;
+            return;
+            
+        }
+        
+        self.mum.hidden = false;
+        [self.mum startAnimating];
+        self.mum.center = self.view.center;
+        
         self.isrefreshing=true;
+    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+        
+    
         NSDictionary* category_more=[iSalesNetwork ItemSearch:self.offset limit:20 covertype:self.covertype ctgid:self.ctgid modelname:self.modelname modeldescrip:self.modeldescrip alert:self.alert available:self.available
                                      ];
         dispatch_async(dispatch_get_main_queue(), ^{
-            
+            [self.mum stopAnimating];
             
             NSDictionary* more_items=[category_more objectForKey:@"items"];
             if([[category_more valueForKey:@"result"] intValue]==2)
@@ -398,12 +418,19 @@
                 [items_json setValue: [NSString stringWithFormat:@"%ld",newcount] forKey:@"count"];
                 [self.category_data setObject:items_json forKey:@"items"];
                 self.offset+=count;
+                
+                if(count<20)
+                {
+                    self.loadall=true;
+                    
+                }
+                
                 //            NSDictionary * item_json = [self.category_data objectForKey:@"items"];
                 
                 
                 
                 
-                NSLog(@"%@",self.category_data);
+        //        NSLog(@"%@",self.category_data);
                 
                 [self.collectionview reloadData];
                 
@@ -455,6 +482,7 @@
         //
         //        });
     });
+    });
 }
 -(void) reload
 {
@@ -466,6 +494,7 @@
          if(self.isrefreshing)
              return;
          self.isrefreshing=true;
+         self.loadall = false;
     UIRefreshControl *reF = (UIRefreshControl *)[self.collectionview viewWithTag:200];
     
     [reF endRefreshing];
@@ -939,7 +968,19 @@
 //                AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
 //                appDelegate.order_code = order_code;
                 [((MainViewController*)appDelegate.main_vc) reloadWish:true immediately:false];
-                    [RAUtils message_alert:nil title:@" Multiple items added to Cart" controller:self] ;
+                
+                NSString * msg = nil;
+                if(checked.count==1)
+                {
+                    msg=@"1 item added to Cart";
+                }
+                else
+                {
+                    msg=[NSString stringWithFormat:@"%lu items added to Cart",(unsigned long)checked.count];
+                }
+                
+                
+                    [RAUtils message_alert:nil title:msg controller:self] ;
                     
                 [self end_select:2];
                 
@@ -1010,7 +1051,19 @@
                 
                 [((MainViewController*)appDelegate.main_vc) reloadPortfolio:true immediately:false];
                 
-                    [RAUtils message_alert:nil title:@" Multiple items added to Portfolio" controller:self] ;
+                
+                
+                NSString * msg = nil;
+                if(checked.count==1)
+                {
+                    msg=@"1 item added to Portfolio";
+                }
+                else
+                {
+                    msg=[NSString stringWithFormat:@"%lu items added to Portfolio",(unsigned long)checked.count];
+                }
+                
+                    [RAUtils message_alert:nil title:msg controller:self] ;
                     
                     
                 [self end_select:3];
@@ -1072,7 +1125,19 @@
                 AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
                 
                 [((MainViewController*)appDelegate.main_vc) reloadWish:true immediately:false];
-                    [RAUtils message_alert:nil title:@" Multiple items added to \nWish List" controller:self] ;
+                
+                
+                NSString * msg = nil;
+                if(checked.count==1)
+                {
+                    msg=@"1 item added to \nWish List";
+                }
+                else
+                {
+                    msg=[NSString stringWithFormat:@"%lu items added to \nWish List",(unsigned long)checked.count];
+                }
+                
+                    [RAUtils message_alert:nil title:msg controller:self] ;
                     
                     
                 [self end_select:1];

+ 1 - 1
RedAnt ERP Mobile/common/Functions/search+itemsearch/SearchViewController.h

@@ -13,7 +13,7 @@
 @property (strong, nonatomic) IBOutlet UICollectionView *collectionview;
 @property (strong, nonatomic) IBOutlet UISearchBar *searchBar;
 @property long offset;
-
+@property bool loadall;
 @property int categoryViewType;
 
 @property (strong, nonatomic) IBOutlet UIView *headerView;

+ 73 - 16
RedAnt ERP Mobile/common/Functions/search+itemsearch/SearchViewController.m

@@ -263,11 +263,15 @@
 - (IBAction)onSelectAllClick:(id)sender {
     
  //   int tag =self.selectallBtn.tag;
-    
+    if(self.category_data==nil)
+        return;
  
     
     NSMutableDictionary* items =[[self.category_data objectForKey:@"items"] mutableCopy];
     
+    
+    if(items==nil)
+        return;
     int count = [[items valueForKey:@"count"] intValue];
     
     NSString* checked;
@@ -659,7 +663,7 @@
                     NSString* order_code = [return_json valueForKey:@"orderCode"];
                     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
                     appDelegate.order_code = order_code;
-                    
+                    appDelegate.order_status = [[return_json valueForKey:@"orderStatus"] intValue];
                     
                     [self addtocart];
                     
@@ -839,18 +843,22 @@
             
             if([[return_json valueForKey:@"result"] intValue]==2)
             {
-//                int result=[[return_json valueForKey:@"result"] intValue];
-//                if(result==2)
-//                {
-//                    //successed.
-                
-         //           NSString* order_code = [return_json valueForKey:@"order_code"];
+
                     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-//                    appDelegate.order_code = order_code;
-//                AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-//                appDelegate.order_code = order_code;
                 [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
-                    [RAUtils message_alert:nil title:@" Multiple items added to Cart" controller:self] ;
+                
+                
+                NSString * msg = nil;
+                if(checked.count==1)
+                {
+                    msg=@"1 item added to Cart";
+                }
+                else
+                {
+                    msg=[NSString stringWithFormat:@"%lu items added to Cart",(unsigned long)checked.count];
+                }
+                
+                    [RAUtils message_alert:nil title:msg controller:self] ;
                     
                 [self end_select:2];
                 
@@ -922,7 +930,19 @@
 
                 [((MainViewController*)appDelegate.main_vc) reloadPortfolio :true immediately:false];
                 
-                    [RAUtils message_alert:nil title:@" Multiple items added to Portfolio" controller:self] ;
+                
+                
+                NSString * msg = nil;
+                if(checked.count==1)
+                {
+                    msg=@"1 item added to Portfolio";
+                }
+                else
+                {
+                    msg=[NSString stringWithFormat:@"%lu items added to Portfolio",(unsigned long)checked.count];
+                }
+                
+                    [RAUtils message_alert:nil title:msg controller:self] ;
                     
                     
                 [self end_select:3];
@@ -984,6 +1004,19 @@
                     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
  
                 [((MainViewController*)appDelegate.main_vc) reloadWish:true immediately:false];
+                
+                
+                
+                NSString * msg = nil;
+                if(checked.count==1)
+                {
+                    msg=@"1 item added to \nWish List";
+                }
+                else
+                {
+                    msg=[NSString stringWithFormat:@"%lu items added to \nWish List",(unsigned long)checked.count];
+                }
+                
                     [RAUtils message_alert:nil title:@" Multiple items added to \nWish List" controller:self] ;
                     
                     
@@ -1004,11 +1037,28 @@
 
 -(void) loadMore
 {
-    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+    dispatch_async(dispatch_get_main_queue(), ^{
+        
+        if(self.loadall)
+        {
+            [RAUtils message_alert:@"All loaded" title:@"Loading Category" controller:self] ;
+            return;
+            
+        }
+        
+        self.mum.hidden = false;
+        [self.mum startAnimating];
+        self.mum.center = self.view.center;
+        
         self.isrefreshing=true;
+        
+    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+        
+
+        
         NSDictionary* category_more=[iSalesNetwork Search:self.offset limit:20 keywords:self.keywords];
         dispatch_async(dispatch_get_main_queue(), ^{
-            
+            [self.mum stopAnimating];
             
             NSDictionary* more_items=[category_more objectForKey:@"items"];
             if([[category_more valueForKey:@"result"] intValue]==2)
@@ -1029,12 +1079,17 @@
                 [items_json setValue: [NSString stringWithFormat:@"%ld",newcount] forKey:@"count"];
                 [self.category_data setObject:items_json forKey:@"items"];
                 self.offset+=count;
+                if(count<20)
+                {
+                    self.loadall=true;
+                    
+                }
                 //            NSDictionary * item_json = [self.category_data objectForKey:@"items"];
                 
                 
                 
                 
-                NSLog(@"%@",self.category_data);
+        //        NSLog(@"%@",self.category_data);
                 
                 [self.collectionview reloadData];
                 
@@ -1086,6 +1141,7 @@
 //            
 //        });
     });
+        });
 }
 -(void) reload
 {
@@ -1094,6 +1150,7 @@
         if(self.isrefreshing)
             return;
         self.isrefreshing=true;
+        self.loadall = false;
     UIRefreshControl *reF = (UIRefreshControl *)[self.collectionview viewWithTag:200];
     
     [reF endRefreshing];

+ 1 - 1
RedAnt ERP Mobile/common/Functions/sidemenu/ScannerSettingViewController.m

@@ -152,7 +152,7 @@
 -(void) alert_view :(NSString*) msg title:(NSString*) title
 {
     if(title==nil)
-        title = @"Error.";
+        title = @"Message";
     if(msg.length>0)
     {
         title=[NSString stringWithFormat:@"%@\n\n%@",title,msg];

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

@@ -266,7 +266,7 @@
                     NSString* order_code = [return_json valueForKey:@"orderCode"];
                     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
                     appDelegate.order_code = order_code;
-                    
+                    appDelegate.order_status = [[return_json valueForKey:@"orderStatus"] intValue];
                     
                     [self addtocart];
                     

+ 3 - 0
RedAnt ERP Mobile/common/RAUtils.h

@@ -42,6 +42,9 @@ typedef void (^add_to_cart_Handler)(void);
 +(NSString* )current_date;
 +(NSMutableArray*)dictionary2array:(NSDictionary*)json count_fields:(NSString*) count_fields item_mark:(NSString*) item_mark items_mark:(NSString* )items_mark;
 
+
++(void) add_recent_model:(NSDictionary*) model;
+
 +(NSArray*) string2arr:(NSString*) string separator:(NSString*)separator;
 +(void) add_to_cart:(UIViewController*) vc selectorholder:(id)holder selector:(SEL)addtocart;
 @end

+ 36 - 4
RedAnt ERP Mobile/common/RAUtils.m

@@ -149,7 +149,7 @@
 +(void) message_alert :(NSString*) msg title:(NSString*) title controller:(UIViewController*) vc
 {
     if(title==nil)
-        title = @"Error.";
+        title = @"Message";
     
     
     return [self alert_view:msg title:title];
@@ -244,7 +244,7 @@
                     NSString* order_code = [return_json valueForKey:@"orderCode"];
                     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
                     appDelegate.order_code = order_code;
-                    
+                    appDelegate.order_status = [[return_json valueForKey:@"orderStatus"] intValue];
                     
                     [holder performSelector:addtocart];
                     
@@ -928,10 +928,42 @@
 
 }
 
-+(void) alert_view :(NSString*) msg title:(NSString*) title 
+
++(void) add_recent_model:(NSDictionary*) model
+{
+    
+    NSMutableDictionary * newdict = [[NSMutableDictionary alloc]init];
+    [newdict setObject:model forKey:@"item_0"];
+    
+    
+    
+    
+    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+    int count=[appDelegate.recent_model[@"count"] intValue];
+    for(int i=0;i<count;i++)
+    {
+        NSMutableDictionary * mitem= appDelegate.recent_model[[NSString stringWithFormat:@"item_%d",i]];
+        if([mitem[@"product_id"] isEqualToString:model[@"product_id"]])
+            continue;
+        [newdict setObject:mitem forKey:[NSString stringWithFormat:@"item_%lu",(unsigned long)newdict.allKeys.count]];
+        
+    }
+    newdict[@"count"]=[NSString stringWithFormat:@"%lu",(unsigned long)newdict.allKeys.count];
+    
+    
+    appDelegate.recent_model = newdict;
+//    
+//    
+//    if(!bexist)
+//    {
+//        [appDelegate.recent_model setObject:item forKey:[NSString stringWithFormat:@"item_%d",count]];
+//        appDelegate.recent_model[@"count"]=[NSString stringWithFormat:@"%d",count+1];
+//    }
+}
++(void) alert_view :(NSString*) msg title:(NSString*) title
 {
     if(title==nil)
-        title = @"Error.";
+        title = @"Message";
     if(msg.length>0)
     {
         title=[NSString stringWithFormat:@"%@\n\n%@",title,msg];

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

@@ -30,7 +30,7 @@
 
 +(NSDictionary*)request_model_qty: (NSString*) fashionId;
 
-
++(NSDictionary*)commoneditor_partialrefresh: (NSMutableDictionary*)params url:(NSString*)url;
 
 //+(NSDictionary*)Search: (NSString*) category customid:(int) customid price_template:(int) price_template sort:(int) sort_by filter:(NSString*) filter keyword:(NSString*) keyword;
 +(NSDictionary*)Category: (NSString*) category customid:(int) customid price_template:(int) price_template sort:(int) sort_by filter:(NSString*) filter keyword:(NSString*) keyword offset:(long) offset limit:(long) limit alert:(NSString*)alert qty:(NSString*)qty available:(NSString*)available price:(NSString*)price;
@@ -57,7 +57,7 @@
 +(NSDictionary*) add_toWatchList:(NSString* ) item_id;
 +(NSDictionary*)request_Cart;
 +(NSDictionary*)request_WatchList;
-+(NSDictionary*) portfolio_setPrice:(NSString*) watchlist_id price:(float) price discount:(float) discount;
++(NSDictionary*) portfolio_setPrice:(NSString*) watchlist_id price:(float) price discount:(float) discount QTY:(int)qty;
 +(NSDictionary*) portfolio_setQTY:(NSString*) watchlist_id QTY:(int)qty;
 
 +(NSDictionary*) cart_remove:(NSString* ) item_ids;

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

@@ -868,6 +868,46 @@ repeat:{
     else
         return nil;
 }
++(NSDictionary*)commoneditor_partialrefresh: (NSMutableDictionary*)params url:(NSString*)url
+{
+    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)
+        [params setValue:appDelegate.contact_id forKey:@"contactId"];
+    if(appDelegate.password!=nil)
+        [params setValue:appDelegate.password forKey:@"password"];
+    
+//    if(appDelegate.order_code!=nil)
+//        [params setValue:appDelegate.order_code forKey:@"orderCode"];
+    
+    //    NSDictionary* customerinfo= appDelegate.customerInfo;
+    //
+    //    NSArray* keys=[customerinfo allKeys];
+    //    for(int i=0;i<keys.count;i++)
+    //    {
+    //        [params setValue:[customerinfo valueForKey:(NSString*)keys[i]] forKey:keys[i] ];
+    //    }
+    //
+    //    [params setValue:sourceid forKey:@"sourceid"];
+    //    [params setValue:editor forKey:@"editor"];
+    NSData* json=[self get_json:url parameters:params];
+    if(json!=nil)
+    {
+        NSError *error=nil;
+        NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
+        if([[jsobj valueForKey:@"result"]intValue]==2)
+            [appDelegate SetSo:nil];
+        
+        
+        return jsobj;
+    }
+    else
+        return nil;
+}
 +(NSDictionary*)saveandcommit_Order:(NSMutableDictionary*)params
 {
     if(![self IsNetworkAvailable])
@@ -1625,7 +1665,7 @@ repeat:{
     NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
     return jsobj;
 }
-+(NSDictionary*) portfolio_setPrice:(NSString*) watchlist_id price:(float) price discount:(float) discount
++(NSDictionary*) portfolio_setPrice:(NSString*) watchlist_id price:(float) price discount:(float) discount QTY:(int)qty
 {
     if(![self IsNetworkAvailable])
         return [RAUtils error_json:RESULT_NET_NOTAVAILABLE err_msg:nil];
@@ -1645,6 +1685,7 @@ repeat:{
     
     [params setValue:[NSString stringWithFormat:@"%f",discount] forKey:@"discount"];
     
+    [params setValue:[NSString stringWithFormat:@"%d",qty] forKey:@"available_qty"];
     
     NSData* json=[self get_json:URL_PORTFOLIO_SET_PRICE parameters:params];
     if(json==nil)
@@ -1860,7 +1901,7 @@ repeat:{
         [params setValue:appDelegate.password forKey:@"password"];
     
     [params setValue:[NSString stringWithFormat:@"%d",0 ] forKey:@"offset"];
-    [params setValue:[NSString stringWithFormat:@"%d",9999 ] forKey:@"limit"];
+    [params setValue:[NSString stringWithFormat:@"%d",INT_MAX ] forKey:@"limit"];
     NSData* json=[self get_json:URL_PORTFOLIO parameters:params];
     if(json==nil)
         return nil;
@@ -1894,7 +1935,7 @@ repeat:{
         [params setValue:appDelegate.password forKey:@"password"];
     
     [params setValue:[NSString stringWithFormat:@"%d",0 ] forKey:@"offset"];
-    [params setValue:[NSString stringWithFormat:@"%d",9999 ] forKey:@"limit"];
+    [params setValue:[NSString stringWithFormat:@"%d",INT_MAX ] forKey:@"limit"];
     NSData* json=[self get_json:URL_WATCHLIST parameters:params];
     if(json==nil)
         return nil;
@@ -2476,6 +2517,7 @@ repeat:{
             appDelegate.customerInfo = [objheader objectForKeyedSubscript:@"customerInfo"];
             appDelegate.contact_id = [objheader valueForKey:@"customer_cid"];
             appDelegate.order_code =[objheader valueForKey:@"orderCode"];
+            appDelegate.order_status =[[objheader valueForKey:@"orderStatus"] intValue];
         }
         NSString* mode =[jsobj valueForKey:@"mode"] ;
         [appDelegate SetMode:mode];

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

@@ -36,6 +36,7 @@
 @property (strong,nonatomic)NSMutableDictionary* recent_model;
 
 @property (strong,nonatomic) NSString* order_code;
+@property  int order_status;
 //@property (strong,nonatomic) NSString* so;
 @property (strong,nonatomic) UIViewController* main_vc;
 
@@ -110,7 +111,7 @@
 // printer
 
 @property (strong, nonatomic) NSString * printerURL;
--(void) printPdf:(NSString*) url;
+-(void) printPdf:(NSString*) url company:(NSString*)company send_to:(NSString*)send_to soid:(NSString*)soid content:(NSString*)content;
 @property (strong, nonatomic) NSMutableDictionary* OrderFilter;
 
 @end

+ 39 - 1
RedAnt ERP Mobile/iSales-NPD/AppDelegate.m

@@ -190,6 +190,11 @@
         NSString* title = [NSString stringWithFormat:@"Sign in"];
         [main_vc.buttonUser setTitle:title forState:UIControlStateNormal];
        
+        [main_vc.btnContact setTitle:@"" forState:UIControlStateNormal];
+        
+        [main_vc.btnContact setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
+        main_vc.btnContact.hidden = YES;
+        
         main_vc.labelMode.text=nil;
         [main_vc.labelMode setTextColor:UIColorFromRGB(0x336699)];
 //        [main_vc.buttonUser setTitleColor:UIColorFromRGB(0x996633) forState:UIControlStateNormal];
@@ -1010,11 +1015,44 @@
 
 
 
--(void) printPdf:(NSString*) url
+-(void) printPdf:(NSString*) url company:(NSString*)company send_to:(NSString*)send_to soid:(NSString*)soid content:(NSString*)content
 {
     PDFViewController *ViewController = [self.main_vc.storyboard instantiateViewControllerWithIdentifier:@"PDFViewController"];
     ViewController.url = url;
     ViewController.canSave = false;
+    
+    
+    
+    ViewController.mail_content = content;
+    
+   
+    if(soid==nil)
+        soid =@"";
+    
+    if(company==nil)
+        company =@"";
+    
+    
+    ViewController.save_name =soid;
+
+    
+    
+    
+    NSMutableArray* arrsend_to = [[NSMutableArray alloc]init];
+    if(send_to.length>0)
+    {
+        arrsend_to=[[send_to componentsSeparatedByString:NSLocalizedString(@";", nil)] mutableCopy];
+        //                            customer_email compo
+        //                            [send_to addObject:customer_email];
+    }
+    ViewController.mail_to = arrsend_to;
+    
+    NSString* subject=[NSString stringWithFormat:@"%@ -- SO# %@ from NEW PACIFIC DIRECT,INC.",company,soid];//[arr_subject componentsJoinedByString:@" : "];
+    
+    ViewController.mail_subject = subject;
+    
+    
+    
 //    NSString* subject;
     //                    if (company.length==0) {
     

Diferenças do arquivo suprimidas por serem muito extensas
+ 268 - 336
RedAnt ERP Mobile/iSales-NPD/Base.lproj/Main.storyboard


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

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

BIN
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/mark_attention_24.imageset/appicon-1.png


BIN
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/mark_attention_24.imageset/appicon-2.png


BIN
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/mark_attention_24.imageset/appicon.png


+ 84 - 1
RedAnt ERP Mobile/iSales-NPD/config.h

@@ -209,7 +209,90 @@
 //#define  URL_CUSTOMER_PENDINGORDER  @"https://www.newpacificdirect.com/isales/hasPendingOrderByContact.htm"
 //#define  URL_PORTFOLIOLIST_REMOVE  @"https://www.newpacificdirect.com/isales/deleteTearSheetPdf.htm"
 //#define  URL_NPD_POLICY   @"https://www.newpacificdirect.com/isales/generalPolicy.htm"
-
+//
 
 
 #endif
+/*
+
+ 
+ "wolsenwd";"Dimples1"
+ "nfeldmanew";"barbara53"
+ "tleonctr";"eduardo0920"
+ "eschlachtered";"castle217"
+ "scataniaed";"0102sc"
+ "rcoblinww";"coastalcurrent1"
+ "dbowened";"53cd9466da"
+ "dbowenew";"d965f76719"
+ "gpeytonew";"ee3145d09d"
+ "lhouserwd";"gobigred"
+ "tleonwd";"eduardo0920"
+ "sgraywd";"Kalle1999"
+ "jmassingew";"876578d947"
+ "rwilliamsed";"d58e566c6a"
+ "rwilliamsew";"7ded2b714f"
+ "smcnallyed";"18f4d351d3"
+ "mmacdonaldew";"2bb056c7c4"
+ "jmorrisseyed";"ac8e2d9d71"
+ "tburlesonew";"Tommy123"
+ "lthompsonew";"lthompsonew1"
+ "lthompsoned";"lthompsoned1"
+ "jtribicked";"maria1600"
+ "jtribickew";"maria1600"
+ "tburlesoned";"Tommy123"
+ "delrodwd";"stanley"
+ "mmacdonalded";"276npd"
+ "jmcphersoned";"guildmaster1"
+ "jmcphersonew";"guildmaster2"
+ "gpeytoned";"lorraine1420"
+ "smcnallyew";"P44dskpt"
+ "jmassinged";"hamco1"
+ "delrodww";"e746356b2c"
+ "szorinww";"edd88c788e"
+ "sgrayww";"2ae6b06cd0"
+ "sgrayctr";"4cf17f63d0"
+ "rholmesww";"ed468dacca"
+ "wolsenww";"Dimples"
+ "wolsened";"Dimples"
+ "wolsenew";"Dimples"
+ "wolsenctr";"Dimples"
+ "wlanziew";"nolan2345"
+ "scataniaew";"sc0102"
+ "jmorrisseyew";"chang111"
+ "rbrownww";"7675949Rba"
+ "jmaxeyctr";"1946jhm"
+ "fboothww";"npdrep1"
+ "dwilliamsww";"Greyhound1"
+ "Jheatonwd";"Npd247"
+ "jheatonctr";"Npd247"
+ "nandersonww";"1RBAna"
+ "jheatonww";"Npd247"
+ "ppeppleywd";"akamrib1"
+ "ppeppleyww";"akamrib1"
+ "fboothwd";"npdrep1"
+ "gpaynectr";"msstate"
+ "dwilliamswd";"Greyhound1"
+ "jkorngoldew";"katie81"
+ "jrosemanww";"gobigred5"
+ "rcoblinctr";"!@#Abc123"
+ "nandersonwd";"1RBAna"
+ "jrosemanwd";"gobigred"
+ "eschlachterew";"Castle217"
+ "btingvallww";"olivia1010"
+ "gpayneed";"msstate"
+ "nfeldmaned";"nadine53"
+ "gpayneew";"msstate"
+ "lhouserww";"gobigred1"
+ "rbrownwd";"7675949"
+ "wlanzied";"sigmak60"
+ "rcoblinwd";"!@#Abc123"
+ "btingvallwd";"olivia1010"
+ "jkorngolded";"katie81"
+ "szorinwd";"nushka11"
+ "bburroughswd";"lovebug.159"
+ "bburroughsww";"lovebug.159"
+ "rholmeswd";"jaxson2012"
+ "kranieriwd";"dangles01"
+ "kranieriww";"dangles01"
+
+*/

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

@@ -17,11 +17,11 @@
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>1.0</string>
+	<string>1.1</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>160325</string>
+	<string>160409</string>
 	<key>LSRequiresIPhoneOS</key>
 	<true/>
 	<key>NSAppTransportSecurity</key>

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff