Ray Zhang 9 anos atrás
pai
commit
4d40b7918e

+ 1 - 1
RedAnt ERP Mobile/HMLG Mobile/Info.plist

@@ -19,7 +19,7 @@
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>160725</string>
+	<string>160728</string>
 	<key>LSRequiresIPhoneOS</key>
 	<true/>
 	<key>NSAppTransportSecurity</key>

+ 65 - 65
RedAnt ERP Mobile/HMLG Mobile/config.h

@@ -23,102 +23,102 @@
 
 
 ////-------------------HMLG chen server-----------------------
-//#define  URL_CUSTOMER_ADV_SEARCH @"http://192.168.0.116/pj/isales/getContactAdvance.htm"
+//#define  URL_CUSTOMER_ADV_SEARCH @"http://192.168.0.111/pj/isales/getContactAdvance.htm"
 //
-//#define  URL_UPDATE_AUTH  @"http://192.168.0.116/pj/isales/login.htm"
-//#define  URL_LOGOUT  @"http://192.168.0.116/pj/isales/loginOut.htm"
-//#define  URL_RETRIEVE_PASS  @"http://192.168.0.116/pj/isales/forgotPassword.htm"
+//#define  URL_UPDATE_AUTH  @"http://192.168.0.111/pj/isales/login.htm"
+//#define  URL_LOGOUT  @"http://192.168.0.111/pj/isales/loginOut.htm"
+//#define  URL_RETRIEVE_PASS  @"http://192.168.0.111/pj/isales/forgotPassword.htm"
 //
-//#define  URL_REQUEST_CATMENU  @"http://192.168.0.116/pj/isales/menu.htm"
-//#define  URL_LOAD_HOME  @"http://192.168.0.116/pj/isales/homePage.htm"
-//#define  URL_CATEGORY @"http://192.168.0.116/pj/isales/distinctCategory.htm"
-//#define  URL_SEARCH  @"http://192.168.0.116/pj/isales/search.htm"
-//#define  URL_ITEM_SEARCH  @"http://192.168.0.116/pj/isales/itemSearch.htm"
-//#define  URL_CATEGORY_LOADMORE  @"http://192.168.0.116/pj/isales/categoryMore.htm"
+//#define  URL_REQUEST_CATMENU  @"http://192.168.0.111/pj/isales/menu.htm"
+//#define  URL_LOAD_HOME  @"http://192.168.0.111/pj/isales/homePage.htm"
+//#define  URL_CATEGORY @"http://192.168.0.111/pj/isales/distinctCategory.htm"
+//#define  URL_SEARCH  @"http://192.168.0.111/pj/isales/search.htm"
+//#define  URL_ITEM_SEARCH  @"http://192.168.0.111/pj/isales/itemSearch.htm"
+//#define  URL_CATEGORY_LOADMORE  @"http://192.168.0.111/pj/isales/categoryMore.htm"
 //
 //
 //
-//#define  URL_ORDER_LIST  @"http://192.168.0.116/pj/isales/orderList.htm"
-//#define  URL_ORDER_DETAIL  @"http://192.168.0.116/pj/isales/orderDetail.htm"
-//#define URL_COMMIT_ORDER @"http://192.168.0.116/pj/isales/createOrder.htm"
-//#define URL_COPY_ORDER @"http://192.168.0.116/pj/isales/copyOrder.htm"
-//#define URL_SIGN_ORDER @"http://192.168.0.116/pj/isales/updateOrderSign.htm"
-//#define URL_SAVE_ORDER @"http://192.168.0.116/pj/isales/saveOrder.htm"
-//#define URL_UPDATE_ORDERCUSTOMER @"http://192.168.0.116/pj/isales/updateOrderCustomerInfo.htm"
-//#define  URL_NEW_ORDER  @"http://192.168.0.116/pj/isales/createNewOrder.htm"
-//#define  URL_OPEN_ORDER  @"http://192.168.0.116/pj/isales/openOrder.htm"
-//#define  URL_RELEASE_ORDER  @"http://192.168.0.116/pj/isales/closeOrder.htm"
-//#define  URL_DELETE_ORDER  @"http://192.168.0.116/pj/isales/deleteOrder.htm"
-//#define  URL_CANCEL_ORDER  @"http://192.168.0.116/pj/isales/cancelOrder.htm"
+//#define  URL_ORDER_LIST  @"http://192.168.0.111/pj/isales/orderList.htm"
+//#define  URL_ORDER_DETAIL  @"http://192.168.0.111/pj/isales/orderDetail.htm"
+//#define URL_COMMIT_ORDER @"http://192.168.0.111/pj/isales/createOrder.htm"
+//#define URL_COPY_ORDER @"http://192.168.0.111/pj/isales/copyOrder.htm"
+//#define URL_SIGN_ORDER @"http://192.168.0.111/pj/isales/updateOrderSign.htm"
+//#define URL_SAVE_ORDER @"http://192.168.0.111/pj/isales/saveOrder.htm"
+//#define URL_UPDATE_ORDERCUSTOMER @"http://192.168.0.111/pj/isales/updateOrderCustomerInfo.htm"
+//#define  URL_NEW_ORDER  @"http://192.168.0.111/pj/isales/createNewOrder.htm"
+//#define  URL_OPEN_ORDER  @"http://192.168.0.111/pj/isales/openOrder.htm"
+//#define  URL_RELEASE_ORDER  @"http://192.168.0.111/pj/isales/closeOrder.htm"
+//#define  URL_DELETE_ORDER  @"http://192.168.0.111/pj/isales/deleteOrder.htm"
+//#define  URL_CANCEL_ORDER  @"http://192.168.0.111/pj/isales/cancelOrder.htm"
 //
 //
-//#define  URL_CART_SET_PRICE  @"http://192.168.0.116/pj/isales/setPrice.htm"
-//#define  URL_CART_ITEM_NOTES  @"http://192.168.0.116/pj/isales/setItemNotes.htm"
-//#define  URL_CART_GENERAL_NOTES  @"http://192.168.0.116/pj/isales/updateGeneralNote.htm"
+//#define  URL_CART_SET_PRICE  @"http://192.168.0.111/pj/isales/setPrice.htm"
+//#define  URL_CART_ITEM_NOTES  @"http://192.168.0.111/pj/isales/setItemNotes.htm"
+//#define  URL_CART_GENERAL_NOTES  @"http://192.168.0.111/pj/isales/updateGeneralNote.htm"
 //
-//#define  URL_CART_INCRESEMENT  @"http://192.168.0.116/pj/isales/increment.htm"
-//#define  URL_CART  @"http://192.168.0.116/pj/isales/cartDtail.htm"
-//#define  URL_CARTDELIVERY  @"http://192.168.0.116/pj/isales/cartDelivery.htm"
-//#define  URL_ADD_TO_CART  @"http://192.168.0.116/pj/isales/addToCart.htm"
-//#define  URL_CART_REMOVE  @"http://192.168.0.116/pj/isales/deleteToCart.htm"
-//#define  URL_CART_CHECK  @"http://192.168.0.116/pj/isales/checkCartItem.htm"
-//#define  URL_CART2WISH  @"http://192.168.0.116/pj/isales/cartRemoveToWishlist.htm"
-//#define  URL_WISH2CART  @"http://192.168.0.116/pj/isales/wishlistRemoveToCart.htm"
+//#define  URL_CART_INCRESEMENT  @"http://192.168.0.111/pj/isales/increment.htm"
+//#define  URL_CART  @"http://192.168.0.111/pj/isales/cartDtail.htm"
+//#define  URL_CARTDELIVERY  @"http://192.168.0.111/pj/isales/cartDelivery.htm"
+//#define  URL_ADD_TO_CART  @"http://192.168.0.111/pj/isales/addToCart.htm"
+//#define  URL_CART_REMOVE  @"http://192.168.0.111/pj/isales/deleteToCart.htm"
+//#define  URL_CART_CHECK  @"http://192.168.0.111/pj/isales/checkCartItem.htm"
+//#define  URL_CART2WISH  @"http://192.168.0.111/pj/isales/cartRemoveToWishlist.htm"
+//#define  URL_WISH2CART  @"http://192.168.0.111/pj/isales/wishlistRemoveToCart.htm"
 //
 //
 //
 //
-//#define  URL_ITEM_DETAIL  @"http://192.168.0.116/pj/isales/modelDetail.htm"
+//#define  URL_ITEM_DETAIL  @"http://192.168.0.111/pj/isales/modelDetail.htm"
 //
-//#define  URL_ADD_TO_WATCHLIST  @"http://192.168.0.116/pj/isales/addToWishList.htm"
-//#define  URL_WATCHLIST  @"http://192.168.0.116/pj/isales/wishList.htm"
-//#define  URL_WATCHLIST_REMOVE  @"http://192.168.0.116/pj/isales/deleteToWishList.htm"
+//#define  URL_ADD_TO_WATCHLIST  @"http://192.168.0.111/pj/isales/addToWishList.htm"
+//#define  URL_WATCHLIST  @"http://192.168.0.111/pj/isales/wishList.htm"
+//#define  URL_WATCHLIST_REMOVE  @"http://192.168.0.111/pj/isales/deleteToWishList.htm"
 //
 //
 //
-//#define  URL_ADD_TO_PORTFOLIO @"http://192.168.0.116/pj/isales/addToPortfolio.htm"
-//#define  URL_PORTFOLIO_REMOVE  @"http://192.168.0.116/pj/isales/deleteToPortfolio.htm"
-//#define  URL_PORTFOLIOLIST_REMOVE  @"http://192.168.0.116/pj/isales/deleteTearSheetPdf.htm"
-//#define  URL_PORTFOLIO  @"http://192.168.0.116/pj/isales/portfolios.htm"
-//#define  URL_PORTFOLIO_SET_PRICE  @"http://192.168.0.116/pj/isales/setTearSheetPrice.htm"
-//#define  URL_DM_PARAMS @"http://192.168.0.116/pj/isales/selectTearSheetParam.htm"
-//#define  URL_REQUEST_DM @"http://192.168.0.116/pj/isales/getTearSheetPdf.htm"
-//#define  URL_SAVE_DM_DIRECT @"http://192.168.0.116/pj/isales/getTearSheetPdf.htm"
-//#define  URL_SAVE_DM @"http://192.168.0.116/pj/isales/saveTearSheetPdf.htm"
-//#define  URL_DM_LIST @"http://192.168.0.116/pj/isales/tearSheetPdfList.htm"
-////#define  URL_DM_SET_QTY @"http://192.168.0.116/pj/isales/setTearSheetAvailableQty.htm"
-//#define  URL_REQUEST_MODEL_QTY @"http://192.168.0.116/pj/isales/getTearSheetAvailableQty.htm"
+//#define  URL_ADD_TO_PORTFOLIO @"http://192.168.0.111/pj/isales/addToPortfolio.htm"
+//#define  URL_PORTFOLIO_REMOVE  @"http://192.168.0.111/pj/isales/deleteToPortfolio.htm"
+//#define  URL_PORTFOLIOLIST_REMOVE  @"http://192.168.0.111/pj/isales/deleteTearSheetPdf.htm"
+//#define  URL_PORTFOLIO  @"http://192.168.0.111/pj/isales/portfolios.htm"
+//#define  URL_PORTFOLIO_SET_PRICE  @"http://192.168.0.111/pj/isales/setTearSheetPrice.htm"
+//#define  URL_DM_PARAMS @"http://192.168.0.111/pj/isales/selectTearSheetParam.htm"
+//#define  URL_REQUEST_DM @"http://192.168.0.111/pj/isales/getTearSheetPdf.htm"
+//#define  URL_SAVE_DM_DIRECT @"http://192.168.0.111/pj/isales/getTearSheetPdf.htm"
+//#define  URL_SAVE_DM @"http://192.168.0.111/pj/isales/saveTearSheetPdf.htm"
+//#define  URL_DM_LIST @"http://192.168.0.111/pj/isales/tearSheetPdfList.htm"
+////#define  URL_DM_SET_QTY @"http://192.168.0.111/pj/isales/setTearSheetAvailableQty.htm"
+//#define  URL_REQUEST_MODEL_QTY @"http://192.168.0.111/pj/isales/getTearSheetAvailableQty.htm"
 //
-//#define  URL_CONTACT_LIST  @"http://192.168.0.116/pj/isales/getAllContact.htm"
-//#define  URL_SHIPTO_LIST  @"http://192.168.0.116/pj/isales/getShipToContact.htm"
+//#define  URL_CONTACT_LIST  @"http://192.168.0.111/pj/isales/getAllContact.htm"
+//#define  URL_SHIPTO_LIST  @"http://192.168.0.111/pj/isales/getShipToContact.htm"
 //
-//#define  URL_ADDRESS_EDOTOR  @"http://192.168.0.116/pj/isales/getAddAddress.htm"
-//#define  URL_ADDRESS_SAVE  @"http://192.168.0.116/pj/isales/saveAddress.htm"
+//#define  URL_ADDRESS_EDOTOR  @"http://192.168.0.111/pj/isales/getAddAddress.htm"
+//#define  URL_ADDRESS_SAVE  @"http://192.168.0.111/pj/isales/saveAddress.htm"
 //
 //
-//#define  URL_CREDITCARD_EDOTOR  @"http://192.168.0.116/pj/isales/creditCard.htm"
-//#define  URL_CREDITCARD_SAVE  @"http://192.168.0.116/pj/isales/saveAddress.htm"
+//#define  URL_CREDITCARD_EDOTOR  @"http://192.168.0.111/pj/isales/creditCard.htm"
+//#define  URL_CREDITCARD_SAVE  @"http://192.168.0.111/pj/isales/saveAddress.htm"
 //
 //
 //
-//#define  URL_CUSTOMER_INFO  @"http://192.168.0.116/pj/isales/getCustomerInfoByContact.htm"
-//#define  URL_CUSTOMER_PENDINGORDER  @"http://192.168.0.116/pj/isales/hasPendingOrderByContact.htm"
-//#define  URL_NEW_CUSTOMER  @"http://192.168.0.116/pj/isales/getAddCustomer.htm"
-//#define  URL_EDIT_CUSTOMER  @"http://192.168.0.116/pj/isales/getUpdateCustomerInfoByContact.htm"
-//#define  URL_CUSTOMER_SAVE  @"http://192.168.0.116/pj/isales/saveCustomer.htm"
-//#define  URL_CUSTOMER_UPDATE  @"http://192.168.0.116/pj/isales/updateCustomer.htm"
-//#define  URL_UPDATE_CUSTOMER_BCARD  @"http://192.168.0.116/pj/isales/updateCustomerBusiCard.htm"
+//#define  URL_CUSTOMER_INFO  @"http://192.168.0.111/pj/isales/getCustomerInfoByContact.htm"
+//#define  URL_CUSTOMER_PENDINGORDER  @"http://192.168.0.111/pj/isales/hasPendingOrderByContact.htm"
+//#define  URL_NEW_CUSTOMER  @"http://192.168.0.111/pj/isales/getAddCustomer.htm"
+//#define  URL_EDIT_CUSTOMER  @"http://192.168.0.111/pj/isales/getUpdateCustomerInfoByContact.htm"
+//#define  URL_CUSTOMER_SAVE  @"http://192.168.0.111/pj/isales/saveCustomer.htm"
+//#define  URL_CUSTOMER_UPDATE  @"http://192.168.0.111/pj/isales/updateCustomer.htm"
+//#define  URL_UPDATE_CUSTOMER_BCARD  @"http://192.168.0.111/pj/isales/updateCustomerBusiCard.htm"
 //
 //
 //
 //
 //
 //
-//#define  URL_ERR_LOG  @"http://192.168.0.116/pj/isales/er_log.htm"
+//#define  URL_ERR_LOG  @"http://192.168.0.111/pj/isales/er_log.htm"
 //
-//#define  URL_UPLOAD_IMG  @"http://192.168.0.116/pj/isales/uploadImg.htm"
+//#define  URL_UPLOAD_IMG  @"http://192.168.0.111/pj/isales/uploadImg.htm"
 //
-//#define  URL_NPD_POLICY  @"http://192.168.0.116/pj/isales/generalPolicy.htm"
+//#define  URL_NPD_POLICY  @"http://192.168.0.111/pj/isales/generalPolicy.htm"
 //
 //
 //#define  URL_CHECK_OFFLINE  @"http://192.168.1.3/check.json"

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


+ 280 - 24
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/Ray.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -170,11 +170,11 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "common/Functions/offline/OLDataProvider.m"
-            timestampString = "491105975.202992"
+            timestampString = "491301283.428677"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2083"
-            endingLineNumber = "2083"
+            startingLineNumber = "2192"
+            endingLineNumber = "2192"
             landmarkName = "+offline_contactlist:"
             landmarkType = "5">
          </BreakpointContent>
@@ -650,11 +650,11 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "common/Functions/offline/OLDataProvider.m"
-            timestampString = "491105975.202992"
+            timestampString = "491301283.428677"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1933"
-            endingLineNumber = "1933"
+            startingLineNumber = "2042"
+            endingLineNumber = "2042"
             landmarkName = "+offline_contactlist:"
             landmarkType = "5">
          </BreakpointContent>
@@ -682,11 +682,11 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "common/Functions/offline/OLDataProvider.m"
-            timestampString = "491105975.202992"
+            timestampString = "491301283.428677"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2435"
-            endingLineNumber = "2435"
+            startingLineNumber = "2544"
+            endingLineNumber = "2544"
             landmarkName = "+model_img:"
             landmarkType = "5">
          </BreakpointContent>
@@ -714,11 +714,11 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "common/data_provider/iSalesDB.m"
-            timestampString = "490849891.937293"
+            timestampString = "491296989.883015"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "50"
-            endingLineNumber = "50"
+            startingLineNumber = "75"
+            endingLineNumber = "75"
             landmarkName = "decryptfield()"
             landmarkType = "7">
          </BreakpointContent>
@@ -842,11 +842,11 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "common/Functions/sidemenu/LoginViewController.m"
-            timestampString = "490688711.452187"
+            timestampString = "491279672.751329"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "67"
-            endingLineNumber = "67"
+            startingLineNumber = "69"
+            endingLineNumber = "69"
             landmarkName = "-viewDidLoad"
             landmarkType = "5">
          </BreakpointContent>
@@ -970,11 +970,11 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "common/Functions/offline/OLDataProvider.m"
-            timestampString = "491105975.202992"
+            timestampString = "491301283.428677"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2394"
-            endingLineNumber = "2394"
+            startingLineNumber = "2503"
+            endingLineNumber = "2503"
             landmarkName = "+category_img:"
             landmarkType = "5">
          </BreakpointContent>
@@ -1210,11 +1210,11 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "common/Functions/offline/OLDataProvider.m"
-            timestampString = "491105975.202992"
+            timestampString = "491301283.428677"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2341"
-            endingLineNumber = "2341"
+            startingLineNumber = "2450"
+            endingLineNumber = "2450"
             landmarkName = "+model_selector:field:"
             landmarkType = "5">
          </BreakpointContent>
@@ -1290,11 +1290,11 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "common/Functions/offline/OLDataProvider.m"
-            timestampString = "491105975.202992"
+            timestampString = "491301283.428677"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2154"
-            endingLineNumber = "2154"
+            startingLineNumber = "2263"
+            endingLineNumber = "2263"
             landmarkName = "+model_NIYMAL:"
             landmarkType = "5">
          </BreakpointContent>
@@ -1395,5 +1395,261 @@
             landmarkType = "5">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/home/HomeViewController.m"
+            timestampString = "491280168.138321"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "678"
+            endingLineNumber = "678"
+            landmarkName = "-ButtonBannerClick:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/offline/OLDataProvider.m"
+            timestampString = "491293197.585845"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1469"
+            endingLineNumber = "1469"
+            landmarkName = "+offline_createorder:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/offline/OLDataProvider.m"
+            timestampString = "491299612.623358"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1488"
+            endingLineNumber = "1488"
+            landmarkName = "+offline_orderlist:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/order/OrderListViewController.m"
+            timestampString = "491368306.138785"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "406"
+            endingLineNumber = "406"
+            landmarkName = "-loadpage"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/data_provider/iSalesNetwork.m"
+            timestampString = "491377663.411976"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1266"
+            endingLineNumber = "1266"
+            landmarkName = "+request_OrderList:limit:keywords:status:customer:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/data_provider/iSalesNetwork.m"
+            timestampString = "491377663.411976"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1291"
+            endingLineNumber = "1291"
+            landmarkName = "+request_OrderList:limit:keywords:status:customer:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/data_provider/iSalesNetwork.m"
+            timestampString = "491368595.648773"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "104"
+            endingLineNumber = "104"
+            landmarkName = "+get_json:parameters:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/data_provider/iSalesNetwork.m"
+            timestampString = "491377663.411976"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "221"
+            endingLineNumber = "221"
+            landmarkName = "+get_json:parameters:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/data_provider/iSalesNetwork.m"
+            timestampString = "491377652.944005"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "299"
+            endingLineNumber = "299"
+            landmarkName = "+get_json:parameters:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/data_provider/iSalesNetwork.m"
+            timestampString = "491377763.552532"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "2830"
+            endingLineNumber = "2830"
+            landmarkName = "+parse_authinfo:user:password:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/sidemenu/LoginViewController.m"
+            timestampString = "491377806.21059"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "195"
+            endingLineNumber = "195"
+            landmarkName = "-onLoginClick:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/cart/CartViewController.m"
+            timestampString = "491446984.898053"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1806"
+            endingLineNumber = "1806"
+            landmarkName = "-tableView:editActionsForRowAtIndexPath:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/cart/CartViewController.m"
+            timestampString = "491447000.238258"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1839"
+            endingLineNumber = "1839"
+            landmarkName = "-tableView:editActionsForRowAtIndexPath:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/cart/CartViewController.m"
+            timestampString = "491447010.682862"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1841"
+            endingLineNumber = "1841"
+            landmarkName = "-tableView:editActionsForRowAtIndexPath:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/cart/CartViewController.m"
+            timestampString = "491447435.917471"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1805"
+            endingLineNumber = "1805"
+            landmarkName = "-tableView:editActionsForRowAtIndexPath:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/cart/CartViewController.m"
+            timestampString = "491667432.706481"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1426"
+            endingLineNumber = "1426"
+            landmarkName = "-tableView:cellForRowAtIndexPath:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
 </Bucket>

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

@@ -1847,6 +1847,7 @@
                         self.content_arr[indexPath.row ] = item_json;
                         tableView.editing = false;
                         [tableView reloadRowsAtIndexPaths:@[indexPath]withRowAnimation:UITableViewRowAnimationMiddle];
+                        [self refresh_total];
                     }
                     else
                     {

+ 4 - 0
RedAnt ERP Mobile/common/Functions/offline/OLDataProvider.h

@@ -25,6 +25,10 @@
 +(NSDictionary*) offline_login :(NSMutableDictionary *) params;
 +(NSDictionary*) offline_logout :(NSMutableDictionary *) params;
 
+
++(NSData*) offline_createorder :(NSMutableDictionary *) params;
++(NSData*) offline_orderlist :(NSMutableDictionary *) params;
+
 +(NSDictionary*) offline_category_menu ;
 +(NSDictionary*) offline_home ;
 

+ 254 - 145
RedAnt ERP Mobile/common/Functions/offline/OLDataProvider.m

@@ -24,15 +24,15 @@
     AppDelegate *appDelegate = (AppDelegate *)[app delegate];
     sqlite3 *db = [iSalesDB get_db];
     NSString * where=@"1=1";
-//    if(appDelegate.user!=nil)
-//        where=[NSString stringWithFormat:@"lower(username)='%@'",appDelegate.user.lowercaseString];
+    //    if(appDelegate.user!=nil)
+    //        where=[NSString stringWithFormat:@"lower(username)='%@'",appDelegate.user.lowercaseString];
     int count = [iSalesDB get_recordcount:db table:@"offline_login" where:where];
     if(count==0)
     {
         return false;
     }
     return true;
-//
+    //
     sqlite3_close(db);
 }
 +(NSDictionary*) offline_deletewishlist :(NSMutableDictionary *) params
@@ -139,10 +139,10 @@
             
             NSString *nsurl=[self model_category_img:[NSString stringWithFormat:@"%@",[NSNumber numberWithInt:product_id]] model_name:nil];
             
-//            char *url = (char*)sqlite3_column_text(statement, 3);
-//            if(url==nil)
-//                url="";
-//            NSString *nsurl = [[NSString alloc]initWithUTF8String:url];
+            //            char *url = (char*)sqlite3_column_text(statement, 3);
+            //            if(url==nil)
+            //                url="";
+            //            NSString *nsurl = [[NSString alloc]initWithUTF8String:url];
             
             
             
@@ -247,19 +247,19 @@
     UIApplication * app = [UIApplication sharedApplication];
     AppDelegate *appDelegate = (AppDelegate *)[app delegate];
     
-//    NSArray* arr1 = [self get_user_all_price_type];
+    //    NSArray* arr1 = [self get_user_all_price_type];
     NSArray* arr2 = [self get_contact_default_price_type:contact_id];
     
-//    NSSet *set1 = [NSSet setWithArray:arr1];
-//    NSMutableSet *set2 = [[NSSet setWithArray:arr2] mutableCopy];
+    //    NSSet *set1 = [NSSet setWithArray:arr1];
+    //    NSMutableSet *set2 = [[NSSet setWithArray:arr2] mutableCopy];
     
-//    if(appDelegate.contact_id==nil)
-//        set2=[set1 mutableCopy];
-//    else
-//        [set2 intersectsSet:set1];
+    //    if(appDelegate.contact_id==nil)
+    //        set2=[set1 mutableCopy];
+    //    else
+    //        [set2 intersectsSet:set1];
     
     
-//    NSArray *retarr = [set2  allObjects];
+    //    NSArray *retarr = [set2  allObjects];
     
     NSString* whereprice=[RAUtils arr2string:arr2 separator:@"," trim:true brackets:@"'"];
     
@@ -293,14 +293,14 @@
                 name="";
             NSString *nsname = [[NSString alloc]initWithUTF8String:name];
             
-           // double price = sqlite3_column_double(statement, 1);
+            // double price = sqlite3_column_double(statement, 1);
+            
+            //            char *isnull = (char*)sqlite3_column_text(statement, 1);
+            //            if(isnull==nil)
+            //                item[nsname]= @"No Price";
+            //            else
+            //                item[nsname]= [NSString stringWithFormat:@"%.2f",price];
             
-//            char *isnull = (char*)sqlite3_column_text(statement, 1);
-//            if(isnull==nil)
-//                item[nsname]= @"No Price";
-//            else
-//                item[nsname]= [NSString stringWithFormat:@"%.2f",price];
-
             
             char *price = (char*)sqlite3_column_text(statement, 1);
             if(price!=nil)
@@ -347,12 +347,12 @@
     NSArray* arr1 = [self get_user_all_price_type];
     NSArray* arr2 = [self get_contact_default_price_type:contact_id];
     
-//    NSSet *set1 = [NSSet setWithArray:arr1];
-//    NSMutableSet *set2 = [[NSSet setWithArray:arr2] mutableCopy];
-//    [set2 intersectsSet:set1];
-//    
-//    
-//    NSArray *retarr = [set2  allObjects];
+    //    NSSet *set1 = [NSSet setWithArray:arr1];
+    //    NSMutableSet *set2 = [[NSSet setWithArray:arr2] mutableCopy];
+    //    [set2 intersectsSet:set1];
+    //
+    //
+    //    NSArray *retarr = [set2  allObjects];
     
     NSString* whereprice=nil;
     if(contact_id==nil)
@@ -376,7 +376,7 @@
         while (sqlite3_step(statement) == SQLITE_ROW)
         {
             
-           // double val = sqlite3_column_double(statement, 0);
+            // double val = sqlite3_column_double(statement, 0);
             char *price = (char*)sqlite3_column_text(statement, 0);
             if(price!=nil)
             {
@@ -1319,10 +1319,10 @@
 {
     
     
-//    
-//    NSString* user = [params valueForKey:@"user"];
-//    
-//    NSString* password = [params valueForKey:@"password"];
+    //
+    //    NSString* user = [params valueForKey:@"user"];
+    //
+    //    NSString* password = [params valueForKey:@"password"];
     
     
     
@@ -1364,104 +1364,213 @@
     [appDelegate set_main_button_panel];
     
     
-//    sqlite3 *db = [iSalesDB get_db];
-//
-//
-//
-//
-//
-//    NSString *sqlQuery = [NSString stringWithFormat:@"select can_show_price,can_see_price,contact_id,user_type,can_cancel_order,can_set_cart_price,can_create_portfolio,can_delete_order,can_submit_order,can_set_tearsheet_price,can_create_order,mode,username from offline_login where lower(username)='%@' and password='%@'",user.lowercaseString ,[AESCrypt encrypt:password password:@"usai"]];
-//    
-//    
-//    
-//    
-//    DebugLog(@"offline_login sql:%@",sqlQuery);
-//    sqlite3_stmt * statement;
-//    
-//    
-//    [ret setValue:[NSNumber numberWithInt:AP_USER_NOT_AUTH ] forKey:@"result"];
-//    
-//    
-//    if (sqlite3_prepare_v2(db, [sqlQuery UTF8String], -1, &statement, nil) == SQLITE_OK)
-//    {
-//        
-//        
-//        if (sqlite3_step(statement) == SQLITE_ROW)
-//        {
-//            
-//            [ret setValue:[NSNumber numberWithInt:AP_USER_AUTH ] forKey:@"result"];
-//            NSMutableDictionary* header = [[NSMutableDictionary alloc] init];
-//            
-//            
-//            
-//            int can_show_price = sqlite3_column_int(statement, 0);
-//            int can_see_price = sqlite3_column_int(statement, 1);
-//            
-//            char *contact_id = (char*)sqlite3_column_text(statement, 2);
-//            if(contact_id==nil)
-//                contact_id="";
-//            NSString *nscontact_id= [[NSString alloc]initWithUTF8String:contact_id];
-//            
-//            int user_type = sqlite3_column_int(statement, 3);
-//            
-//            int can_cancel_order = sqlite3_column_int(statement, 4);
-//            int can_set_cart_price = sqlite3_column_int(statement, 5);
-//            int can_create_portfolio = sqlite3_column_int(statement, 6);
-//            int can_delete_order = sqlite3_column_int(statement, 7);
-//            int can_submit_order = sqlite3_column_int(statement, 8);
-//            int can_set_tearsheet_price = sqlite3_column_int(statement, 9);
-//            int can_create_order = sqlite3_column_int(statement, 10);
-//            
-//            
-//            char *mode = (char*)sqlite3_column_text(statement, 11);
-//            if(mode==nil)
-//                mode="";
-//            NSString *nsmode= [[NSString alloc]initWithUTF8String:mode];
-//            
-//            
-//            char *username = (char*)sqlite3_column_text(statement, 12);
-//            if(username==nil)
-//                username="";
-//            NSString *nsusername= [[NSString alloc]initWithUTF8String:username];
-//            
-//            
-//            [header setValue:[NSNumber numberWithBool:can_show_price]   forKey:@"can_show_price"];
-//            [header setValue:[NSNumber numberWithBool:can_see_price]   forKey:@"can_see_price"];
-//            [header setValue:nscontact_id   forKey:@"contact_id"];
-//            [header setValue:[NSNumber numberWithBool:user_type]   forKey:@"user_type"];
-//            [header setValue:[NSNumber numberWithBool:can_cancel_order]   forKey:@"can_cancel_order"];
-//            [header setValue:[NSNumber numberWithBool:can_set_cart_price]   forKey:@"can_set_cart_price"];
-//            [header setValue:[NSNumber numberWithBool:can_create_portfolio]   forKey:@"can_create_portfolio"];
-//            [header setValue:[NSNumber numberWithBool:can_delete_order]   forKey:@"can_delete_order"];
-//            [header setValue:[NSNumber numberWithBool:can_submit_order]   forKey:@"can_submit_order"];
-//            [header setValue:[NSNumber numberWithBool:can_set_tearsheet_price]   forKey:@"can_set_tearsheet_price"];
-//            [header setValue:[NSNumber numberWithBool:can_create_order]   forKey:@"can_create_order"];
-//            
-//            [header setValue:nsusername   forKey:@"username"];
-//            
-//            
-//            [ret setObject:header forKey:@"header"];
-//            [ret setValue:nsmode   forKey:@"mode"];
-//            
-//            
-//        }
-//        
-//        
-//        
-//        sqlite3_finalize(statement);
-//    }
-//    
-//    
-//    
-//    sqlite3_close(db);
-//    
-//    
-//    
-//    
-//    DebugLog(@"data string: %@",[RAUtils dict2string:ret] );
+    //    sqlite3 *db = [iSalesDB get_db];
+    //
+    //
+    //
+    //
+    //
+    //    NSString *sqlQuery = [NSString stringWithFormat:@"select can_show_price,can_see_price,contact_id,user_type,can_cancel_order,can_set_cart_price,can_create_portfolio,can_delete_order,can_submit_order,can_set_tearsheet_price,can_create_order,mode,username from offline_login where lower(username)='%@' and password='%@'",user.lowercaseString ,[AESCrypt encrypt:password password:@"usai"]];
+    //
+    //
+    //
+    //
+    //    DebugLog(@"offline_login sql:%@",sqlQuery);
+    //    sqlite3_stmt * statement;
+    //
+    //
+    //    [ret setValue:[NSNumber numberWithInt:AP_USER_NOT_AUTH ] forKey:@"result"];
+    //
+    //
+    //    if (sqlite3_prepare_v2(db, [sqlQuery UTF8String], -1, &statement, nil) == SQLITE_OK)
+    //    {
+    //
+    //
+    //        if (sqlite3_step(statement) == SQLITE_ROW)
+    //        {
+    //
+    //            [ret setValue:[NSNumber numberWithInt:AP_USER_AUTH ] forKey:@"result"];
+    //            NSMutableDictionary* header = [[NSMutableDictionary alloc] init];
+    //
+    //
+    //
+    //            int can_show_price = sqlite3_column_int(statement, 0);
+    //            int can_see_price = sqlite3_column_int(statement, 1);
+    //
+    //            char *contact_id = (char*)sqlite3_column_text(statement, 2);
+    //            if(contact_id==nil)
+    //                contact_id="";
+    //            NSString *nscontact_id= [[NSString alloc]initWithUTF8String:contact_id];
+    //
+    //            int user_type = sqlite3_column_int(statement, 3);
+    //
+    //            int can_cancel_order = sqlite3_column_int(statement, 4);
+    //            int can_set_cart_price = sqlite3_column_int(statement, 5);
+    //            int can_create_portfolio = sqlite3_column_int(statement, 6);
+    //            int can_delete_order = sqlite3_column_int(statement, 7);
+    //            int can_submit_order = sqlite3_column_int(statement, 8);
+    //            int can_set_tearsheet_price = sqlite3_column_int(statement, 9);
+    //            int can_create_order = sqlite3_column_int(statement, 10);
+    //
+    //
+    //            char *mode = (char*)sqlite3_column_text(statement, 11);
+    //            if(mode==nil)
+    //                mode="";
+    //            NSString *nsmode= [[NSString alloc]initWithUTF8String:mode];
+    //
+    //
+    //            char *username = (char*)sqlite3_column_text(statement, 12);
+    //            if(username==nil)
+    //                username="";
+    //            NSString *nsusername= [[NSString alloc]initWithUTF8String:username];
+    //
+    //
+    //            [header setValue:[NSNumber numberWithBool:can_show_price]   forKey:@"can_show_price"];
+    //            [header setValue:[NSNumber numberWithBool:can_see_price]   forKey:@"can_see_price"];
+    //            [header setValue:nscontact_id   forKey:@"contact_id"];
+    //            [header setValue:[NSNumber numberWithBool:user_type]   forKey:@"user_type"];
+    //            [header setValue:[NSNumber numberWithBool:can_cancel_order]   forKey:@"can_cancel_order"];
+    //            [header setValue:[NSNumber numberWithBool:can_set_cart_price]   forKey:@"can_set_cart_price"];
+    //            [header setValue:[NSNumber numberWithBool:can_create_portfolio]   forKey:@"can_create_portfolio"];
+    //            [header setValue:[NSNumber numberWithBool:can_delete_order]   forKey:@"can_delete_order"];
+    //            [header setValue:[NSNumber numberWithBool:can_submit_order]   forKey:@"can_submit_order"];
+    //            [header setValue:[NSNumber numberWithBool:can_set_tearsheet_price]   forKey:@"can_set_tearsheet_price"];
+    //            [header setValue:[NSNumber numberWithBool:can_create_order]   forKey:@"can_create_order"];
+    //
+    //            [header setValue:nsusername   forKey:@"username"];
+    //
+    //
+    //            [ret setObject:header forKey:@"header"];
+    //            [ret setValue:nsmode   forKey:@"mode"];
+    //
+    //
+    //        }
+    //
+    //
+    //
+    //        sqlite3_finalize(statement);
+    //    }
+    //
+    //
+    //
+    //    sqlite3_close(db);
+    //
+    //
+    //
+    //
+    //    DebugLog(@"data string: %@",[RAUtils dict2string:ret] );
     
     return ret;
 }
++(NSData*) offline_createorder :(NSMutableDictionary *) params
+{
+    NSMutableDictionary* ret = [[NSMutableDictionary alloc] init];
+    
+    return [RAUtils dict2data:ret];
+    
+}
++(NSData*) offline_orderlist :(NSMutableDictionary *) params
+{
+    NSMutableDictionary* ret = [[NSMutableDictionary alloc] init];
+    
+   
+    int limit = [[params valueForKey:@"limit"] intValue];
+    int offset = [[params valueForKey:@"offset"] intValue];
+    NSString* keyword = [params valueForKey:@"keyWord"];
+    
+    NSString* where=@"1=1";
+    if(keyword!=nil)
+        where=[NSString stringWithFormat:@"lower(o.order_id) like '%%%@%%' or lower(c.company_name) like '%%%@%%' or lower(c.company_name) like '%%%@%%' or lower(o.create_by) like '%%%@%%'",keyword.lowercaseString,keyword.lowercaseString,keyword.lowercaseString,keyword.lowercaseString];
+    NSString*     sqlQuery=[NSString stringWithFormat:@"SELECT o._id,o.so_id,o.status,o.sales_rep,o.create_by,c.company_name,o.create_time,o.total_price from offline_order o left join offline_contact c on o.contact_id=c.contact_idr where %@ order by create_time limit %d offset %d" ,where, limit, offset];
+    
+    sqlite3 *db = [iSalesDB get_db];
+    sqlite3_stmt * statement;
+    
+    
+    if (sqlite3_prepare_v2(db, [sqlQuery UTF8String], -1, &statement, nil) == SQLITE_OK)
+    {
+        
+        int count=0;
+        while (sqlite3_step(statement) == SQLITE_ROW)
+        {
+            
+            
+            
+            NSMutableDictionary* item=[[NSMutableDictionary alloc]init];
+            
+            int order_id = sqlite3_column_double(statement, 0);
+            
+            
+            
+            
+            
+            char *soid = (char*)sqlite3_column_text(statement, 1);
+            if(soid==nil)
+                soid= "";
+            NSString *nssoid= [[NSString alloc]initWithUTF8String:soid];
+            
+            
+            int status = sqlite3_column_double(statement, 2);
+            
+            
+            char *sales_rep = (char*)sqlite3_column_text(statement, 3);
+            if(sales_rep==nil)
+                sales_rep= "";
+            NSString *nssales_rep= [[NSString alloc]initWithUTF8String:sales_rep];
+            
+            char *create_by = (char*)sqlite3_column_text(statement, 4);
+            if(create_by==nil)
+                create_by= "";
+            NSString *nscreate_by= [[NSString alloc]initWithUTF8String:create_by];
+            
+            char *company_name = (char*)sqlite3_column_text(statement, 5);
+            if(company_name==nil)
+                company_name= "";
+            NSString *nscompany_name= [[NSString alloc]initWithUTF8String:company_name];
+            
+            char *create_time = (char*)sqlite3_column_text(statement, 6);
+            if(create_time==nil)
+                create_time= "";
+            NSString *nscreate_time= [[NSString alloc]initWithUTF8String:create_time];
+            
+            double total_price = sqlite3_column_double(statement, 7);
+            
+            
+            
+            
+            item[@"sales_rep"]= nssales_rep;
+            item[@"orderStatus"]= [NSString stringWithFormat:@"%d",status];
+            item[@"so#"]= nssoid;
+            item[@"price"]= [NSString stringWithFormat:@"$%.2f",total_price];;
+            item[@"create_by"]= nscreate_by;
+            item[@"customer_name"]= nscompany_name;
+            item[@"order_id"]= [NSString stringWithFormat:@"%d",order_id];;
+            item[@"purchase_time"]= nscreate_time;
+            
+            
+            ret[[NSString stringWithFormat:@"item_%d",count]]= item;
+            count++;
+            
+        }
+        
+        ret[@"count"]= [NSNumber numberWithInt:count];
+        //ret[@"total_count"]= [NSNumber numberWithInt:count];
+        // ret[@"wish_count"]= [NSNumber numberWithInt:count];
+        ret[@"result"]= [NSNumber numberWithInt:2];
+        
+        
+        sqlite3_finalize(statement);
+        
+        
+        
+        
+    }
+    
+    sqlite3_close(db);
+    
+    return [RAUtils dict2data:ret];
+}
+
 
 +(NSDictionary*) offline_login :(NSMutableDictionary *) params
 {
@@ -1782,10 +1891,10 @@
                 
                 nscompany_name=[AESCrypt fastdecrypt:nscompany_name];
                 
-//                nscompany_name=[NSString stringWithFormat:@"<b>%@</b>",nscompany_name];
+                //                nscompany_name=[NSString stringWithFormat:@"<b>%@</b>",nscompany_name];
                 
                 nsphone=[AESCrypt fastdecrypt:nsphone];
-//                nsphone=[NSString stringWithFormat:@"TEL:%@",nsphone];
+                //                nsphone=[NSString stringWithFormat:@"TEL:%@",nsphone];
                 
                 nsaddr_1=[AESCrypt fastdecrypt:nsaddr_1];
                 //                nsaddr_1=[NSString stringWithFormat:@"TEL:%@",nsphone];
@@ -1886,18 +1995,18 @@
     
     // advanced search
     
-//    NSString* contact_name = [params valueForKey:@"contact_name"];
-//    NSString* customer_phone = [params valueForKey:@"customer_phone"];
-//    NSString* customer_fax = [params valueForKey:@"customer_fax"];
-//    NSString* customer_zipcode = [params valueForKey:@"customer_zipcode"];
-//    NSString* sales_rep = [params valueForKey:@"sales_rep"];
-//    NSString* customer_state = [params valueForKey:@"customer_state"];
-//    NSString* customer_name = [params valueForKey:@"customer_name"];
-//    NSString* customer_country = [params valueForKey:@"customer_country"];
-//    NSString* customer_cid = [params valueForKey:@"customer_cid"];
-//    NSString* customer_city = [params valueForKey:@"customer_city"];
-//    NSString* customer_address = [params valueForKey:@"customer_address"];
-//    NSString* customer_email = [params valueForKey:@"customer_email"];
+    //    NSString* contact_name = [params valueForKey:@"contact_name"];
+    //    NSString* customer_phone = [params valueForKey:@"customer_phone"];
+    //    NSString* customer_fax = [params valueForKey:@"customer_fax"];
+    //    NSString* customer_zipcode = [params valueForKey:@"customer_zipcode"];
+    //    NSString* sales_rep = [params valueForKey:@"sales_rep"];
+    //    NSString* customer_state = [params valueForKey:@"customer_state"];
+    //    NSString* customer_name = [params valueForKey:@"customer_name"];
+    //    NSString* customer_country = [params valueForKey:@"customer_country"];
+    //    NSString* customer_cid = [params valueForKey:@"customer_cid"];
+    //    NSString* customer_city = [params valueForKey:@"customer_city"];
+    //    NSString* customer_address = [params valueForKey:@"customer_address"];
+    //    NSString* customer_email = [params valueForKey:@"customer_email"];
     
     
     int limit = [[params valueForKey:@"limit"] intValue];
@@ -1913,7 +2022,7 @@
     
     sqlite3 *db = [iSalesDB get_db];
     
-       int result= [iSalesDB AddExFunction:db];
+    int result= [iSalesDB AddExFunction:db];
     
     int count =0;
     
@@ -1928,7 +2037,7 @@
     }
     else
     {
-       // NSString* encrypt_keyword= [AESCrypt fastencrypt:keyword];
+        // NSString* encrypt_keyword= [AESCrypt fastencrypt:keyword];
         
         keyword = keyword.lowercaseString;
         
@@ -2088,7 +2197,7 @@
                 nsphone=[NSString stringWithFormat:@"TEL:%@",nsphone];
                 
                 nsaddr_1=[AESCrypt fastdecrypt:nsaddr_1];
-//                nsaddr_1=[NSString stringWithFormat:@"TEL:%@",nsphone];
+                //                nsaddr_1=[NSString stringWithFormat:@"TEL:%@",nsphone];
                 
             }
             

Diferenças do arquivo suprimidas por serem muito extensas
+ 358 - 358
RedAnt ERP Mobile/common/Functions/order/OrderListViewController.m


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

@@ -33,9 +33,11 @@
     [super viewDidLoad];
 #ifdef BUILD_HMLG
     self.title=@"HMLG";
+    self.checkOfflineMode.hidden=true;
 #endif
 #ifdef BUILD_NPD
     self.title=@"NPD";
+    self.checkOfflineMode.hidden=false;
 #endif
     self.showList = false;
     
@@ -268,6 +270,10 @@
                     case RESULT_VER_LOW:
                         msg = MSG_VER_LOW;
                         break;
+                        
+                    case RESULT_LOGIN_DEVICE:
+                        msg= MSG_LOGIN_DEVICE;
+                        break;
                     default:
                         break;
                 }

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

@@ -18,6 +18,7 @@
 typedef void (^add_to_cart_Handler)(void);
 
 @interface RAUtils : NSObject
++(NSData*) dict2data:(NSDictionary*) dict;
 +(NSString*) FloatFormat:(float)value;
 +(UIViewController*) getViewController:(UIView*) view;
 + (CGRect)relativeFrameForScreenWithView:(UIView *)v;

+ 8 - 0
RedAnt ERP Mobile/common/RAUtils.m

@@ -1167,6 +1167,14 @@ begin:
     
     return [UIColor blackColor];
 }
++(NSData*) dict2data:(NSDictionary*) dict
+{
+    if(dict==nil)
+        return nil;
+    // 将NSDictionary转化为NSData
+    NSData *data = [NSJSONSerialization dataWithJSONObject:dict options:kNilOptions error:nil];
+    return data;
+}
 +(NSString*) dict2string:(NSDictionary*) dict
 {
     

+ 3 - 1
RedAnt ERP Mobile/common/const.h

@@ -70,6 +70,8 @@
 #define RESULT_SESSION_EXPIRED			  -13
 #define RESULT_VER_LOW                   -15
 
+#define RESULT_LOGIN_DEVICE                   -18
+
 #define RESULT_NO_MODEL                   8
 
 #define CATEGORY_VIEWTYPE_SMALL 0
@@ -84,7 +86,7 @@
 #define MSG_VER_LOW @"Current App version is out of date, please update to the latest version."
 #define MSG_ERROR @"Connection failed with Server, please email your IT Admin."//@"Some error occured on server."
 #define MSG_SUCCESS @"Success."
-
+#define MSG_LOGIN_DEVICE @"Account already sign in from another device."
 
 
 #define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]

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

@@ -11,7 +11,7 @@
 #import <sqlite3.h>  
 #import "config.h"
 @interface iSalesDB : NSObject
-+(void)testdata;
+//+(void)testdata;
 + (int) initializeDb;
 +(void)execSql:(NSString *)sql db:(sqlite3 *)db;
 +(void)execSql:(NSString *)sql;

+ 224 - 199
RedAnt ERP Mobile/common/data_provider/iSalesDB.m

@@ -11,6 +11,31 @@
 #import "AppDelegate.h"
 @implementation iSalesDB
 
++(BOOL)checkForField:(NSString *)table field:(NSString *)field db:(sqlite3 *)db
+{
+    
+    sqlite3_stmt *stmt;
+    NSString *sql = [NSString stringWithFormat:@"PRAGMA table_info(%@)",table];
+    if (sqlite3_prepare_v2(db, [sql UTF8String], -1, &stmt, NULL) == SQLITE_OK)
+    {
+        while(sqlite3_step(stmt) == SQLITE_ROW)
+        {
+            
+            NSString *fieldName = [NSString stringWithUTF8String:(char *)sqlite3_column_text(stmt, 1)];
+            if([field isEqualToString:fieldName])
+            {
+                sqlite3_finalize(stmt);
+                return YES;
+            }
+        }
+    }
+    
+    
+    
+    return NO;
+}
+
+
 void encryptfield (sqlite3_context *context, int argc, sqlite3_value **argv) {
     assert(argc == 1);
     switch (sqlite3_value_type(argv[0])){
@@ -132,198 +157,198 @@ void decryptfield (sqlite3_context *context, int argc, sqlite3_value **argv) {
         return ret;
     }
 }
-+(void)testdata
-{
-    
-    //---------------- init db --------------------
-    //    NSString* date;
-    //    NSDateFormatter* formatter = [[NSDateFormatter alloc]init];
-    //    [formatter setDateFormat:@"YYYY-MM-dd-hh-mm-ss"];
-    //    date = [formatter stringFromDate:[NSDate date]];
-    //
-    //    NSString* dbname=[NSString stringWithFormat:@"%@.db",date];
-    //
-    //    DebugLog (@"initializeDB");
-    //
-    //    //   NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
-    //    NSString *documents = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];//[paths objectAtIndex:0];
-    //    NSString *database_path = [documents stringByAppendingPathComponent:dbname];
-    //
-    //
-    //    // move db file from document to cache ;
-    //    //   NSArray *searchPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
-    //    NSString *documentFolderPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] ;//[searchPaths objectAtIndex: 0];
-    //    NSString* dbFilePath = [documentFolderPath stringByAppendingPathComponent:dbname];
-    //    if ([[NSFileManager defaultManager] fileExistsAtPath: dbFilePath])
-    //    {
-    //        [[NSFileManager defaultManager] moveItemAtPath:dbFilePath toPath:database_path error:nil];
-    //
-    //    }
-    //    // end move;
-    //
-    
-    
-    
-    
-    sqlite3 *db = [iSalesDB get_db];
-    
-    NSString* drop_model =@"DROP TABLE IF EXISTS MODEL;";
-    NSString* drop_IMAGE =@"DROP TABLE IF EXISTS model_image;";
-    NSString* drop_image_price =@"DROP TABLE IF EXISTS model_price;";
-    NSString* drop_category =@"DROP TABLE IF EXISTS category;";
-    NSString* drop_login =@"DROP TABLE IF EXISTS offline_login;";
-    NSString* drop_cart =@"DROP TABLE IF EXISTS offline_cart;";
-    NSString* drop_wish =@"DROP TABLE IF EXISTS offline_wishlist;";
-    NSString* drop_contact =@"DROP TABLE IF EXISTS offline_contact;";
-    NSString* drop_contact_image =@"DROP TABLE IF EXISTS contact_image;";
-    
-    
-    [iSalesDB execSql:drop_model db:db];
-    [iSalesDB execSql:drop_IMAGE db:db];
-    [iSalesDB execSql:drop_image_price db:db];
-    [iSalesDB execSql:drop_category db:db];
-    [iSalesDB execSql:drop_login db:db];
-    [iSalesDB execSql:drop_cart db:db];
-    [iSalesDB execSql:drop_wish db:db];
-    [iSalesDB execSql:drop_contact db:db];
-    [iSalesDB execSql:drop_contact_image db:db];
-    
-    NSString* create_model=@"CREATE TABLE IF NOT EXISTS model ( _id INTEGER PRIMARY KEY, name VARCHAR(20), description VARCHAR(20), product_id INTEGER, color VARCHAR(20), legcolor VARCHAR(20) ,availability INTEGER,  incoming_stock INTEGER , demension VARCHAR(20), seat_height VARCHAR(20), material VARCHAR(20), box_dim VARCHAR(20), volume VARCHAR(20), weight VARCHAR(20), model_set VARCHAR(20), load_ability VARCHAR(20),default_category VARCHAR(20), category VARCHAR(100),fabric_content VARCHAR(20), assembling VARCHAR(20), made_in VARCHAR(20), special_remarks VARCHAR(20),stockUom integer,fashion VARCHAR(20), isnew integer,property_field VARCHAR(20),property_display VARCHAR(20),selector_field VARCHAR(20),selector_display VARCHAR(20),ETA DATE);";
-    
-    
-    
-    NSString* create_image=@"CREATE TABLE IF NOT EXISTS model_image ( _id INTEGER PRIMARY KEY, name VARCHAR(20), url VARCHAR(256), type integer, product_id INTEGER);";
-    
-    NSString* create_model_price=@"CREATE TABLE IF NOT EXISTS model_price ( _id INTEGER PRIMARY KEY, product_id INTEGER,price float , type integer);";
-    NSString* create_category=@"CREATE TABLE IF NOT EXISTS category ( _id INTEGER PRIMARY KEY, code VARCHAR(20),name VARCHAR(20));";
-    
-    NSString* create_offline_login=@"CREATE TABLE IF NOT EXISTS offline_login ( _id INTEGER PRIMARY KEY, username VARCHAR(40),password VARCHAR(40), can_show_price integer ,can_see_price integer,contact_id VARCHAR(20),user_type integer,can_cancel_order integer,can_set_cart_price integer,can_create_portfolio integer, can_delete_order integer,can_submit_order integer,can_set_tearsheet_price integer,can_create_order integer, mode VARCHAR(20), sales_code VARCHAR(20));";
-    
-    
-    
-    NSString* create_offline_cart=@"CREATE TABLE IF NOT EXISTS offline_cart ( _id INTEGER PRIMARY KEY, product_id INTEGER,price float , discount float , so_no VARCHAR(40));";
-    NSString* create_offline_wish=@"CREATE TABLE IF NOT EXISTS offline_wishlist ( _id INTEGER PRIMARY KEY, product_id INTEGER);";
-    
-    NSString* create_offline_contact=@"CREATE TABLE IF NOT EXISTS offline_contact ( _id INTEGER PRIMARY KEY, country VARCHAR(40),company_name VARCHAR(40),contact_id VARCHAR(20),addr_1 text, addr_2 text , addr_3 text, addr_4 text, zipcode varchar(20),state  VARCHAR(40), city VARCHAR(40), first_name VARCHAR(40) ,last_name  VARCHAR(40),phone VARCHAR(40),fax VARCHAR(40),email VARCHAR(40),notes text, price_type  VARCHAR(40), sales_rep VARCHAR(40), type VARCHAR(40),create_time timestamp,editable integer,contact_name VARCHAR(40) , addr text);";
-    
-    NSString* create_contact_image=@"CREATE TABLE IF NOT EXISTS contact_image ( _id INTEGER PRIMARY KEY, name VARCHAR(20), url VARCHAR(256),  contact_id VARCHAR(20));";
-    
-    
-    //   NSString* create_model_category=@"CREATE TABLE IF NOT EXISTS model_category ( _id INTEGER PRIMARY KEY, product_id INTEGER,code VARCHAR(20));";
-    
-    //        CREATE TABLE users (_id integer PRIMARY KEY,name varchar(20),pass varchar(20));
-    //        [self execSql:create_actions_info db:db];
-    //        [self execSql:create_fields_info db:db];
-    //        [self execSql:create_search_history db:db];
-    //        [self execSql:create_push_message db:db];
-    //        [self execSql:create_favorites db:db];
-    //        [self execSql:create_history db:db];
-    //        [self execSql:create_location db:db];
-    [iSalesDB execSql:create_model db:db];
-    
-    [iSalesDB execSql:create_image db:db];
-    
-    [iSalesDB execSql:create_model_price db:db];
-    [iSalesDB execSql:create_category db:db];
-    
-    [iSalesDB execSql:create_offline_login db:db];
-    
-    [iSalesDB execSql:create_offline_cart db:db];
-    [iSalesDB execSql:create_offline_wish db:db];
-    
-    
-    [iSalesDB execSql:create_offline_contact db:db];
-    
-    [iSalesDB execSql:create_contact_image db:db];
-    
-    NSString * insert_user_queeniey=@"insert into offline_login(can_show_price,can_see_price,contact_id,user_type,can_cancel_order,can_set_cart_price,can_create_portfolio,can_delete_order,can_submit_order,can_set_tearsheet_price,can_create_order,mode,username,password) values(1,1,'NPD',1,1,1,1,1,1,1,1,'Regular Mode','QueenieY','lj0EPk2Th9zZCVwrcskZOA==')";
-    [iSalesDB execSql:insert_user_queeniey db:db];
-    //   [self execSql:create_model_category db:db];
-    
-    //        if( ![self checkForField:@"search_history" field:@"level" db:db])
-    //        {
-    //            NSString* alter_search_history = @"ALTER TABLE search_history ADD level INTEGER";
-    //            [self execSql:alter_search_history db:db];
-    //        }
-    //        NSTimeInterval time=[[NSDate date] timeIntervalSince1970];
-    //        double t = time-2592000;      //NSTimeInterval返回的是double类型
-    //        NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
-    //        [formatter setDateFormat:@"yyyy-MM-dd"];
-    //
-    //        NSString*timestr=[formatter stringFromDate:[NSDate dateWithTimeIntervalSince1970:t]];
-    //
-    //    //    [self execSql:[NSString stringWithFormat:@"delete from search_history where h_time<%@",timestr ] db:db];
-    //        [self execSql:@"delete from search_history where julianday('now', 'localtime')-julianday(h_time, 'localtime')>30" db:db];
-    //  int ret=sqlite3_close(db);
-    
-    
-    DebugLog (@"bottom of initializeDb");
-    
-    
-    NSString* IMS_S=@"http://113.28.30.235:80/site//u/NPD/20150715/3857_1455_s.jpg";
-    //NSString* IMS_M=@"http://113.28.30.235:80/site//u/NPD/20150715/3857_1455_m.jpg";
-    NSString* IMS_L=@"http://113.28.30.235:80/site//u/NPD/20150715/3857_1455_l.jpg";
-    
-    //----------------- fill data -------------------
-    NSString* img_url1 = IMS_S;
-    //   NSString* img_url2 = IMS_M;
-    NSString* img_url3 = IMS_L;
-    
-    CFAbsoluteTime start = CFAbsoluteTimeGetCurrent();
-    [iSalesDB execSql:@"begin" db:db];
-    //   NSString* exec = @"";
-    for(int i=0;i<1000;i++)
-    {
-        
-        int category = arc4random() % 4;
-        NSString* sql = [NSString stringWithFormat:@"insert into model(ETA,property_display,property_field,selector_display,isnew,selector_field,fashion,stockUom,name,description,product_id,color,legcolor,availability,incoming_stock,demension,seat_height,material,box_dim,volume,weight,model_set,load_ability,default_category,category,fabric_content,assembling,made_in,special_remarks) values('07/13/2016','Leg Color','legcolor','Color',1,'color','108526-48-BS%d',1,'108526-48-BS%d','Charlotte Fabric Counter Stool Brushed Smoke Legs, Putty%d',%d,'red color%d','white color%d',15%d,25%d,'20.00\"w  22.00\"d  39.00\"h%d','26.0\"h','Solid Birch Wood%d','20.50\"w  23.00\"d  40.00\"h',10.91%d,23.00%d,'Sold in quantities of 1','Load ability%d','%d','%d','77%% Polyester, 15%% Cotton, 8%% Linen', 'Fully Assembled;%d','China%d','Special Remarks%d');",i,i,i,i,i,i,i,i,i,i,i,i,i,category,category,i,i,i];
-        
-        
-        NSString* sql_1=[NSString stringWithFormat:@"insert into model_price (product_id,price,type) values(%d,12.%d,0);",i,i%100];
-        NSString* sql_2=[NSString stringWithFormat:@"insert into model_price (product_id,price,type) values(%d,12.%d,1);",i,i%100];
-        NSString* sql_3=[NSString stringWithFormat:@"insert into model_price (product_id,price,type) values(%d,12.%d,2);",i,i%100];
-        
-        
-        
-        NSString* sql_4=[NSString stringWithFormat:@"insert into model_image(product_id,type,url) values(%d,0,'%@')",i,img_url1];
-        NSString* sql_5=[NSString stringWithFormat:@"insert into model_image(product_id,type,url) values(%d,1,'%@')",i,img_url3];
-        
-        //        exec=[exec stringByAppendingString:sql];
-        //
-        //        exec=[exec stringByAppendingString:sql_1];
-        //        exec=[exec stringByAppendingString:sql_2];
-        //        exec=[exec stringByAppendingString:sql_3];
-        
-        
-        [iSalesDB execSql:sql db:db];
-        
-        [iSalesDB execSql:sql_1 db:db];
-        [iSalesDB execSql:sql_2 db:db];
-        [iSalesDB execSql:sql_3 db:db];
-        [iSalesDB execSql:sql_4 db:db];
-        [iSalesDB execSql:sql_5 db:db];
-        
-    }
-    //    [iSalesDB execSql:exec db:db];
-    
-    [iSalesDB execSql:@"update model set category='#001003#;' where category='0'" db:db];
-    [iSalesDB execSql:@"update model set category='#001001#;' where category='1'" db:db];
-    [iSalesDB execSql:@"update model set category='#001002#;' where category='2'" db:db];
-    [iSalesDB execSql:@"update model set category='#001003#;' where category='3'" db:db];
-    [iSalesDB execSql:@"commit" db:db];
-    sqlite3_close(db);
-    
-    CFAbsoluteTime end = CFAbsoluteTimeGetCurrent();
-    
-    //  ((double)(begintime-endtime))/(1000*1000);
-    NSLog(@"time cost: %0.3f", end - start);
-    
-    
-    
-    
-    
-    
-}
+//+(void)testdata
+//{
+//    
+//    //---------------- init db --------------------
+//    //    NSString* date;
+//    //    NSDateFormatter* formatter = [[NSDateFormatter alloc]init];
+//    //    [formatter setDateFormat:@"YYYY-MM-dd-hh-mm-ss"];
+//    //    date = [formatter stringFromDate:[NSDate date]];
+//    //
+//    //    NSString* dbname=[NSString stringWithFormat:@"%@.db",date];
+//    //
+//    //    DebugLog (@"initializeDB");
+//    //
+//    //    //   NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
+//    //    NSString *documents = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];//[paths objectAtIndex:0];
+//    //    NSString *database_path = [documents stringByAppendingPathComponent:dbname];
+//    //
+//    //
+//    //    // move db file from document to cache ;
+//    //    //   NSArray *searchPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
+//    //    NSString *documentFolderPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] ;//[searchPaths objectAtIndex: 0];
+//    //    NSString* dbFilePath = [documentFolderPath stringByAppendingPathComponent:dbname];
+//    //    if ([[NSFileManager defaultManager] fileExistsAtPath: dbFilePath])
+//    //    {
+//    //        [[NSFileManager defaultManager] moveItemAtPath:dbFilePath toPath:database_path error:nil];
+//    //
+//    //    }
+//    //    // end move;
+//    //
+//    
+//    
+//    
+//    
+//    sqlite3 *db = [iSalesDB get_db];
+//    
+//    NSString* drop_model =@"DROP TABLE IF EXISTS MODEL;";
+//    NSString* drop_IMAGE =@"DROP TABLE IF EXISTS model_image;";
+//    NSString* drop_image_price =@"DROP TABLE IF EXISTS model_price;";
+//    NSString* drop_category =@"DROP TABLE IF EXISTS category;";
+//    NSString* drop_login =@"DROP TABLE IF EXISTS offline_login;";
+//    NSString* drop_cart =@"DROP TABLE IF EXISTS offline_cart;";
+//    NSString* drop_wish =@"DROP TABLE IF EXISTS offline_wishlist;";
+//    NSString* drop_contact =@"DROP TABLE IF EXISTS offline_contact;";
+//    NSString* drop_contact_image =@"DROP TABLE IF EXISTS contact_image;";
+//    
+//    
+//    [iSalesDB execSql:drop_model db:db];
+//    [iSalesDB execSql:drop_IMAGE db:db];
+//    [iSalesDB execSql:drop_image_price db:db];
+//    [iSalesDB execSql:drop_category db:db];
+//    [iSalesDB execSql:drop_login db:db];
+//    [iSalesDB execSql:drop_cart db:db];
+//    [iSalesDB execSql:drop_wish db:db];
+//    [iSalesDB execSql:drop_contact db:db];
+//    [iSalesDB execSql:drop_contact_image db:db];
+//    
+//    NSString* create_model=@"CREATE TABLE IF NOT EXISTS model ( _id INTEGER PRIMARY KEY, name VARCHAR(20), description VARCHAR(20), product_id INTEGER, color VARCHAR(20), legcolor VARCHAR(20) ,availability INTEGER,  incoming_stock INTEGER , demension VARCHAR(20), seat_height VARCHAR(20), material VARCHAR(20), box_dim VARCHAR(20), volume VARCHAR(20), weight VARCHAR(20), model_set VARCHAR(20), load_ability VARCHAR(20),default_category VARCHAR(20), category VARCHAR(100),fabric_content VARCHAR(20), assembling VARCHAR(20), made_in VARCHAR(20), special_remarks VARCHAR(20),stockUom integer,fashion VARCHAR(20), isnew integer,property_field VARCHAR(20),property_display VARCHAR(20),selector_field VARCHAR(20),selector_display VARCHAR(20),ETA DATE);";
+//    
+//    
+//    
+//    NSString* create_image=@"CREATE TABLE IF NOT EXISTS model_image ( _id INTEGER PRIMARY KEY, name VARCHAR(20), url VARCHAR(256), type integer, product_id INTEGER);";
+//    
+//    NSString* create_model_price=@"CREATE TABLE IF NOT EXISTS model_price ( _id INTEGER PRIMARY KEY, product_id INTEGER,price float , type integer);";
+//    NSString* create_category=@"CREATE TABLE IF NOT EXISTS category ( _id INTEGER PRIMARY KEY, code VARCHAR(20),name VARCHAR(20));";
+//    
+//    NSString* create_offline_login=@"CREATE TABLE IF NOT EXISTS offline_login ( _id INTEGER PRIMARY KEY, username VARCHAR(40),password VARCHAR(40), can_show_price integer ,can_see_price integer,contact_id VARCHAR(20),user_type integer,can_cancel_order integer,can_set_cart_price integer,can_create_portfolio integer, can_delete_order integer,can_submit_order integer,can_set_tearsheet_price integer,can_create_order integer, mode VARCHAR(20), sales_code VARCHAR(20));";
+//    
+//    
+//    
+//    NSString* create_offline_cart=@"CREATE TABLE IF NOT EXISTS offline_cart ( _id INTEGER PRIMARY KEY, product_id INTEGER,price float , discount float , so_no VARCHAR(40));";
+//    NSString* create_offline_wish=@"CREATE TABLE IF NOT EXISTS offline_wishlist ( _id INTEGER PRIMARY KEY, product_id INTEGER);";
+//    
+//    NSString* create_offline_contact=@"CREATE TABLE IF NOT EXISTS offline_contact ( _id INTEGER PRIMARY KEY, country VARCHAR(40),company_name VARCHAR(40),contact_id VARCHAR(20),addr_1 text, addr_2 text , addr_3 text, addr_4 text, zipcode varchar(20),state  VARCHAR(40), city VARCHAR(40), first_name VARCHAR(40) ,last_name  VARCHAR(40),phone VARCHAR(40),fax VARCHAR(40),email VARCHAR(40),notes text, price_type  VARCHAR(40), sales_rep VARCHAR(40), type VARCHAR(40),create_time timestamp,editable integer,contact_name VARCHAR(40) , addr text);";
+//    
+//    NSString* create_contact_image=@"CREATE TABLE IF NOT EXISTS contact_image ( _id INTEGER PRIMARY KEY, name VARCHAR(20), url VARCHAR(256),  contact_id VARCHAR(20));";
+//    
+//    
+//    //   NSString* create_model_category=@"CREATE TABLE IF NOT EXISTS model_category ( _id INTEGER PRIMARY KEY, product_id INTEGER,code VARCHAR(20));";
+//    
+//    //        CREATE TABLE users (_id integer PRIMARY KEY,name varchar(20),pass varchar(20));
+//    //        [self execSql:create_actions_info db:db];
+//    //        [self execSql:create_fields_info db:db];
+//    //        [self execSql:create_search_history db:db];
+//    //        [self execSql:create_push_message db:db];
+//    //        [self execSql:create_favorites db:db];
+//    //        [self execSql:create_history db:db];
+//    //        [self execSql:create_location db:db];
+//    [iSalesDB execSql:create_model db:db];
+//    
+//    [iSalesDB execSql:create_image db:db];
+//    
+//    [iSalesDB execSql:create_model_price db:db];
+//    [iSalesDB execSql:create_category db:db];
+//    
+//    [iSalesDB execSql:create_offline_login db:db];
+//    
+//    [iSalesDB execSql:create_offline_cart db:db];
+//    [iSalesDB execSql:create_offline_wish db:db];
+//    
+//    
+//    [iSalesDB execSql:create_offline_contact db:db];
+//    
+//    [iSalesDB execSql:create_contact_image db:db];
+//    
+//    NSString * insert_user_queeniey=@"insert into offline_login(can_show_price,can_see_price,contact_id,user_type,can_cancel_order,can_set_cart_price,can_create_portfolio,can_delete_order,can_submit_order,can_set_tearsheet_price,can_create_order,mode,username,password) values(1,1,'NPD',1,1,1,1,1,1,1,1,'Regular Mode','QueenieY','lj0EPk2Th9zZCVwrcskZOA==')";
+//    [iSalesDB execSql:insert_user_queeniey db:db];
+//    //   [self execSql:create_model_category db:db];
+//    
+//    //        if( ![self checkForField:@"search_history" field:@"level" db:db])
+//    //        {
+//    //            NSString* alter_search_history = @"ALTER TABLE search_history ADD level INTEGER";
+//    //            [self execSql:alter_search_history db:db];
+//    //        }
+//    //        NSTimeInterval time=[[NSDate date] timeIntervalSince1970];
+//    //        double t = time-2592000;      //NSTimeInterval返回的是double类型
+//    //        NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
+//    //        [formatter setDateFormat:@"yyyy-MM-dd"];
+//    //
+//    //        NSString*timestr=[formatter stringFromDate:[NSDate dateWithTimeIntervalSince1970:t]];
+//    //
+//    //    //    [self execSql:[NSString stringWithFormat:@"delete from search_history where h_time<%@",timestr ] db:db];
+//    //        [self execSql:@"delete from search_history where julianday('now', 'localtime')-julianday(h_time, 'localtime')>30" db:db];
+//    //  int ret=sqlite3_close(db);
+//    
+//    
+//    DebugLog (@"bottom of initializeDb");
+//    
+//    
+//    NSString* IMS_S=@"http://113.28.30.235:80/site//u/NPD/20150715/3857_1455_s.jpg";
+//    //NSString* IMS_M=@"http://113.28.30.235:80/site//u/NPD/20150715/3857_1455_m.jpg";
+//    NSString* IMS_L=@"http://113.28.30.235:80/site//u/NPD/20150715/3857_1455_l.jpg";
+//    
+//    //----------------- fill data -------------------
+//    NSString* img_url1 = IMS_S;
+//    //   NSString* img_url2 = IMS_M;
+//    NSString* img_url3 = IMS_L;
+//    
+//    CFAbsoluteTime start = CFAbsoluteTimeGetCurrent();
+//    [iSalesDB execSql:@"begin" db:db];
+//    //   NSString* exec = @"";
+//    for(int i=0;i<1000;i++)
+//    {
+//        
+//        int category = arc4random() % 4;
+//        NSString* sql = [NSString stringWithFormat:@"insert into model(ETA,property_display,property_field,selector_display,isnew,selector_field,fashion,stockUom,name,description,product_id,color,legcolor,availability,incoming_stock,demension,seat_height,material,box_dim,volume,weight,model_set,load_ability,default_category,category,fabric_content,assembling,made_in,special_remarks) values('07/13/2016','Leg Color','legcolor','Color',1,'color','108526-48-BS%d',1,'108526-48-BS%d','Charlotte Fabric Counter Stool Brushed Smoke Legs, Putty%d',%d,'red color%d','white color%d',15%d,25%d,'20.00\"w  22.00\"d  39.00\"h%d','26.0\"h','Solid Birch Wood%d','20.50\"w  23.00\"d  40.00\"h',10.91%d,23.00%d,'Sold in quantities of 1','Load ability%d','%d','%d','77%% Polyester, 15%% Cotton, 8%% Linen', 'Fully Assembled;%d','China%d','Special Remarks%d');",i,i,i,i,i,i,i,i,i,i,i,i,i,category,category,i,i,i];
+//        
+//        
+//        NSString* sql_1=[NSString stringWithFormat:@"insert into model_price (product_id,price,type) values(%d,12.%d,0);",i,i%100];
+//        NSString* sql_2=[NSString stringWithFormat:@"insert into model_price (product_id,price,type) values(%d,12.%d,1);",i,i%100];
+//        NSString* sql_3=[NSString stringWithFormat:@"insert into model_price (product_id,price,type) values(%d,12.%d,2);",i,i%100];
+//        
+//        
+//        
+//        NSString* sql_4=[NSString stringWithFormat:@"insert into model_image(product_id,type,url) values(%d,0,'%@')",i,img_url1];
+//        NSString* sql_5=[NSString stringWithFormat:@"insert into model_image(product_id,type,url) values(%d,1,'%@')",i,img_url3];
+//        
+//        //        exec=[exec stringByAppendingString:sql];
+//        //
+//        //        exec=[exec stringByAppendingString:sql_1];
+//        //        exec=[exec stringByAppendingString:sql_2];
+//        //        exec=[exec stringByAppendingString:sql_3];
+//        
+//        
+//        [iSalesDB execSql:sql db:db];
+//        
+//        [iSalesDB execSql:sql_1 db:db];
+//        [iSalesDB execSql:sql_2 db:db];
+//        [iSalesDB execSql:sql_3 db:db];
+//        [iSalesDB execSql:sql_4 db:db];
+//        [iSalesDB execSql:sql_5 db:db];
+//        
+//    }
+//    //    [iSalesDB execSql:exec db:db];
+//    
+//    [iSalesDB execSql:@"update model set category='#001003#;' where category='0'" db:db];
+//    [iSalesDB execSql:@"update model set category='#001001#;' where category='1'" db:db];
+//    [iSalesDB execSql:@"update model set category='#001002#;' where category='2'" db:db];
+//    [iSalesDB execSql:@"update model set category='#001003#;' where category='3'" db:db];
+//    [iSalesDB execSql:@"commit" db:db];
+//    sqlite3_close(db);
+//    
+//    CFAbsoluteTime end = CFAbsoluteTimeGetCurrent();
+//    
+//    //  ((double)(begintime-endtime))/(1000*1000);
+//    NSLog(@"time cost: %0.3f", end - start);
+//    
+//    
+//    
+//    
+//    
+//    
+//}
 + (sqlite3*) get_db
 {
     sqlite3* db = nil;
@@ -580,9 +605,9 @@ void decryptfield (sqlite3_context *context, int argc, sqlite3_value **argv) {
         NSString* create_offline_setting=@"CREATE TABLE IF NOT EXISTS offline_setting ( _id INTEGER PRIMARY KEY, name VARCHAR(20),value VARCHAR(40));";
         
         
-        NSString* create_offline_login=@"CREATE TABLE IF NOT EXISTS offline_login ( _id INTEGER PRIMARY KEY, username VARCHAR(40),password VARCHAR(40), can_show_price integer ,can_see_price integer,contact_id VARCHAR(20),user_type integer,can_cancel_order integer,can_set_cart_price integer,can_create_portfolio integer, can_delete_order integer,can_submit_order integer,can_set_tearsheet_price integer,can_create_order integer, mode VARCHAR(20), default_price text, price text, user_id integer);";
+        NSString* create_offline_login=@"CREATE TABLE IF NOT EXISTS offline_login ( _id INTEGER PRIMARY KEY, username VARCHAR(40),password VARCHAR(40), can_show_price integer ,can_see_price integer,contact_id VARCHAR(20),user_type integer,can_cancel_order integer,can_set_cart_price integer,can_create_portfolio integer, can_delete_order integer,can_submit_order integer,can_set_tearsheet_price integer,can_create_order integer, mode VARCHAR(20), default_price text, price text, user_id integer,sales_code text);";
     
-     NSString* create_offline_order=@"CREATE TABLE IF NOT EXISTS offline_order ( _id INTEGER PRIMARY KEY, order_id text not null,status integer, general_notes TEXT ,internal_notes text,signature  text,user_type integer,contact_id text,sales_code TEXT,user_id integer, create_time TIMESTAMP default (datetime('now', 'localtime')));";
+     NSString* create_offline_order=@"CREATE TABLE IF NOT EXISTS offline_order ( _id INTEGER PRIMARY KEY,so_id text, order_id text ,status integer, general_notes TEXT ,internal_notes text,signature  text,user_type integer,contact_id text,sales_rep TEXT,create_by TEXT, total_price float, create_time TIMESTAMP default (datetime('now', 'localtime')));";
     
 
         
@@ -629,11 +654,11 @@ void decryptfield (sqlite3_context *context, int argc, sqlite3_value **argv) {
         
         [self execSql:create_login_info db:db];
         
-        //        if( ![self checkForField:@"search_history" field:@"level" db:db])
-        //        {
-        //            NSString* alter_search_history = @"ALTER TABLE search_history ADD level INTEGER";
-        //            [self execSql:alter_search_history db:db];
-        //        }
+                if( ![self checkForField:@"offline_login" field:@"sales_code" db:db])
+                {
+                    NSString* alter_search_history = @"ALTER TABLE offline_login ADD sales_code text";
+                    [self execSql:alter_search_history db:db];
+                }
         //        NSTimeInterval time=[[NSDate date] timeIntervalSince1970];
         //        double t = time-2592000;      //NSTimeInterval返回的是double类型
         //        NSDateFormatter *formatter = [[NSDateFormatter alloc] init];

Diferenças do arquivo suprimidas por serem muito extensas
+ 195 - 185
RedAnt ERP Mobile/common/data_provider/iSalesNetwork.m


+ 169 - 169
RedAnt ERP Mobile/iSales-NPD/config.h

@@ -20,209 +20,209 @@
 #define LOCAL_URL_CUSTOMER_INFO_EDIT @"customer_info_template_edit"
 
 
+//
+////------------------- chen server-----------------------
+//#define  URL_UPDATE_AUTH  @"http://192.168.0.111:8080/site/isales/login.htm"
+//#define  URL_LOGOUT  @"http://192.168.0.111:8080/site/isales/loginOut.htm"
+//#define  URL_RETRIEVE_PASS  @"http://192.168.0.111:8080/site/isales/forgotPassword.htm"
+//
+//#define  URL_REQUEST_CATMENU  @"http://192.168.0.111:8080/site/isales/menu.htm"
+//#define  URL_LOAD_HOME  @"http://192.168.0.111:8080/site/isales/homePage.htm"
+//#define  URL_CATEGORY @"http://192.168.0.111:8080/site/isales/distinctCategory.htm"
+//#define  URL_SEARCH  @"http://192.168.0.111:8080/site/isales/search.htm"
+//#define  URL_ITEM_SEARCH  @"http://192.168.0.111:8080/site/isales/itemSearch.htm"
+//#define  URL_CATEGORY_LOADMORE  @"http://192.168.0.111:8080/site/isales/categoryMore.htm"
+//#define  URL_CUSTOMER_ADV_SEARCH @"http://192.168.0.111:8080/site/isales/getContactAdvance.htm"
+//
+//
+//#define  URL_ORDER_LIST  @"http://192.168.0.111:8080/site/isales/orderList.htm"
+//#define  URL_ORDER_DETAIL  @"http://192.168.0.111:8080/site/isales/orderDetail.htm"
+//#define URL_COMMIT_ORDER @"http://192.168.0.111:8080/site/isales/createOrder.htm"
+//#define URL_COPY_ORDER @"http://192.168.0.111:8080/site/isales/copyOrder.htm"
+//#define URL_SIGN_ORDER @"http://192.168.0.111:8080/site/isales/updateOrderSign.htm"
+//#define URL_SAVE_ORDER @"http://192.168.0.111:8080/site/isales/saveOrder.htm"
+//#define URL_UPDATE_ORDERCUSTOMER @"http://192.168.0.111:8080/site/isales/updateOrderCustomerInfo.htm"
+//#define  URL_NEW_ORDER  @"http://192.168.0.111:8080/site/isales/createNewOrder.htm"
+//#define  URL_OPEN_ORDER  @"http://192.168.0.111:8080/site/isales/openOrder.htm"
+//#define  URL_RELEASE_ORDER  @"http://192.168.0.111:8080/site/isales/closeOrder.htm"
+//#define  URL_DELETE_ORDER  @"http://192.168.0.111:8080/site/isales/deleteOrder.htm"
+//#define  URL_CANCEL_ORDER  @"http://192.168.0.111:8080/site/isales/cancelOrder.htm"
+//
+//
+//#define  URL_CART_SET_PRICE  @"http://192.168.0.111:8080/site/isales/setPrice.htm"
+//#define  URL_CART_ITEM_NOTES  @"http://192.168.0.111:8080/site/isales/setItemNotes.htm"
+//#define  URL_CART_GENERAL_NOTES  @"http://192.168.0.111:8080/site/isales/updateGeneralNote.htm"
+//
+//#define  URL_CART_INCRESEMENT  @"http://192.168.0.111:8080/site/isales/increment.htm"
+//#define  URL_CART  @"http://192.168.0.111:8080/site/isales/cartDtail.htm"
+//#define  URL_CARTDELIVERY  @"http://192.168.0.111:8080/site/isales/cartDelivery.htm"
+//#define  URL_ADD_TO_CART  @"http://192.168.0.111:8080/site/isales/addToCart.htm"
+//#define  URL_CART_REMOVE  @"http://192.168.0.111:8080/site/isales/deleteToCart.htm"
+//#define  URL_CART_CHECK  @"http://192.168.0.111:8080/site/isales/checkCartItem.htm"
+//#define  URL_CART2WISH  @"http://192.168.0.111:8080/site/isales/cartRemoveToWishlist.htm"
+//#define  URL_WISH2CART  @"http://192.168.0.111:8080/site/isales/wishlistRemoveToCart.htm"
+//
+//
+//
+//
+//#define  URL_ITEM_DETAIL  @"http://192.168.0.111:8080/site/isales/modelDetail.htm"
+//
+//#define  URL_ADD_TO_WATCHLIST  @"http://192.168.0.111:8080/site/isales/addToWishList.htm"
+//#define  URL_WATCHLIST  @"http://192.168.0.111:8080/site/isales/wishList.htm"
+//#define  URL_WATCHLIST_REMOVE  @"http://192.168.0.111:8080/site/isales/deleteToWishList.htm"
+//
+//
+//
+//#define  URL_ADD_TO_PORTFOLIO @"http://192.168.0.111:8080/site/isales/addToPortfolio.htm"
+//#define  URL_PORTFOLIO_REMOVE  @"http://192.168.0.111:8080/site/isales/deleteToPortfolio.htm"
+//#define  URL_PORTFOLIOLIST_REMOVE  @"http://192.168.0.111:8080/site/isales/deleteTearSheetPdf.htm"
+//#define  URL_PORTFOLIO  @"http://192.168.0.111:8080/site/isales/portfolios.htm"
+//#define  URL_PORTFOLIO_SET_PRICE  @"http://192.168.0.111:8080/site/isales/setTearSheetPrice.htm"
+//#define  URL_DM_PARAMS @"http://192.168.0.111:8080/site/isales/selectTearSheetParam.htm"
+//#define  URL_REQUEST_DM @"http://192.168.0.111:8080/site/isales/getTearSheetPdf.htm"
+//#define  URL_SAVE_DM_DIRECT @"http://192.168.0.111:8080/site/isales/getTearSheetPdf.htm"
+//#define  URL_SAVE_DM @"http://192.168.0.111:8080/site/isales/saveTearSheetPdf.htm"
+//#define  URL_DM_LIST @"http://192.168.0.111:8080/site/isales/tearSheetPdfList.htm"
+////#define  URL_DM_SET_QTY @"http://192.168.0.111:8080/site/isales/setTearSheetAvailableQty.htm"
+//#define  URL_REQUEST_MODEL_QTY @"http://192.168.0.111:8080/site/isales/getTearSheetAvailableQty.htm"
+//
+//#define  URL_CONTACT_LIST  @"http://192.168.0.111:8080/site/isales/getAllContact.htm"
+//#define  URL_SHIPTO_LIST  @"http://192.168.0.111:8080/site/isales/getShipToContact.htm"
+//
+//#define  URL_ADDRESS_EDOTOR  @"http://192.168.0.111:8080/site/isales/getAddAddress.htm"
+//#define  URL_ADDRESS_SAVE  @"http://192.168.0.111:8080/site/isales/saveAddress.htm"
+//
+//
+//#define  URL_CREDITCARD_EDOTOR  @"http://192.168.0.111:8080/site/isales/creditCard.htm"
+//#define  URL_CREDITCARD_SAVE  @"http://192.168.0.111:8080/site/isales/saveAddress.htm"
+//
+//
+//
+//#define  URL_CUSTOMER_INFO  @"http://192.168.0.111:8080/site/isales/getCustomerInfoByContact.htm"
+//#define  URL_CUSTOMER_PENDINGORDER  @"http://192.168.0.111:8080/site/isales/hasPendingOrderByContact.htm"
+//#define  URL_NEW_CUSTOMER  @"http://192.168.0.111:8080/site/isales/getAddCustomer.htm"
+//#define  URL_EDIT_CUSTOMER  @"http://192.168.0.111:8080/site/isales/getUpdateCustomerInfoByContact.htm"
+//#define  URL_CUSTOMER_SAVE  @"http://192.168.0.111:8080/site/isales/saveCustomer.htm"
+//#define  URL_CUSTOMER_UPDATE  @"http://192.168.0.111:8080/site/isales/updateCustomer.htm"
+//#define  URL_UPDATE_CUSTOMER_BCARD  @"http://192.168.0.111:8080/site/isales/updateCustomerBusiCard.htm"
+//
+//
+//
+//
+//
+//
+//#define  URL_ERR_LOG  @"http://192.168.0.111:8080/site/isales/er_log.htm"
+//
+//#define  URL_UPLOAD_IMG  @"http://192.168.0.111:8080/site/isales/uploadImg.htm"
+//
+//#define  URL_NPD_POLICY  @"http://192.168.0.111:8080/site/isales/generalPolicy.htm"
+//
+//
+//#define  URL_CHECK_OFFLINE  @"http://192.168.0.111:8080/site/offline/initDatas.htm"
+//
+//#define  URL_DOWNLOAD_OFFLINE  @"http://192.168.0.111:8080/site/offline/downloadDatas.htm"
 
-//------------------- chen server-----------------------
-#define  URL_UPDATE_AUTH  @"http://192.168.0.116:8080/site/isales/login.htm"
-#define  URL_LOGOUT  @"http://192.168.0.116:8080/site/isales/loginOut.htm"
-#define  URL_RETRIEVE_PASS  @"http://192.168.0.116:8080/site/isales/forgotPassword.htm"
 
-#define  URL_REQUEST_CATMENU  @"http://192.168.0.116:8080/site/isales/menu.htm"
-#define  URL_LOAD_HOME  @"http://192.168.0.116:8080/site/isales/homePage.htm"
-#define  URL_CATEGORY @"http://192.168.0.116:8080/site/isales/distinctCategory.htm"
-#define  URL_SEARCH  @"http://192.168.0.116:8080/site/isales/search.htm"
-#define  URL_ITEM_SEARCH  @"http://192.168.0.116:8080/site/isales/itemSearch.htm"
-#define  URL_CATEGORY_LOADMORE  @"http://192.168.0.116:8080/site/isales/categoryMore.htm"
-#define  URL_CUSTOMER_ADV_SEARCH @"http://192.168.0.116:8080/site/isales/getContactAdvance.htm"
 
+//------------------- NPD server-----------------------
+#define  URL_UPDATE_AUTH  @"https://www.newpacificdirect.com/isales/login.htm"
+#define  URL_LOGOUT  @"https://www.newpacificdirect.com/isales/loginOut.htm"
+#define  URL_RETRIEVE_PASS  @"https://www.newpacificdirect.com/isales/forgotPassword.htm"
 
-#define  URL_ORDER_LIST  @"http://192.168.0.116:8080/site/isales/orderList.htm"
-#define  URL_ORDER_DETAIL  @"http://192.168.0.116:8080/site/isales/orderDetail.htm"
-#define URL_COMMIT_ORDER @"http://192.168.0.116:8080/site/isales/createOrder.htm"
-#define URL_COPY_ORDER @"http://192.168.0.116:8080/site/isales/copyOrder.htm"
-#define URL_SIGN_ORDER @"http://192.168.0.116:8080/site/isales/updateOrderSign.htm"
-#define URL_SAVE_ORDER @"http://192.168.0.116:8080/site/isales/saveOrder.htm"
-#define URL_UPDATE_ORDERCUSTOMER @"http://192.168.0.116:8080/site/isales/updateOrderCustomerInfo.htm"
-#define  URL_NEW_ORDER  @"http://192.168.0.116:8080/site/isales/createNewOrder.htm"
-#define  URL_OPEN_ORDER  @"http://192.168.0.116:8080/site/isales/openOrder.htm"
-#define  URL_RELEASE_ORDER  @"http://192.168.0.116:8080/site/isales/closeOrder.htm"
-#define  URL_DELETE_ORDER  @"http://192.168.0.116:8080/site/isales/deleteOrder.htm"
-#define  URL_CANCEL_ORDER  @"http://192.168.0.116:8080/site/isales/cancelOrder.htm"
+#define  URL_REQUEST_CATMENU  @"https://www.newpacificdirect.com/isales/menu.htm"
+#define  URL_LOAD_HOME  @"https://www.newpacificdirect.com/isales/homePage.htm"
+#define  URL_CATEGORY @"https://www.newpacificdirect.com/isales/distinctCategory.htm"
+#define  URL_SEARCH  @"https://www.newpacificdirect.com/isales/search.htm"
+#define  URL_ITEM_SEARCH  @"https://www.newpacificdirect.com/isales/itemSearch.htm"
+#define  URL_CATEGORY_LOADMORE  @"https://www.newpacificdirect.com/isales/categoryMore.htm"
 
 
-#define  URL_CART_SET_PRICE  @"http://192.168.0.116:8080/site/isales/setPrice.htm"
-#define  URL_CART_ITEM_NOTES  @"http://192.168.0.116:8080/site/isales/setItemNotes.htm"
-#define  URL_CART_GENERAL_NOTES  @"http://192.168.0.116:8080/site/isales/updateGeneralNote.htm"
 
-#define  URL_CART_INCRESEMENT  @"http://192.168.0.116:8080/site/isales/increment.htm"
-#define  URL_CART  @"http://192.168.0.116:8080/site/isales/cartDtail.htm"
-#define  URL_CARTDELIVERY  @"http://192.168.0.116:8080/site/isales/cartDelivery.htm"
-#define  URL_ADD_TO_CART  @"http://192.168.0.116:8080/site/isales/addToCart.htm"
-#define  URL_CART_REMOVE  @"http://192.168.0.116:8080/site/isales/deleteToCart.htm"
-#define  URL_CART_CHECK  @"http://192.168.0.116:8080/site/isales/checkCartItem.htm"
-#define  URL_CART2WISH  @"http://192.168.0.116:8080/site/isales/cartRemoveToWishlist.htm"
-#define  URL_WISH2CART  @"http://192.168.0.116:8080/site/isales/wishlistRemoveToCart.htm"
+#define  URL_ORDER_LIST  @"https://www.newpacificdirect.com/isales/orderList.htm"
+#define  URL_ORDER_DETAIL  @"https://www.newpacificdirect.com/isales/orderDetail.htm"
+#define URL_COMMIT_ORDER @"https://www.newpacificdirect.com/isales/createOrder.htm"
+#define URL_SAVE_ORDER @"https://www.newpacificdirect.com/isales/saveOrder.htm"
+#define URL_UPDATE_ORDERCUSTOMER @"https://www.newpacificdirect.com/isales/updateOrderCustomerInfo.htm"
+#define  URL_NEW_ORDER  @"https://www.newpacificdirect.com/isales/createNewOrder.htm"
+#define  URL_OPEN_ORDER  @"https://www.newpacificdirect.com/isales/openOrder.htm"
+#define  URL_RELEASE_ORDER  @"https://www.newpacificdirect.com/isales/closeOrder.htm"
+#define  URL_DELETE_ORDER  @"https://www.newpacificdirect.com/isales/deleteOrder.htm"
+#define  URL_CANCEL_ORDER  @"https://www.newpacificdirect.com/isales/cancelOrder.htm"
 
 
+#define  URL_CART_SET_PRICE  @"https://www.newpacificdirect.com/isales/setPrice.htm"
+#define  URL_CART_INCRESEMENT  @"https://www.newpacificdirect.com/isales/increment.htm"
+#define  URL_CART  @"https://www.newpacificdirect.com/isales/cartDtail.htm"
+#define  URL_CARTDELIVERY  @"https://www.newpacificdirect.com/isales/cartDelivery.htm"
+#define  URL_ADD_TO_CART  @"https://www.newpacificdirect.com/isales/addToCart.htm"
+#define  URL_CART_REMOVE  @"https://www.newpacificdirect.com/isales/deleteToCart.htm"
+#define  URL_CART_CHECK  @"https://www.newpacificdirect.com/isales/checkCartItem.htm"
 
+#define  URL_CART2WISH  @"https://www.newpacificdirect.com/isales/cartRemoveToWishlist.htm"
+#define  URL_WISH2CART  @"https://www.newpacificdirect.com/isales/wishlistRemoveToCart.htm"
 
-#define  URL_ITEM_DETAIL  @"http://192.168.0.116:8080/site/isales/modelDetail.htm"
+#define  URL_ITEM_DETAIL  @"https://www.newpacificdirect.com/isales/modelDetail.htm"
 
-#define  URL_ADD_TO_WATCHLIST  @"http://192.168.0.116:8080/site/isales/addToWishList.htm"
-#define  URL_WATCHLIST  @"http://192.168.0.116:8080/site/isales/wishList.htm"
-#define  URL_WATCHLIST_REMOVE  @"http://192.168.0.116:8080/site/isales/deleteToWishList.htm"
+#define  URL_ADD_TO_WATCHLIST  @"https://www.newpacificdirect.com/isales/addToWishList.htm"
+#define  URL_WATCHLIST  @"https://www.newpacificdirect.com/isales/wishList.htm"
+#define  URL_WATCHLIST_REMOVE  @"https://www.newpacificdirect.com/isales/deleteToWishList.htm"
 
 
 
-#define  URL_ADD_TO_PORTFOLIO @"http://192.168.0.116:8080/site/isales/addToPortfolio.htm"
-#define  URL_PORTFOLIO_REMOVE  @"http://192.168.0.116:8080/site/isales/deleteToPortfolio.htm"
-#define  URL_PORTFOLIOLIST_REMOVE  @"http://192.168.0.116:8080/site/isales/deleteTearSheetPdf.htm"
-#define  URL_PORTFOLIO  @"http://192.168.0.116:8080/site/isales/portfolios.htm"
-#define  URL_PORTFOLIO_SET_PRICE  @"http://192.168.0.116:8080/site/isales/setTearSheetPrice.htm"
-#define  URL_DM_PARAMS @"http://192.168.0.116:8080/site/isales/selectTearSheetParam.htm"
-#define  URL_REQUEST_DM @"http://192.168.0.116:8080/site/isales/getTearSheetPdf.htm"
-#define  URL_SAVE_DM_DIRECT @"http://192.168.0.116:8080/site/isales/getTearSheetPdf.htm"
-#define  URL_SAVE_DM @"http://192.168.0.116:8080/site/isales/saveTearSheetPdf.htm"
-#define  URL_DM_LIST @"http://192.168.0.116:8080/site/isales/tearSheetPdfList.htm"
-//#define  URL_DM_SET_QTY @"http://192.168.0.116:8080/site/isales/setTearSheetAvailableQty.htm"
-#define  URL_REQUEST_MODEL_QTY @"http://192.168.0.116:8080/site/isales/getTearSheetAvailableQty.htm"
+#define  URL_ADD_TO_PORTFOLIO @"https://www.newpacificdirect.com/isales/addToPortfolio.htm"
+#define  URL_PORTFOLIO_REMOVE  @"https://www.newpacificdirect.com/isales/deleteToPortfolio.htm"
+#define  URL_PORTFOLIO  @"https://www.newpacificdirect.com/isales/portfolios.htm"
+#define  URL_PORTFOLIO_SET_PRICE  @"https://www.newpacificdirect.com/isales/setTearSheetPrice.htm"
+#define  URL_DM_PARAMS @"https://www.newpacificdirect.com/isales/selectTearSheetParam.htm"
+#define  URL_REQUEST_DM @"https://www.newpacificdirect.com/isales/getTearSheetPdf.htm"
+#define  URL_SAVE_DM_DIRECT @"https://www.newpacificdirect.com/isales/getTearSheetPdf.htm"
+#define  URL_SAVE_DM @"https://www.newpacificdirect.com/isales/saveTearSheetPdf.htm"
+#define  URL_DM_LIST @"https://www.newpacificdirect.com/isales/tearSheetPdfList.htm"
+//#define  URL_DM_SET_QTY @"https://www.newpacificdirect.com/isales/setTearSheetAvailableQty.htm"
+#define  URL_REQUEST_MODEL_QTY @"https://www.newpacificdirect.com/isales/getTearSheetAvailableQty.htm"
 
-#define  URL_CONTACT_LIST  @"http://192.168.0.116:8080/site/isales/getAllContact.htm"
-#define  URL_SHIPTO_LIST  @"http://192.168.0.116:8080/site/isales/getShipToContact.htm"
 
-#define  URL_ADDRESS_EDOTOR  @"http://192.168.0.116:8080/site/isales/getAddAddress.htm"
-#define  URL_ADDRESS_SAVE  @"http://192.168.0.116:8080/site/isales/saveAddress.htm"
+#define  URL_CONTACT_LIST  @"https://www.newpacificdirect.com/isales/getAllContact.htm"
+#define  URL_SHIPTO_LIST  @"https://www.newpacificdirect.com/isales/getShipToContact.htm"
 
+#define  URL_ADDRESS_EDOTOR  @"https://www.newpacificdirect.com/isales/getAddAddress.htm"
+#define  URL_ADDRESS_SAVE  @"https://www.newpacificdirect.com/isales/saveAddress.htm"
 
-#define  URL_CREDITCARD_EDOTOR  @"http://192.168.0.116:8080/site/isales/creditCard.htm"
-#define  URL_CREDITCARD_SAVE  @"http://192.168.0.116:8080/site/isales/saveAddress.htm"
 
+#define  URL_CREDITCARD_EDOTOR  @"https://www.newpacificdirect.com/isales/creditCard.htm"
+#define  URL_CREDITCARD_SAVE  @"https://www.newpacificdirect.com/isales/saveAddress.htm"
 
 
-#define  URL_CUSTOMER_INFO  @"http://192.168.0.116:8080/site/isales/getCustomerInfoByContact.htm"
-#define  URL_CUSTOMER_PENDINGORDER  @"http://192.168.0.116:8080/site/isales/hasPendingOrderByContact.htm"
-#define  URL_NEW_CUSTOMER  @"http://192.168.0.116:8080/site/isales/getAddCustomer.htm"
-#define  URL_EDIT_CUSTOMER  @"http://192.168.0.116:8080/site/isales/getUpdateCustomerInfoByContact.htm"
-#define  URL_CUSTOMER_SAVE  @"http://192.168.0.116:8080/site/isales/saveCustomer.htm"
-#define  URL_CUSTOMER_UPDATE  @"http://192.168.0.116:8080/site/isales/updateCustomer.htm"
-#define  URL_UPDATE_CUSTOMER_BCARD  @"http://192.168.0.116:8080/site/isales/updateCustomerBusiCard.htm"
 
+#define  URL_CUSTOMER_INFO  @"https://www.newpacificdirect.com/isales/getCustomerInfoByContact.htm"
+#define  URL_NEW_CUSTOMER  @"https://www.newpacificdirect.com/isales/getAddCustomer.htm"
+#define  URL_CUSTOMER_SAVE  @"https://www.newpacificdirect.com/isales/saveCustomer.htm"
+#define  URL_UPDATE_CUSTOMER_BCARD  @"https://www.newpacificdirect.com/isales/updateCustomerBusiCard.htm"
+#define  URL_CUSTOMER_ADV_SEARCH @"https://www.newpacificdirect.com/isales/getContactAdvance.htm"
 
 
 
 
 
-#define  URL_ERR_LOG  @"http://192.168.0.116:8080/site/isales/er_log.htm"
+#define  URL_ERR_LOG  @"https://www.newpacificdirect.com/isales/er_log.htm"
 
-#define  URL_UPLOAD_IMG  @"http://192.168.0.116:8080/site/isales/uploadImg.htm"
+#define  URL_UPLOAD_IMG  @"https://www.newpacificdirect.com/isales/uploadImg.htm"
 
-#define  URL_NPD_POLICY  @"http://192.168.0.116:8080/site/isales/generalPolicy.htm"
+#define URL_COPY_ORDER @"https://www.newpacificdirect.com/isales/copyOrder.htm"
+#define URL_SIGN_ORDER @"https://www.newpacificdirect.com/isales/updateOrderSign.htm"
+#define  URL_CUSTOMER_UPDATE  @"https://www.newpacificdirect.com/isales/updateCustomer.htm"
+#define  URL_CART_GENERAL_NOTES  @"https://www.newpacificdirect.com/isales/updateGeneralNote.htm"
+#define  URL_CART_ITEM_NOTES  @"https://www.newpacificdirect.com/isales/setItemNotes.htm"
+#define  URL_EDIT_CUSTOMER  @"https://www.newpacificdirect.com/isales/getUpdateCustomerInfoByContact.htm"
+#define  URL_CUSTOMER_PENDINGORDER  @"https://www.newpacificdirect.com/isales/hasPendingOrderByContact.htm"
+#define  URL_PORTFOLIOLIST_REMOVE  @"https://www.newpacificdirect.com/isales/deleteTearSheetPdf.htm"
+#define  URL_NPD_POLICY   @"https://www.newpacificdirect.com/isales/generalPolicy.htm"
 
 
-#define  URL_CHECK_OFFLINE  @"http://192.168.0.116:8080/site/offline/initDatas.htm"
 
-#define  URL_DOWNLOAD_OFFLINE  @"http://192.168.0.116:8080/site/offline/downloadDatas.htm"
+#define  URL_CHECK_OFFLINE  @"https://www.newpacificdirect.com/offline/initDatas.htm"
 
-//
-//
-////------------------- NPD server-----------------------
-//#define  URL_UPDATE_AUTH  @"https://www.newpacificdirect.com/isales/login.htm"
-//#define  URL_LOGOUT  @"https://www.newpacificdirect.com/isales/loginOut.htm"
-//#define  URL_RETRIEVE_PASS  @"https://www.newpacificdirect.com/isales/forgotPassword.htm"
-//
-//#define  URL_REQUEST_CATMENU  @"https://www.newpacificdirect.com/isales/menu.htm"
-//#define  URL_LOAD_HOME  @"https://www.newpacificdirect.com/isales/homePage.htm"
-//#define  URL_CATEGORY @"https://www.newpacificdirect.com/isales/distinctCategory.htm"
-//#define  URL_SEARCH  @"https://www.newpacificdirect.com/isales/search.htm"
-//#define  URL_ITEM_SEARCH  @"https://www.newpacificdirect.com/isales/itemSearch.htm"
-//#define  URL_CATEGORY_LOADMORE  @"https://www.newpacificdirect.com/isales/categoryMore.htm"
-//
-//
-//
-//#define  URL_ORDER_LIST  @"https://www.newpacificdirect.com/isales/orderList.htm"
-//#define  URL_ORDER_DETAIL  @"https://www.newpacificdirect.com/isales/orderDetail.htm"
-//#define URL_COMMIT_ORDER @"https://www.newpacificdirect.com/isales/createOrder.htm"
-//#define URL_SAVE_ORDER @"https://www.newpacificdirect.com/isales/saveOrder.htm"
-//#define URL_UPDATE_ORDERCUSTOMER @"https://www.newpacificdirect.com/isales/updateOrderCustomerInfo.htm"
-//#define  URL_NEW_ORDER  @"https://www.newpacificdirect.com/isales/createNewOrder.htm"
-//#define  URL_OPEN_ORDER  @"https://www.newpacificdirect.com/isales/openOrder.htm"
-//#define  URL_RELEASE_ORDER  @"https://www.newpacificdirect.com/isales/closeOrder.htm"
-//#define  URL_DELETE_ORDER  @"https://www.newpacificdirect.com/isales/deleteOrder.htm"
-//#define  URL_CANCEL_ORDER  @"https://www.newpacificdirect.com/isales/cancelOrder.htm"
-//
-//
-//#define  URL_CART_SET_PRICE  @"https://www.newpacificdirect.com/isales/setPrice.htm"
-//#define  URL_CART_INCRESEMENT  @"https://www.newpacificdirect.com/isales/increment.htm"
-//#define  URL_CART  @"https://www.newpacificdirect.com/isales/cartDtail.htm"
-//#define  URL_CARTDELIVERY  @"https://www.newpacificdirect.com/isales/cartDelivery.htm"
-//#define  URL_ADD_TO_CART  @"https://www.newpacificdirect.com/isales/addToCart.htm"
-//#define  URL_CART_REMOVE  @"https://www.newpacificdirect.com/isales/deleteToCart.htm"
-//#define  URL_CART_CHECK  @"https://www.newpacificdirect.com/isales/checkCartItem.htm"
-//
-//#define  URL_CART2WISH  @"https://www.newpacificdirect.com/isales/cartRemoveToWishlist.htm"
-//#define  URL_WISH2CART  @"https://www.newpacificdirect.com/isales/wishlistRemoveToCart.htm"
-//
-//#define  URL_ITEM_DETAIL  @"https://www.newpacificdirect.com/isales/modelDetail.htm"
-//
-//#define  URL_ADD_TO_WATCHLIST  @"https://www.newpacificdirect.com/isales/addToWishList.htm"
-//#define  URL_WATCHLIST  @"https://www.newpacificdirect.com/isales/wishList.htm"
-//#define  URL_WATCHLIST_REMOVE  @"https://www.newpacificdirect.com/isales/deleteToWishList.htm"
-//
-//
-//
-//#define  URL_ADD_TO_PORTFOLIO @"https://www.newpacificdirect.com/isales/addToPortfolio.htm"
-//#define  URL_PORTFOLIO_REMOVE  @"https://www.newpacificdirect.com/isales/deleteToPortfolio.htm"
-//#define  URL_PORTFOLIO  @"https://www.newpacificdirect.com/isales/portfolios.htm"
-//#define  URL_PORTFOLIO_SET_PRICE  @"https://www.newpacificdirect.com/isales/setTearSheetPrice.htm"
-//#define  URL_DM_PARAMS @"https://www.newpacificdirect.com/isales/selectTearSheetParam.htm"
-//#define  URL_REQUEST_DM @"https://www.newpacificdirect.com/isales/getTearSheetPdf.htm"
-//#define  URL_SAVE_DM_DIRECT @"https://www.newpacificdirect.com/isales/getTearSheetPdf.htm"
-//#define  URL_SAVE_DM @"https://www.newpacificdirect.com/isales/saveTearSheetPdf.htm"
-//#define  URL_DM_LIST @"https://www.newpacificdirect.com/isales/tearSheetPdfList.htm"
-////#define  URL_DM_SET_QTY @"https://www.newpacificdirect.com/isales/setTearSheetAvailableQty.htm"
-//#define  URL_REQUEST_MODEL_QTY @"https://www.newpacificdirect.com/isales/getTearSheetAvailableQty.htm"
-//
-//
-//#define  URL_CONTACT_LIST  @"https://www.newpacificdirect.com/isales/getAllContact.htm"
-//#define  URL_SHIPTO_LIST  @"https://www.newpacificdirect.com/isales/getShipToContact.htm"
-//
-//#define  URL_ADDRESS_EDOTOR  @"https://www.newpacificdirect.com/isales/getAddAddress.htm"
-//#define  URL_ADDRESS_SAVE  @"https://www.newpacificdirect.com/isales/saveAddress.htm"
-//
-//
-//#define  URL_CREDITCARD_EDOTOR  @"https://www.newpacificdirect.com/isales/creditCard.htm"
-//#define  URL_CREDITCARD_SAVE  @"https://www.newpacificdirect.com/isales/saveAddress.htm"
-//
-//
-//
-//#define  URL_CUSTOMER_INFO  @"https://www.newpacificdirect.com/isales/getCustomerInfoByContact.htm"
-//#define  URL_NEW_CUSTOMER  @"https://www.newpacificdirect.com/isales/getAddCustomer.htm"
-//#define  URL_CUSTOMER_SAVE  @"https://www.newpacificdirect.com/isales/saveCustomer.htm"
-//#define  URL_UPDATE_CUSTOMER_BCARD  @"https://www.newpacificdirect.com/isales/updateCustomerBusiCard.htm"
-//#define  URL_CUSTOMER_ADV_SEARCH @"https://www.newpacificdirect.com/isales/getContactAdvance.htm"
-//
-//
-//
-//
-//
-//#define  URL_ERR_LOG  @"https://www.newpacificdirect.com/isales/er_log.htm"
-//
-//#define  URL_UPLOAD_IMG  @"https://www.newpacificdirect.com/isales/uploadImg.htm"
-//
-//#define URL_COPY_ORDER @"https://www.newpacificdirect.com/isales/copyOrder.htm"
-//#define URL_SIGN_ORDER @"https://www.newpacificdirect.com/isales/updateOrderSign.htm"
-//#define  URL_CUSTOMER_UPDATE  @"https://www.newpacificdirect.com/isales/updateCustomer.htm"
-//#define  URL_CART_GENERAL_NOTES  @"https://www.newpacificdirect.com/isales/updateGeneralNote.htm"
-//#define  URL_CART_ITEM_NOTES  @"https://www.newpacificdirect.com/isales/setItemNotes.htm"
-//#define  URL_EDIT_CUSTOMER  @"https://www.newpacificdirect.com/isales/getUpdateCustomerInfoByContact.htm"
-//#define  URL_CUSTOMER_PENDINGORDER  @"https://www.newpacificdirect.com/isales/hasPendingOrderByContact.htm"
-//#define  URL_PORTFOLIOLIST_REMOVE  @"https://www.newpacificdirect.com/isales/deleteTearSheetPdf.htm"
-//#define  URL_NPD_POLICY   @"https://www.newpacificdirect.com/isales/generalPolicy.htm"
-//
-//
-//
-//#define  URL_CHECK_OFFLINE  @"https://www.newpacificdirect.com/offline/initDatas.htm"
-//
-//#define  URL_DOWNLOAD_OFFLINE  @"https://www.newpacificdirect.com/offline/downloadDatas.htm"
+#define  URL_DOWNLOAD_OFFLINE  @"https://www.newpacificdirect.com/offline/downloadDatas.htm"
 
 #endif
 /*

+ 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.4</string>
+	<string>1.5</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>160725</string>
+	<string>160729</string>
 	<key>LSRequiresIPhoneOS</key>
 	<true/>
 	<key>NSAppTransportSecurity</key>

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