dropship360 - Version 3.1.1

Version Notes

package is ready

Download this release

Release Info

Developer Logicbroker
Extension dropship360
Version 3.1.1
Comparing to
See all releases


Code changes from version 2.1.1 to 3.1.1

Files changed (198) hide show
  1. app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Inventory.php +2 -2
  2. app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Inventory/Edit/Tab/Addvendorfield.php +2 -2
  3. app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Inventory/Edit/Tab/Lbvendor.php +5 -5
  4. app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Inventory/Edit/Tab/Vendortabhistory.php +1 -1
  5. app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Inventory/Grid.php +13 -13
  6. app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Logicbroker.php +3 -3
  7. app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Notification.php +10 -6
  8. app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Ranking.php +10 -4
  9. app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Ranking/Grid.php +6 -6
  10. app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Reports/Activitymonitor.php +4 -4
  11. app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Reports/Activitymonitor/Email.php +3 -3
  12. app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Reports/Activitymonitor/Form.php +51 -23
  13. app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Reports/Activitymonitor/Grid.php +11 -11
  14. app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Reports/Form/Timestatus.php +3 -2
  15. app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Reports/Staticemailgrid.php +66 -0
  16. app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Sales/Order/View/Items.php +3 -3
  17. app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Showhistory.php +4 -4
  18. app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Sourcing.php +5 -5
  19. app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Sourcing/Edit.php +5 -5
  20. app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Sourcing/Edit/Tab/Form.php +5 -5
  21. app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Sourcing/Edit/Tabs.php +4 -4
  22. app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Sourcing/Grid.php +20 -20
  23. app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Sourcing/History/View.php +2 -2
  24. app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Sourcing/History/View/Form.php +1 -1
  25. app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Sourcing/History/View/Tabs.php +3 -3
  26. app/code/community/Logicbroker/Dropship360/Block/Adminhtml/System/Config/Fieldset/Hint.php +1 -1
  27. app/code/community/Logicbroker/Dropship360/Block/Adminhtml/System/Config/Ftpconnectionbutton.php +2 -2
  28. app/code/community/Logicbroker/Dropship360/Block/Adminhtml/System/Config/Helplink.php +1 -1
  29. app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Upload.php +2 -2
  30. app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Upload/Bulkassign.php +2 -2
  31. app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Upload/Edit/Form.php +2 -2
  32. app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Vendorproductuploadhistory.php +107 -6
  33. app/code/community/Logicbroker/Dropship360/Helper/Data.php +143 -24
  34. app/code/community/Logicbroker/Dropship360/Model/Api2/Createroleandrule.php +3 -2
  35. app/code/community/Logicbroker/Dropship360/Model/Api2/Inventory/Rest/Admin/V1.php +2 -2
  36. app/code/community/Logicbroker/Dropship360/Model/Api2/Product/Rest/Admin/V1.php +1 -1
  37. app/code/community/Logicbroker/Dropship360/Model/Csvparser.php +266 -0
  38. app/code/community/Logicbroker/Dropship360/Model/Inventory.php +144 -92
  39. app/code/community/Logicbroker/Dropship360/Model/Inventorylog.php +1 -1
  40. app/code/community/Logicbroker/Dropship360/Model/Logicbroker.php +70 -21
  41. app/code/community/Logicbroker/Dropship360/Model/Observer.php +151 -71
  42. app/code/community/Logicbroker/Dropship360/Model/Order/Api.php +10 -10
  43. app/code/community/Logicbroker/Dropship360/Model/Orderitems.php +8 -8
  44. app/code/community/Logicbroker/Dropship360/Model/Ordersourcing.php +75 -16
  45. app/code/community/Logicbroker/Dropship360/Model/Ranking.php +4 -4
  46. app/code/community/Logicbroker/Dropship360/Model/Rankinglog.php +1 -1
  47. app/code/community/Logicbroker/Dropship360/Model/Report.php +100 -57
  48. app/code/community/Logicbroker/Dropship360/Model/Resource/Inventory.php +1 -1
  49. app/code/community/Logicbroker/Dropship360/Model/Resource/Inventory/Collection.php +1 -1
  50. app/code/community/Logicbroker/Dropship360/Model/Resource/Inventorylog.php +1 -1
  51. app/code/community/Logicbroker/Dropship360/Model/Resource/Inventorylog/Collection.php +1 -1
  52. app/code/community/Logicbroker/Dropship360/Model/Resource/Orderitems.php +43 -1
  53. app/code/community/Logicbroker/Dropship360/Model/Resource/Orderitems/Collection.php +1 -1
  54. app/code/community/Logicbroker/Dropship360/Model/Resource/Ordersourcing.php +37 -1
  55. app/code/community/Logicbroker/Dropship360/Model/Resource/Ordersourcing/Collection.php +1 -1
  56. app/code/community/Logicbroker/Dropship360/Model/Resource/Ranking.php +1 -1
  57. app/code/community/Logicbroker/Dropship360/Model/Resource/Ranking/Collection.php +1 -1
  58. app/code/community/Logicbroker/Dropship360/Model/Resource/Rankinglog.php +1 -1
  59. app/code/community/Logicbroker/Dropship360/Model/Resource/Rankinglog/Collection.php +1 -1
  60. app/code/community/Logicbroker/Dropship360/Model/Resource/Uploadvendor.php +1 -1
  61. app/code/community/Logicbroker/Dropship360/Model/Resource/Uploadvendor/Collection.php +1 -1
  62. app/code/community/Logicbroker/Dropship360/Model/Resource/Vendorimportlog.php +1 -1
  63. app/code/community/Logicbroker/Dropship360/Model/System/Config/Backend/Oudatedinventory/Email.php +61 -0
  64. app/code/community/Logicbroker/Dropship360/Model/System/Config/Source/Attributecodes.php +2 -2
  65. app/code/community/Logicbroker/Dropship360/Model/System/Config/Source/Category.php +1 -1
  66. app/code/community/Logicbroker/Dropship360/Model/System/Config/Source/Ediqualifier.php +39 -39
  67. app/code/community/Logicbroker/Dropship360/Model/System/Config/Source/Ftptype.php +2 -2
  68. app/code/community/Logicbroker/Dropship360/Model/System/Config/Source/Optionvalues.php +7 -7
  69. app/code/community/Logicbroker/Dropship360/Model/System/Config/Source/Ranktype.php +3 -3
  70. app/code/community/Logicbroker/Dropship360/Model/System/Config/Source/Vendorlist.php +11 -11
  71. app/code/community/Logicbroker/Dropship360/Model/Uploadvendor.php +577 -371
  72. app/code/community/Logicbroker/Dropship360/controllers/Adminhtml/InventoryController.php +15 -5
  73. app/code/community/Logicbroker/Dropship360/controllers/Adminhtml/LogicbrokerController.php +44 -30
  74. app/code/community/Logicbroker/Dropship360/controllers/Adminhtml/RankingController.php +56 -17
  75. app/code/community/Logicbroker/Dropship360/controllers/Adminhtml/ReportController.php +19 -8
  76. app/code/community/Logicbroker/Dropship360/controllers/Adminhtml/SourcingController.php +32 -20
  77. app/code/community/Logicbroker/Dropship360/controllers/Adminhtml/UploadController.php +67 -36
  78. app/code/community/Logicbroker/Dropship360/data/dropship360_setup/data-install-1.0.3.php +3 -2
  79. app/code/community/Logicbroker/Dropship360/data/dropship360_setup/data-upgrade-1.0.3-1.0.4.php +6 -6
  80. app/code/community/Logicbroker/Dropship360/data/dropship360_setup/data-upgrade-1.0.4-1.0.5.php +1 -1
  81. app/code/community/Logicbroker/Dropship360/data/dropship360_setup/data-upgrade-1.0.5-1.0.6.php +25 -0
  82. app/code/community/Logicbroker/Dropship360/etc/adminhtml.xml +8 -8
  83. app/code/community/Logicbroker/Dropship360/etc/api.xml +14 -14
  84. app/code/community/Logicbroker/Dropship360/etc/api2.xml +5 -5
  85. app/code/community/Logicbroker/Dropship360/etc/config.xml +66 -28
  86. app/code/community/Logicbroker/Dropship360/etc/jstranslator.xml +2 -2
  87. app/code/community/Logicbroker/Dropship360/etc/system.xml +85 -23
  88. app/code/community/Logicbroker/Dropship360/sql/dropship360_setup/mysql4-install-1.0.3.php +11 -11
  89. app/code/community/Logicbroker/Dropship360/sql/dropship360_setup/mysql4-upgrade-1.0.3-1.0.4.php +7 -7
  90. app/code/community/Logicbroker/Dropship360/sql/dropship360_setup/mysql4-upgrade-1.0.4-1.0.5.php +10 -11
  91. app/code/community/Logicbroker/Dropship360/sql/dropship360_setup/mysql4-upgrade-1.0.5-1.0.6.php +74 -0
  92. app/code/community/Logicbroker/Dropship360/sql/dropship360_setup/mysql4-upgrade-1.0.6-1.0.7.php +12 -0
  93. app/design/adminhtml/default/default/layout/logicbroker.xml +17 -17
  94. app/design/adminhtml/default/default/template/logicbroker/add_help_js.phtml +2 -2
  95. app/design/adminhtml/default/default/template/logicbroker/addvendorfields.phtml +1 -1
  96. app/design/adminhtml/default/default/template/logicbroker/bundle/renderer.phtml +1 -1
  97. app/design/adminhtml/default/default/template/logicbroker/downloadable/downloadable.phtml +1 -1
  98. app/design/adminhtml/default/default/template/logicbroker/html/pager.phtml +124 -0
  99. app/design/adminhtml/default/default/template/logicbroker/inline-edit.phtml +4 -1
  100. app/design/adminhtml/default/default/template/logicbroker/process-profile.phtml +10 -0
  101. app/design/adminhtml/default/default/template/logicbroker/reports/email/grid.phtml +80 -0
  102. app/design/adminhtml/default/default/template/logicbroker/reports/grid/container.phtml +23 -4
  103. app/design/adminhtml/default/default/template/logicbroker/result.phtml +3 -2
  104. app/design/adminhtml/default/default/template/logicbroker/sales/default.phtml +3 -3
  105. app/design/adminhtml/default/default/template/logicbroker/system/config/fieldset/hint.phtml +3 -3
  106. app/design/adminhtml/default/default/template/logicbroker/vendor_ranking.phtml +90 -31
  107. app/design/adminhtml/default/default/template/logicbroker/vendor_upload_product_history.phtml +3 -1
  108. app/design/adminhtml/default/default/template/logicbroker/vendorproducttab.phtml +6 -6
  109. app/design/adminhtml/default/default/template/logicbroker/window.phtml +3 -3
  110. app/locale/en_US/template/email/logicbroker/activity_report_staticstatus.html +20 -0
  111. app/locale/en_US/template/email/logicbroker/first_order_notification.html +9 -0
  112. app/locale/en_US/template/email/logicbroker/first_productsetup_notification.html +9 -0
  113. app/locale/en_US/template/email/{logicbroker.html → logicbroker/logicbroker.html} +1 -1
  114. app/locale/en_US/template/email/logicbroker/logicbroker_ftp_con_fail.html +20 -0
  115. app/locale/en_US/template/email/logicbroker/oudated_product_inventory_notification.html +10 -0
  116. includes/src/Logicbroker/Dropship360/controllers/Adminhtml/InventoryController.php +15 -5
  117. includes/src/Logicbroker/Dropship360/controllers/Adminhtml/LogicbrokerController.php +44 -30
  118. includes/src/Logicbroker/Dropship360/controllers/Adminhtml/RankingController.php +56 -17
  119. includes/src/Logicbroker/Dropship360/controllers/Adminhtml/ReportController.php +19 -8
  120. includes/src/Logicbroker/Dropship360/controllers/Adminhtml/SourcingController.php +32 -20
  121. includes/src/Logicbroker/Dropship360/controllers/Adminhtml/UploadController.php +67 -36
  122. includes/src/Logicbroker/Fulfillment/controllers/Adminhtml/InventoryController.php +0 -49
  123. includes/src/Logicbroker/Fulfillment/controllers/Adminhtml/LogicbrokerController.php +0 -217
  124. includes/src/Logicbroker/Fulfillment/controllers/Adminhtml/RankingController.php +0 -217
  125. includes/src/Logicbroker/Fulfillment/controllers/Adminhtml/SourcingController.php +0 -138
  126. includes/src/Logicbroker_Dropship360_Block_Adminhtml_Inventory.php +2 -2
  127. includes/src/Logicbroker_Dropship360_Block_Adminhtml_Inventory_Edit_Tab_Addvendorfield.php +2 -2
  128. includes/src/Logicbroker_Dropship360_Block_Adminhtml_Inventory_Edit_Tab_Lbvendor.php +5 -5
  129. includes/src/Logicbroker_Dropship360_Block_Adminhtml_Inventory_Edit_Tab_Vendortabhistory.php +1 -1
  130. includes/src/Logicbroker_Dropship360_Block_Adminhtml_Inventory_Grid.php +13 -13
  131. includes/src/Logicbroker_Dropship360_Block_Adminhtml_Logicbroker.php +3 -3
  132. includes/src/Logicbroker_Dropship360_Block_Adminhtml_Notification.php +10 -6
  133. includes/src/Logicbroker_Dropship360_Block_Adminhtml_Ranking.php +10 -4
  134. includes/src/Logicbroker_Dropship360_Block_Adminhtml_Ranking_Grid.php +6 -6
  135. includes/src/Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor.php +4 -4
  136. includes/src/Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor_Email.php +3 -3
  137. includes/src/Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor_Form.php +51 -23
  138. includes/src/Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor_Grid.php +11 -11
  139. includes/src/Logicbroker_Dropship360_Block_Adminhtml_Reports_Form_Timestatus.php +3 -2
  140. includes/src/Logicbroker_Dropship360_Block_Adminhtml_Reports_Staticemailgrid.php +66 -0
  141. includes/src/Logicbroker_Dropship360_Block_Adminhtml_Sales_Order_View_Items.php +3 -3
  142. includes/src/Logicbroker_Dropship360_Block_Adminhtml_Showhistory.php +4 -4
  143. includes/src/Logicbroker_Dropship360_Block_Adminhtml_Sourcing.php +5 -5
  144. includes/src/Logicbroker_Dropship360_Block_Adminhtml_Sourcing_Edit.php +5 -5
  145. includes/src/Logicbroker_Dropship360_Block_Adminhtml_Sourcing_Edit_Tab_Form.php +5 -5
  146. includes/src/Logicbroker_Dropship360_Block_Adminhtml_Sourcing_Edit_Tabs.php +4 -4
  147. includes/src/Logicbroker_Dropship360_Block_Adminhtml_Sourcing_Grid.php +20 -20
  148. includes/src/Logicbroker_Dropship360_Block_Adminhtml_Sourcing_History_View.php +2 -2
  149. includes/src/Logicbroker_Dropship360_Block_Adminhtml_Sourcing_History_View_Form.php +1 -1
  150. includes/src/Logicbroker_Dropship360_Block_Adminhtml_Sourcing_History_View_Tabs.php +3 -3
  151. includes/src/Logicbroker_Dropship360_Block_Adminhtml_System_Config_Fieldset_Hint.php +1 -1
  152. includes/src/Logicbroker_Dropship360_Block_Adminhtml_System_Config_Ftpconnectionbutton.php +2 -2
  153. includes/src/Logicbroker_Dropship360_Block_Adminhtml_System_Config_Helplink.php +1 -1
  154. includes/src/Logicbroker_Dropship360_Block_Adminhtml_Upload.php +2 -2
  155. includes/src/Logicbroker_Dropship360_Block_Adminhtml_Upload_Bulkassign.php +2 -2
  156. includes/src/Logicbroker_Dropship360_Block_Adminhtml_Upload_Edit_Form.php +2 -2
  157. includes/src/Logicbroker_Dropship360_Block_Adminhtml_Vendorproductuploadhistory.php +107 -6
  158. includes/src/Logicbroker_Dropship360_Helper_Data.php +143 -24
  159. includes/src/Logicbroker_Dropship360_Model_Api2_Createroleandrule.php +3 -2
  160. includes/src/Logicbroker_Dropship360_Model_Api2_Inventory_Rest_Admin_V1.php +2 -2
  161. includes/src/Logicbroker_Dropship360_Model_Api2_Product_Rest_Admin_V1.php +1 -1
  162. includes/src/Logicbroker_Dropship360_Model_Csvparser.php +266 -0
  163. includes/src/Logicbroker_Dropship360_Model_Inventory.php +144 -92
  164. includes/src/Logicbroker_Dropship360_Model_Inventorylog.php +1 -1
  165. includes/src/Logicbroker_Dropship360_Model_Logicbroker.php +70 -21
  166. includes/src/Logicbroker_Dropship360_Model_Observer.php +151 -71
  167. includes/src/Logicbroker_Dropship360_Model_Order_Api.php +10 -10
  168. includes/src/Logicbroker_Dropship360_Model_Orderitems.php +8 -8
  169. includes/src/Logicbroker_Dropship360_Model_Ordersourcing.php +75 -16
  170. includes/src/Logicbroker_Dropship360_Model_Ranking.php +4 -4
  171. includes/src/Logicbroker_Dropship360_Model_Rankinglog.php +1 -1
  172. includes/src/Logicbroker_Dropship360_Model_Report.php +100 -57
  173. includes/src/Logicbroker_Dropship360_Model_Resource_Inventory.php +1 -1
  174. includes/src/Logicbroker_Dropship360_Model_Resource_Inventory_Collection.php +1 -1
  175. includes/src/Logicbroker_Dropship360_Model_Resource_Inventorylog.php +1 -1
  176. includes/src/Logicbroker_Dropship360_Model_Resource_Inventorylog_Collection.php +1 -1
  177. includes/src/Logicbroker_Dropship360_Model_Resource_Orderitems.php +43 -1
  178. includes/src/Logicbroker_Dropship360_Model_Resource_Orderitems_Collection.php +1 -1
  179. includes/src/Logicbroker_Dropship360_Model_Resource_Ordersourcing.php +37 -1
  180. includes/src/Logicbroker_Dropship360_Model_Resource_Ordersourcing_Collection.php +1 -1
  181. includes/src/Logicbroker_Dropship360_Model_Resource_Ranking.php +1 -1
  182. includes/src/Logicbroker_Dropship360_Model_Resource_Ranking_Collection.php +1 -1
  183. includes/src/Logicbroker_Dropship360_Model_Resource_Rankinglog.php +1 -1
  184. includes/src/Logicbroker_Dropship360_Model_Resource_Rankinglog_Collection.php +1 -1
  185. includes/src/Logicbroker_Dropship360_Model_Resource_Uploadvendor.php +1 -1
  186. includes/src/Logicbroker_Dropship360_Model_Resource_Uploadvendor_Collection.php +1 -1
  187. includes/src/Logicbroker_Dropship360_Model_Resource_Vendorimportlog.php +1 -1
  188. includes/src/Logicbroker_Dropship360_Model_System_Config_Backend_Oudatedinventory_Email.php +61 -0
  189. includes/src/Logicbroker_Dropship360_Model_System_Config_Source_Attributecodes.php +2 -2
  190. includes/src/Logicbroker_Dropship360_Model_System_Config_Source_Category.php +1 -1
  191. includes/src/Logicbroker_Dropship360_Model_System_Config_Source_Ediqualifier.php +39 -39
  192. includes/src/Logicbroker_Dropship360_Model_System_Config_Source_Ftptype.php +2 -2
  193. includes/src/Logicbroker_Dropship360_Model_System_Config_Source_Optionvalues.php +7 -7
  194. includes/src/Logicbroker_Dropship360_Model_System_Config_Source_Ranktype.php +3 -3
  195. includes/src/Logicbroker_Dropship360_Model_System_Config_Source_Vendorlist.php +11 -11
  196. includes/src/Logicbroker_Dropship360_Model_Uploadvendor.php +577 -371
  197. js/logicbroker/vendorhistory.css +85 -0
  198. package.xml +4 -4
app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Inventory.php CHANGED
@@ -11,8 +11,8 @@ class Logicbroker_Dropship360_Block_Adminhtml_Inventory extends Mage_Adminhtml_B
11
  public function __construct()
12
  {
13
  $this->_controller = 'adminhtml_inventory';
14
- $this->_blockGroup = 'logicbroker';
15
- $this->_headerText = Mage::helper('logicbroker')->__('');
16
  parent::__construct();
17
  $this->removeButton('add');
18
  }
11
  public function __construct()
12
  {
13
  $this->_controller = 'adminhtml_inventory';
14
+ $this->_blockGroup = 'dropship360';
15
+ $this->_headerText = Mage::helper('dropship360')->__('');
16
  parent::__construct();
17
  $this->removeButton('add');
18
  }
app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Inventory/Edit/Tab/Addvendorfield.php CHANGED
@@ -67,7 +67,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Inventory_Edit_Tab_Addvendorfield
67
  'class' => 'select select-product-option-type required-option-select'
68
  ))
69
  ->setName($this->getFieldName().'[{{id}}][lb_vendor_code]')
70
- ->setOptions(Mage::getSingleton('logicbroker/system_config_source_vendorlist')->vendorList('',$productsku));
71
 
72
  return $select->getHtml();
73
  }
@@ -76,7 +76,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Inventory_Edit_Tab_Addvendorfield
76
  $this->setChild('delete_button_vendor',
77
  $this->getLayout()->createBlock('adminhtml/widget_button')
78
  ->setData(array(
79
- 'label' => Mage::helper('logicbroker')->__('Delete Option'),
80
  'class' => 'delete delete-product-option-vendor '
81
  ))
82
  );
67
  'class' => 'select select-product-option-type required-option-select'
68
  ))
69
  ->setName($this->getFieldName().'[{{id}}][lb_vendor_code]')
70
+ ->setOptions(Mage::getSingleton('dropship360/system_config_source_vendorlist')->vendorList('',$productsku));
71
 
72
  return $select->getHtml();
73
  }
76
  $this->setChild('delete_button_vendor',
77
  $this->getLayout()->createBlock('adminhtml/widget_button')
78
  ->setData(array(
79
+ 'label' => Mage::helper('dropship360')->__('Delete Option'),
80
  'class' => 'delete delete-product-option-vendor '
81
  ))
82
  );
app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Inventory/Edit/Tab/Lbvendor.php CHANGED
@@ -20,7 +20,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Inventory_Edit_Tab_Lbvendor extend
20
  $this->setChild('vendor_add_button',
21
  $this->getLayout()->createBlock('adminhtml/widget_button')
22
  ->setData(array(
23
- 'label' => Mage::helper('logicbroker')->__('Add New Supplier'),
24
  'class' => 'add',
25
  'id' => 'add_new_defined_option_vendor'
26
  ))
@@ -29,13 +29,13 @@ class Logicbroker_Dropship360_Block_Adminhtml_Inventory_Edit_Tab_Lbvendor extend
29
  $this->setChild('update_delete_button_vendor',
30
  $this->getLayout()->createBlock('adminhtml/widget_button')
31
  ->setData(array(
32
- 'label' => Mage::helper('logicbroker')->__('Delete Option'),
33
  'class' => 'delete delete-product-option-vendor '
34
  ))
35
  );
36
 
37
  $this->setChild('vendor_options_box',
38
- $this->getLayout()->createBlock('logicbroker/adminhtml_inventory_edit_tab_addvendorfield')
39
  );
40
 
41
  return parent::_prepareLayout();
@@ -53,8 +53,8 @@ class Logicbroker_Dropship360_Block_Adminhtml_Inventory_Edit_Tab_Lbvendor extend
53
 
54
  public function getAssignedData(){
55
 
56
- $rankingTableName = Mage::getSingleton('core/resource')->getTableName('logicbroker/ranking');
57
- $collection = Mage::getModel('logicbroker/inventory')->getCollection()
58
  ->addFieldToFilter('product_sku',Mage::getModel('catalog/product')->load($this->getProductId())->getSku());
59
  $collection->getSelect()->joinLeft(array('ranking' => $rankingTableName), 'main_table.lb_vendor_code=ranking.lb_vendor_code', array('vendor_name' => 'lb_vendor_name'));
60
  return $collection;
20
  $this->setChild('vendor_add_button',
21
  $this->getLayout()->createBlock('adminhtml/widget_button')
22
  ->setData(array(
23
+ 'label' => Mage::helper('dropship360')->__('Add New Supplier'),
24
  'class' => 'add',
25
  'id' => 'add_new_defined_option_vendor'
26
  ))
29
  $this->setChild('update_delete_button_vendor',
30
  $this->getLayout()->createBlock('adminhtml/widget_button')
31
  ->setData(array(
32
+ 'label' => Mage::helper('dropship360')->__('Delete Option'),
33
  'class' => 'delete delete-product-option-vendor '
34
  ))
35
  );
36
 
37
  $this->setChild('vendor_options_box',
38
+ $this->getLayout()->createBlock('dropship360/adminhtml_inventory_edit_tab_addvendorfield')
39
  );
40
 
41
  return parent::_prepareLayout();
53
 
54
  public function getAssignedData(){
55
 
56
+ $rankingTableName = Mage::getSingleton('core/resource')->getTableName('dropship360/ranking');
57
+ $collection = Mage::getModel('dropship360/inventory')->getCollection()
58
  ->addFieldToFilter('product_sku',Mage::getModel('catalog/product')->load($this->getProductId())->getSku());
59
  $collection->getSelect()->joinLeft(array('ranking' => $rankingTableName), 'main_table.lb_vendor_code=ranking.lb_vendor_code', array('vendor_name' => 'lb_vendor_name'));
60
  return $collection;
app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Inventory/Edit/Tab/Vendortabhistory.php CHANGED
@@ -22,7 +22,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Inventory_Edit_Tab_Vendortabhistor
22
 
23
  public function getInventoryLog(){
24
 
25
- $collection = Mage::getModel('logicbroker/inventorylog')->getCollection()->addFieldToFilter('product_sku',Mage::getModel('catalog/product')->load($this->getProductId())->getSku());
26
  $collection->getSelect()->order('updated_at desc');
27
 
28
  return $collection;
22
 
23
  public function getInventoryLog(){
24
 
25
+ $collection = Mage::getModel('dropship360/inventorylog')->getCollection()->addFieldToFilter('product_sku',Mage::getModel('catalog/product')->load($this->getProductId())->getSku());
26
  $collection->getSelect()->order('updated_at desc');
27
 
28
  return $collection;
app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Inventory/Grid.php CHANGED
@@ -23,8 +23,8 @@ class Logicbroker_Dropship360_Block_Adminhtml_Inventory_Grid extends Mage_Adminh
23
  {
24
  $entityTypeId = Mage::getModel ( 'eav/config' )->getEntityType ( 'catalog_product' )->getEntityTypeId ();
25
  $prodNameAttrId = Mage::getModel('eav/entity_attribute')->loadByCode($entityTypeId, 'name')->getAttributeId();
26
- $collection = Mage::getModel('logicbroker/inventory')->getCollection();
27
- $collection->getSelect()->join(array('lbRanking'=>Mage::getSingleton('core/resource')->getTableName('logicbroker/ranking')),'lbRanking.lb_vendor_code = main_table.lb_vendor_code', array('lb_vendor_name'));
28
  $collection->getSelect()->joinLeft(array('prod' => Mage::getSingleton('core/resource')->getTableName('catalog/product')),'prod.sku = main_table.product_sku',array('magento_pro_id'=>'entity_id'));
29
  $collection->getSelect()->joinLeft(array('cpev' => Mage::getSingleton('core/resource')->getTableName('catalog/product').'_varchar'),'cpev.entity_id=prod.entity_id AND cpev.attribute_id='.$prodNameAttrId.'',array('product_name' => 'value'));
30
  $collection->getSelect()->where('prod.entity_id IS NOT NULL');
@@ -41,7 +41,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Inventory_Grid extends Mage_Adminh
41
  protected function _prepareColumns()
42
  {
43
  $this->addColumn('lb_vendor_name', array(
44
- 'header' => Mage::helper('logicbroker')->__('Supplier'),
45
  'align' =>'right',
46
  'width' => '50px',
47
  'filter_index' => 'lbRanking.lb_vendor_name',
@@ -49,27 +49,27 @@ class Logicbroker_Dropship360_Block_Adminhtml_Inventory_Grid extends Mage_Adminh
49
  ));
50
 
51
  $this->addColumn('stock', array(
52
- 'header' => Mage::helper('logicbroker')->__('Supplier Inventory'),
53
  'index' => 'stock',
54
  'type' => 'number'
55
  ));
56
  $store = $this->_getStore();
57
  $this->addColumn('cost', array(
58
- 'header' => Mage::helper('logicbroker')->__('Cost'),
59
  'index' => 'cost',
60
  'type' => 'price',
61
  'currency_code' => $store->getBaseCurrency()->getCode(),
62
  ));
63
 
64
  $this->addColumn('product_name', array(
65
- 'header' => Mage::helper('logicbroker')->__('Product Name'),
66
  'align' =>'left',
67
  'width' => '80px',
68
  'index' => 'product_name',
69
  'filter_index'=>'cpev.value',
70
  ));
71
  $this->addColumn('product_sku', array(
72
- 'header' => Mage::helper('logicbroker')->__('Product Sku'),
73
  'align' =>'left',
74
  'width' => '80px',
75
  'index' => 'product_sku',
@@ -77,14 +77,14 @@ class Logicbroker_Dropship360_Block_Adminhtml_Inventory_Grid extends Mage_Adminh
77
  ));
78
 
79
  $this->addColumn('lb_vendor_sku', array(
80
- 'header' => Mage::helper('logicbroker')->__('Supplier Sku'),
81
  'align' =>'left',
82
  'width' => '80px',
83
  'index' => 'lb_vendor_sku',
84
  'renderer' => 'Logicbroker_Dropship360_Block_Adminhtml_Widget_Grid_Column_Skuaction'
85
  ));
86
  $this->addColumn('updated_at', array(
87
- 'header' => Mage::helper('logicbroker')->__('Last Sync'),
88
  'index' => 'updated_at',
89
  'width' => '80px',
90
  'default' => '--',
@@ -95,13 +95,13 @@ class Logicbroker_Dropship360_Block_Adminhtml_Inventory_Grid extends Mage_Adminh
95
  // below code added for Jira ticket 734
96
  $this->addColumn('action',
97
  array(
98
- 'header' => Mage::helper('logicbroker')->__('Action'),
99
  'width' => '100',
100
  'type' => 'action',
101
  'getter' => 'getMagentoProId',
102
  'actions' => array(
103
  array(
104
- 'caption' => Mage::helper('logicbroker')->__('Edit'),
105
  'url' => array('base'=> 'adminhtml/catalog_product/edit/back/edit/tab/product_info_tabs_vendor_tab'),
106
  'field' => 'id'
107
  )
@@ -111,8 +111,8 @@ class Logicbroker_Dropship360_Block_Adminhtml_Inventory_Grid extends Mage_Adminh
111
  'index' => 'stores',
112
  'is_system' => true,
113
  ));
114
- $this->addExportType('*/*/exportCsv', Mage::helper('logicbroker')->__('CSV'));
115
- $this->addExportType('*/*/exportXml', Mage::helper('logicbroker')->__('XML'));
116
 
117
  return parent::_prepareColumns();
118
  }
23
  {
24
  $entityTypeId = Mage::getModel ( 'eav/config' )->getEntityType ( 'catalog_product' )->getEntityTypeId ();
25
  $prodNameAttrId = Mage::getModel('eav/entity_attribute')->loadByCode($entityTypeId, 'name')->getAttributeId();
26
+ $collection = Mage::getModel('dropship360/inventory')->getCollection();
27
+ $collection->getSelect()->join(array('lbRanking'=>Mage::getSingleton('core/resource')->getTableName('dropship360/ranking')),'lbRanking.lb_vendor_code = main_table.lb_vendor_code', array('lb_vendor_name'));
28
  $collection->getSelect()->joinLeft(array('prod' => Mage::getSingleton('core/resource')->getTableName('catalog/product')),'prod.sku = main_table.product_sku',array('magento_pro_id'=>'entity_id'));
29
  $collection->getSelect()->joinLeft(array('cpev' => Mage::getSingleton('core/resource')->getTableName('catalog/product').'_varchar'),'cpev.entity_id=prod.entity_id AND cpev.attribute_id='.$prodNameAttrId.'',array('product_name' => 'value'));
30
  $collection->getSelect()->where('prod.entity_id IS NOT NULL');
41
  protected function _prepareColumns()
42
  {
43
  $this->addColumn('lb_vendor_name', array(
44
+ 'header' => Mage::helper('dropship360')->__('Supplier'),
45
  'align' =>'right',
46
  'width' => '50px',
47
  'filter_index' => 'lbRanking.lb_vendor_name',
49
  ));
50
 
51
  $this->addColumn('stock', array(
52
+ 'header' => Mage::helper('dropship360')->__('Supplier Inventory'),
53
  'index' => 'stock',
54
  'type' => 'number'
55
  ));
56
  $store = $this->_getStore();
57
  $this->addColumn('cost', array(
58
+ 'header' => Mage::helper('dropship360')->__('Cost'),
59
  'index' => 'cost',
60
  'type' => 'price',
61
  'currency_code' => $store->getBaseCurrency()->getCode(),
62
  ));
63
 
64
  $this->addColumn('product_name', array(
65
+ 'header' => Mage::helper('dropship360')->__('Product Name'),
66
  'align' =>'left',
67
  'width' => '80px',
68
  'index' => 'product_name',
69
  'filter_index'=>'cpev.value',
70
  ));
71
  $this->addColumn('product_sku', array(
72
+ 'header' => Mage::helper('dropship360')->__('Product Sku'),
73
  'align' =>'left',
74
  'width' => '80px',
75
  'index' => 'product_sku',
77
  ));
78
 
79
  $this->addColumn('lb_vendor_sku', array(
80
+ 'header' => Mage::helper('dropship360')->__('Supplier Sku'),
81
  'align' =>'left',
82
  'width' => '80px',
83
  'index' => 'lb_vendor_sku',
84
  'renderer' => 'Logicbroker_Dropship360_Block_Adminhtml_Widget_Grid_Column_Skuaction'
85
  ));
86
  $this->addColumn('updated_at', array(
87
+ 'header' => Mage::helper('dropship360')->__('Last Sync'),
88
  'index' => 'updated_at',
89
  'width' => '80px',
90
  'default' => '--',
95
  // below code added for Jira ticket 734
96
  $this->addColumn('action',
97
  array(
98
+ 'header' => Mage::helper('dropship360')->__('Action'),
99
  'width' => '100',
100
  'type' => 'action',
101
  'getter' => 'getMagentoProId',
102
  'actions' => array(
103
  array(
104
+ 'caption' => Mage::helper('dropship360')->__('Edit'),
105
  'url' => array('base'=> 'adminhtml/catalog_product/edit/back/edit/tab/product_info_tabs_vendor_tab'),
106
  'field' => 'id'
107
  )
111
  'index' => 'stores',
112
  'is_system' => true,
113
  ));
114
+ $this->addExportType('*/*/exportCsv', Mage::helper('dropship360')->__('CSV'));
115
+ $this->addExportType('*/*/exportXml', Mage::helper('dropship360')->__('XML'));
116
 
117
  return parent::_prepareColumns();
118
  }
app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Logicbroker.php CHANGED
@@ -11,9 +11,9 @@ class Logicbroker_Dropship360_Block_Adminhtml_Logicbroker extends Mage_Adminhtml
11
  public function __construct()
12
  {
13
  $this->_controller = 'adminhtml_logicbroker';
14
- $this->_blockGroup = 'logicbroker';
15
- $this->_headerText = Mage::helper('logicbroker')->__('Supplier Manager');
16
- $this->_addButtonLabel = Mage::helper('logicbroker')->__('Add Supplier');
17
  parent::__construct();
18
  }
19
  }
11
  public function __construct()
12
  {
13
  $this->_controller = 'adminhtml_logicbroker';
14
+ $this->_blockGroup = 'dropship360';
15
+ $this->_headerText = Mage::helper('dropship360')->__('Supplier Manager');
16
+ $this->_addButtonLabel = Mage::helper('dropship360')->__('Add Supplier');
17
  parent::__construct();
18
  }
19
  }
app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Notification.php CHANGED
@@ -25,16 +25,17 @@ class Logicbroker_Dropship360_Block_Adminhtml_Notification extends Mage_Adminhtm
25
  $result = array();
26
  //soap Details
27
  $result['username'] = 'logicbroker';
28
- $apiResult = Mage::getModel('logicbroker/logicbroker')->createApiRoleAndUser(array('api_user_name'=>'logicbroker','email'=>'noreply@logicbroker.com'));
29
  $result['api_password'] = $apiResult['password'];
30
  $result['user_id'] = $apiResult['user_id'];
31
 
32
  //rest deatils
33
- $arrRest = Mage::getModel('logicbroker/api2_createroleandrule')->initiliazeRest();
 
34
  $result['consumer_key'] = $arrRest['consumer_key'];
35
  $result['consumer_secret'] = $arrRest['consumer_secret'];
36
  $result['token'] = $arrRest['token'];
37
- $result['secret'] =$arrRest['secret'];
38
  $coreConfigData = array(
39
 
40
  array(
@@ -43,7 +44,8 @@ class Logicbroker_Dropship360_Block_Adminhtml_Notification extends Mage_Adminhtm
43
  'path' => 'logicbroker_integration/integration/soapuser',
44
  'value' => $result['username'],
45
 
46
- ),
 
47
 
48
  array(
49
  'scope' => 'default',
@@ -51,7 +53,8 @@ class Logicbroker_Dropship360_Block_Adminhtml_Notification extends Mage_Adminhtm
51
  'path' => 'logicbroker_integration/integration/cunsumer_key',
52
  'value' => $result['consumer_key'],
53
 
54
- ),
 
55
  array(
56
  'scope' => 'default',
57
  'scope_id' => '0',
@@ -71,7 +74,8 @@ class Logicbroker_Dropship360_Block_Adminhtml_Notification extends Mage_Adminhtm
71
  'path' => 'logicbroker_integration/integration/access_secret',
72
  'value' => $result['secret'],
73
 
74
- ));
 
75
 
76
  foreach ($coreConfigData as $data) {
77
  $this->setConfigValue($data);
25
  $result = array();
26
  //soap Details
27
  $result['username'] = 'logicbroker';
28
+ $apiResult = Mage::getModel('dropship360/logicbroker')->createApiRoleAndUser(array('api_user_name'=>'logicbroker','email'=>'noreply@logicbroker.com'));
29
  $result['api_password'] = $apiResult['password'];
30
  $result['user_id'] = $apiResult['user_id'];
31
 
32
  //rest deatils
33
+ //code comment as Rest may be a part of future release refer lbn-1351
34
+ /* $arrRest = Mage::getModel('dropship360/api2_createroleandrule')->initiliazeRest();
35
  $result['consumer_key'] = $arrRest['consumer_key'];
36
  $result['consumer_secret'] = $arrRest['consumer_secret'];
37
  $result['token'] = $arrRest['token'];
38
+ $result['secret'] =$arrRest['secret']; */
39
  $coreConfigData = array(
40
 
41
  array(
44
  'path' => 'logicbroker_integration/integration/soapuser',
45
  'value' => $result['username'],
46
 
47
+ )
48
+ /*,
49
 
50
  array(
51
  'scope' => 'default',
53
  'path' => 'logicbroker_integration/integration/cunsumer_key',
54
  'value' => $result['consumer_key'],
55
 
56
+ )
57
+ ,
58
  array(
59
  'scope' => 'default',
60
  'scope_id' => '0',
74
  'path' => 'logicbroker_integration/integration/access_secret',
75
  'value' => $result['secret'],
76
 
77
+ ) */
78
+ );
79
 
80
  foreach ($coreConfigData as $data) {
81
  $this->setConfigValue($data);
app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Ranking.php CHANGED
@@ -11,9 +11,9 @@ class Logicbroker_Dropship360_Block_Adminhtml_Ranking extends Mage_Adminhtml_Blo
11
  public function __construct()
12
  {
13
  $this->_controller = 'adminhtml_ranking';
14
- $this->_blockGroup = 'logicbroker';
15
- $this->_headerText = Mage::helper('logicbroker')->__('Supplier Management');
16
- $this->_addButtonLabel = Mage::helper('logicbroker')->__('Add Supplier Ranking');
17
 
18
 
19
  $this->addButton('show_history',array(
@@ -42,7 +42,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Ranking extends Mage_Adminhtml_Blo
42
  public function getVendorCollection($type = 'no'){
43
 
44
  $arrVendor = array();
45
- $tempReslt = Mage::getModel('logicbroker/ranking')->getVendorCollection($type);
46
  $result['gridData'] = Mage::helper('core')->jsonEncode($tempReslt);
47
  if(!empty($tempReslt)){
48
  foreach($tempReslt as $value){
@@ -52,5 +52,11 @@ class Logicbroker_Dropship360_Block_Adminhtml_Ranking extends Mage_Adminhtml_Blo
52
  $result['arrayData'] = Mage::helper('core')->jsonEncode($arrVendor);
53
  return $result;
54
  }
 
 
 
 
 
 
55
 
56
  }
11
  public function __construct()
12
  {
13
  $this->_controller = 'adminhtml_ranking';
14
+ $this->_blockGroup = 'dropship360';
15
+ $this->_headerText = Mage::helper('dropship360')->__('Supplier Management');
16
+ $this->_addButtonLabel = Mage::helper('dropship360')->__('Add Supplier Ranking');
17
 
18
 
19
  $this->addButton('show_history',array(
42
  public function getVendorCollection($type = 'no'){
43
 
44
  $arrVendor = array();
45
+ $tempReslt = Mage::getModel('dropship360/ranking')->getVendorCollection($type);
46
  $result['gridData'] = Mage::helper('core')->jsonEncode($tempReslt);
47
  if(!empty($tempReslt)){
48
  foreach($tempReslt as $value){
52
  $result['arrayData'] = Mage::helper('core')->jsonEncode($arrVendor);
53
  return $result;
54
  }
55
+ public function getAttributeCode()
56
+ {
57
+ $helper = Mage::helper('dropship360');
58
+ $attributeCode = array(array('link'=>'','name'=>$helper::LOGICBROKER_PRODUCT_LINK_NONE),array('link'=>$helper::LOGICBROKER_PRODUCT_LINK_CODE_UPC,'name'=>$helper::LOGICBROKER_PRODUCT_LINK_UPC),array('link'=>$helper::LOGICBROKER_PRODUCT_LINK_CODE_MNP,'name'=>$helper::LOGICBROKER_PRODUCT_LINK_MNP),array('link'=>$helper::LOGICBROKER_PRODUCT_LINK_CODE_SKU,'name'=>$helper::LOGICBROKER_PRODUCT_LINK_SKU));
59
+ return Mage::helper('core')->jsonEncode($attributeCode);
60
+ }
61
 
62
  }
app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Ranking/Grid.php CHANGED
@@ -21,7 +21,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Ranking_Grid extends Mage_Adminhtm
21
 
22
  protected function _prepareCollection()
23
  {
24
- $collection = Mage::getModel('logicbroker/ranking')->getCollection();
25
  $this->setCollection($collection);
26
  return parent::_prepareCollection();
27
  }
@@ -30,13 +30,13 @@ class Logicbroker_Dropship360_Block_Adminhtml_Ranking_Grid extends Mage_Adminhtm
30
  {
31
 
32
  $this->addColumn('lb_vendor_code', array(
33
- 'header' => Mage::helper('logicbroker')->__('Supplier Code'),
34
  'align' =>'right',
35
  'width' => '50px',
36
  'index' => 'lb_vendor_code',
37
  ));
38
  $this->addColumn('ranking', array(
39
- 'header' => Mage::helper('logicbroker')->__('Position'),
40
  'align' =>'right',
41
  'width' => '50px',
42
  'type' => 'input',
@@ -45,18 +45,18 @@ class Logicbroker_Dropship360_Block_Adminhtml_Ranking_Grid extends Mage_Adminhtm
45
  ));
46
  $this->addColumn('action',
47
  array(
48
- 'header' => Mage::helper('logicbroker')->__('Action'),
49
  'width' => '100',
50
  'type' => 'textaction',
51
  'getter' => 'getId',
52
  'actions' => array(
53
  array(
54
- 'caption' => Mage::helper('logicbroker')->__('edit'),
55
  'url' => array('base'=> '*/*/edit'),
56
  'field' => 'id'
57
  ),
58
  array(
59
- 'caption' => Mage::helper('logicbroker')->__('delete'),
60
  'url' => array('base'=> '*/*/delete'),
61
  'field' => 'id',
62
  'confirm' =>'Are you sure to delete the Supplier?'
21
 
22
  protected function _prepareCollection()
23
  {
24
+ $collection = Mage::getModel('dropship360/ranking')->getCollection();
25
  $this->setCollection($collection);
26
  return parent::_prepareCollection();
27
  }
30
  {
31
 
32
  $this->addColumn('lb_vendor_code', array(
33
+ 'header' => Mage::helper('dropship360')->__('Supplier Code'),
34
  'align' =>'right',
35
  'width' => '50px',
36
  'index' => 'lb_vendor_code',
37
  ));
38
  $this->addColumn('ranking', array(
39
+ 'header' => Mage::helper('dropship360')->__('Position'),
40
  'align' =>'right',
41
  'width' => '50px',
42
  'type' => 'input',
45
  ));
46
  $this->addColumn('action',
47
  array(
48
+ 'header' => Mage::helper('dropship360')->__('Action'),
49
  'width' => '100',
50
  'type' => 'textaction',
51
  'getter' => 'getId',
52
  'actions' => array(
53
  array(
54
+ 'caption' => Mage::helper('dropship360')->__('edit'),
55
  'url' => array('base'=> '*/*/edit'),
56
  'field' => 'id'
57
  ),
58
  array(
59
+ 'caption' => Mage::helper('dropship360')->__('delete'),
60
  'url' => array('base'=> '*/*/delete'),
61
  'field' => 'id',
62
  'confirm' =>'Are you sure to delete the Supplier?'
app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Reports/Activitymonitor.php CHANGED
@@ -40,7 +40,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor extends Ma
40
  public function __construct()
41
  {
42
  $this->_controller = 'adminhtml_reports_activitymonitor';
43
- $this->_blockGroup = 'logicbroker';
44
  $this->_headerText = Mage::helper('reports')->__('Business Activity Monitoring');
45
  parent::__construct();
46
  $this->_removeButton('add');
@@ -71,7 +71,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor extends Ma
71
 
72
  public function getHtmlElementName()
73
  {
74
- return array('input_monitor_order','input_open_monitor');
75
  }
76
 
77
  public function getGraphData(){
@@ -98,9 +98,9 @@ class Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor extends Ma
98
  if($this->getRequest()->getParam('filter'))
99
  $reportData = Mage::helper('adminhtml')->prepareFilterString($this->getRequest()->getParam('filter'));
100
  else
101
- $reportData = Mage::getModel('logicbroker/report')->getActivityReportData();
102
 
103
  $reportData['notificationPer'] = $redper;
104
- Mage::getModel('logicbroker/report')->saveActivityData($reportData);
105
  }
106
  }
40
  public function __construct()
41
  {
42
  $this->_controller = 'adminhtml_reports_activitymonitor';
43
+ $this->_blockGroup = 'dropship360';
44
  $this->_headerText = Mage::helper('reports')->__('Business Activity Monitoring');
45
  parent::__construct();
46
  $this->_removeButton('add');
71
 
72
  public function getHtmlElementName()
73
  {
74
+ return array('input_monitor_order','input_open_monitor','input_transmitting_filter','input_sentosup_filter');
75
  }
76
 
77
  public function getGraphData(){
98
  if($this->getRequest()->getParam('filter'))
99
  $reportData = Mage::helper('adminhtml')->prepareFilterString($this->getRequest()->getParam('filter'));
100
  else
101
+ $reportData = Mage::getModel('dropship360/report')->getActivityReportData();
102
 
103
  $reportData['notificationPer'] = $redper;
104
+ Mage::getModel('dropship360/report')->saveActivityData($reportData);
105
  }
106
  }
app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Reports/Activitymonitor/Email.php CHANGED
@@ -60,21 +60,21 @@ class Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor_Email exte
60
  'use_index' => true,
61
  ));
62
  $this->addColumn('role_name', array(
63
- 'header' => Mage::helper('logicbroker')->__('Role'),
64
  'align' => 'right',
65
  'width' => '50px',
66
  'index' => 'role_name',
67
  ));
68
 
69
  $this->addColumn('firstname', array(
70
- 'header' => Mage::helper('logicbroker')->__('Name'),
71
  'align' => 'right',
72
  'width' => '50px',
73
  'index' => 'firstname',
74
  ));
75
 
76
  $this->addColumn('email', array(
77
- 'header' => Mage::helper('logicbroker')->__('Email Address'),
78
  'align' => 'right',
79
  'width' => '50px',
80
  'index' => 'email',
60
  'use_index' => true,
61
  ));
62
  $this->addColumn('role_name', array(
63
+ 'header' => Mage::helper('dropship360')->__('Role'),
64
  'align' => 'right',
65
  'width' => '50px',
66
  'index' => 'role_name',
67
  ));
68
 
69
  $this->addColumn('firstname', array(
70
+ 'header' => Mage::helper('dropship360')->__('Name'),
71
  'align' => 'right',
72
  'width' => '50px',
73
  'index' => 'firstname',
74
  ));
75
 
76
  $this->addColumn('email', array(
77
+ 'header' => Mage::helper('dropship360')->__('Email Address'),
78
  'align' => 'right',
79
  'width' => '50px',
80
  'index' => 'email',
app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Reports/Activitymonitor/Form.php CHANGED
@@ -49,19 +49,47 @@ class Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor_Form exten
49
 
50
  $htmlIdPrefix = 'sales_report_';
51
  $form->setHtmlIdPrefix($htmlIdPrefix);
 
52
  $fieldset = $form->addFieldset('base_fieldset', array('legend'=>Mage::helper('reports')->__('Filter')));
53
  $this->_addElementTypes($fieldset);
 
54
  $fieldset->addField('store_ids', 'hidden', array(
55
  'name' => 'store_ids'
56
  ));
57
 
58
  Mage::getSingleton('adminhtml/session')->getFormData();
59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  $fieldset->addField('notification_transmitting', 'text', array(
61
  'name' => 'notification_transmitting',
62
- 'label' => Mage::helper('logicbroker')->__('Percentage to Trigger Notification For Transmitting (%)'),
63
  'required' => true,
64
- 'title' => Mage::helper('logicbroker')->__('Percentage to Trigger Notification For Transmitting'),
65
  'value' => isset($formData['notification_transmitting']) ? $formData['notification_transmitting'] : '',
66
  'class' => ' validate-digits validate-number-range number-range-1-99'
67
 
@@ -69,18 +97,18 @@ class Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor_Form exten
69
 
70
  $fieldset->addField('notification_backorder', 'text', array(
71
  'name' => 'notification_backorder',
72
- 'label' => Mage::helper('logicbroker')->__('Percentage to Trigger Notification For Backorder(%)'),
73
  'required' => true,
74
- 'title' => Mage::helper('logicbroker')->__('Percentage to Trigger Notification For Backorder'),
75
  'value' => isset($formData['notification_backorder']) ? $formData['notification_backorder'] : '',
76
  'class' => ' validate-digits validate-number-range number-range-1-99'
77
 
78
  ));
79
  $fieldset->addField('notification_sent_to_supplier', 'text', array(
80
  'name' => 'notification_sent_to_supplier',
81
- 'label' => Mage::helper('logicbroker')->__('Percentage to Trigger Notification For Sent To Supplier (%)'),
82
  'required' => true,
83
- 'title' => Mage::helper('logicbroker')->__('Percentage to Trigger Notification For Sent To Supplier'),
84
  'value' => isset($formData['notification_sent_to_supplier']) ? $formData['notification_sent_to_supplier'] : '',
85
  'class' => ' validate-digits validate-number-range number-range-1-99'
86
 
@@ -97,8 +125,8 @@ class Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor_Form exten
97
  ));
98
  $fieldset->addField('email_adress', 'text', array(
99
  'name' => 'email',
100
- 'label' => Mage::helper('logicbroker')->__('Email Address'),
101
- 'title' => Mage::helper('logicbroker')->__('Email Address'),
102
  'required'=> true,
103
  'value' => isset($formData['email']) ? $formData['email'] : '',
104
  'class' => 'email-adress'
@@ -115,8 +143,8 @@ class Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor_Form exten
115
  $fieldset->addField('dropshipstatus', 'select', array(
116
  'name' => 'dropshipstatus',
117
  'options' => $this->prepareOptionValue(),
118
- 'label' => Mage::helper('logicbroker')->__('Dropship Status'),
119
- 'title' => Mage::helper('logicbroker')->__('Dropship Status'),
120
  'value' => isset($formData['dropshipstatus']) ? $formData['dropshipstatus'] : '',
121
  'required'=> true
122
 
@@ -125,12 +153,12 @@ class Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor_Form exten
125
  $fieldset->addField('select_monitor_order', 'timestatus', array(
126
  'name' => 'select_monitor_order',
127
  'options' => array(
128
- 'day' => Mage::helper('logicbroker')->__('Days'),
129
- 'hour' => Mage::helper('logicbroker')->__('Hours')
130
 
131
  ),
132
- 'label' => Mage::helper('logicbroker')->__('Period to Monitor All Orders'),
133
- 'title' => Mage::helper('logicbroker')->__('Period to Monitor All Orders'),
134
  'inputname' => 'input_monitor_order',
135
  'selectvalue' => isset($formData['select_monitor_order']) ? $formData['select_monitor_order'] : '',
136
  'inputvalue' => isset($formData['input_monitor_order']) ? $formData['input_monitor_order'] : '',
@@ -140,12 +168,12 @@ class Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor_Form exten
140
  $fieldset->addField('select_open_monitor', 'timestatus', array(
141
  'name' => 'select_open_monitor',
142
  'options' => array(
143
- 'day' => Mage::helper('logicbroker')->__('Days'),
144
- 'hour' => Mage::helper('logicbroker')->__('Hours')
145
 
146
  ),
147
- 'label' => Mage::helper('logicbroker')->__('Period Open to Monitor'),
148
- 'title' => Mage::helper('logicbroker')->__('Period Open to Monitor'),
149
  'inputname' => 'input_open_monitor',
150
  'selectvalue' => isset($formData['select_open_monitor']) ? $formData['select_open_monitor'] : '' ,
151
  'inputvalue' => isset($formData['input_open_monitor']) ? $formData['input_open_monitor'] : '',
@@ -161,13 +189,13 @@ class Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor_Form exten
161
 
162
  protected function prepareOptionValue(){
163
 
164
- $itemStatus = Mage::helper('logicbroker')->getItemStatuses();
165
  $options = array();
166
- $options[' '] = Mage::helper('logicbroker')->__('--Please Select--');
167
  foreach($itemStatus as $status )
168
  {
169
  if(in_array($status,array('Transmitting','Backorder','Sent to Supplier')))
170
- $options[$status] = Mage::helper('logicbroker')->__($status);
171
  }
172
  return $options;
173
  }
@@ -176,8 +204,8 @@ class Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor_Form exten
176
  protected function _getAdditionalElementTypes()
177
  {
178
  return array(
179
- 'timestatus' => Mage::getConfig()->getBlockClassName('logicbroker/adminhtml_reports_form_timestatus'),
180
- 'getemailaddress' => Mage::getConfig()->getBlockClassName('logicbroker/adminhtml_upload_edit_button')
181
  );
182
  }
183
 
49
 
50
  $htmlIdPrefix = 'sales_report_';
51
  $form->setHtmlIdPrefix($htmlIdPrefix);
52
+ $fieldsetfilter = $form->addFieldset('base_fieldset_filter', array('legend'=>Mage::helper('reports')->__('Filter')));
53
  $fieldset = $form->addFieldset('base_fieldset', array('legend'=>Mage::helper('reports')->__('Filter')));
54
  $this->_addElementTypes($fieldset);
55
+ $this->_addElementTypes($fieldsetfilter);
56
  $fieldset->addField('store_ids', 'hidden', array(
57
  'name' => 'store_ids'
58
  ));
59
 
60
  Mage::getSingleton('adminhtml/session')->getFormData();
61
 
62
+ $fieldsetfilter->addField('select_transmitting_filter', 'timestatus', array(
63
+ 'name' => 'select_transmitting_filter',
64
+ 'options' => array(
65
+ 'day' => Mage::helper('dropship360')->__('Days'),
66
+ 'hour' => Mage::helper('dropship360')->__('Hours')
67
+ ),
68
+ 'label' => Mage::helper('dropship360')->__('Time in Transmitting Status'),
69
+ 'title' => Mage::helper('dropship360')->__('Time in Transmitting Status'),
70
+ 'inputname' => 'input_transmitting_filter',
71
+ 'selectvalue' => isset($formData['select_transmitting_filter']) ? $formData['select_transmitting_filter'] : '' ,
72
+ 'inputvalue' => isset($formData['input_transmitting_filter']) ? $formData['input_transmitting_filter'] : '',
73
+ ));
74
+
75
+ $fieldsetfilter->addField('select_sentosup_filter', 'timestatus', array(
76
+ 'name' => 'select_sentosup_filter',
77
+ 'options' => array(
78
+ 'day' => Mage::helper('dropship360')->__('Days'),
79
+ 'hour' => Mage::helper('dropship360')->__('Hours')
80
+
81
+ ),
82
+ 'label' => Mage::helper('dropship360')->__('Time in Sent to Supplier Status'),
83
+ 'title' => Mage::helper('dropship360')->__('Time in Sent to Supplier Status'),
84
+ 'inputname' => 'input_sentosup_filter',
85
+ 'selectvalue' => isset($formData['select_sentosup_filter']) ? $formData['select_sentosup_filter'] : '' ,
86
+ 'inputvalue' => isset($formData['input_sentosup_filter']) ? $formData['input_sentosup_filter'] : '',
87
+ ));
88
  $fieldset->addField('notification_transmitting', 'text', array(
89
  'name' => 'notification_transmitting',
90
+ 'label' => Mage::helper('dropship360')->__('Percentage to Trigger Notification For Transmitting (%)'),
91
  'required' => true,
92
+ 'title' => Mage::helper('dropship360')->__('Percentage to Trigger Notification For Transmitting'),
93
  'value' => isset($formData['notification_transmitting']) ? $formData['notification_transmitting'] : '',
94
  'class' => ' validate-digits validate-number-range number-range-1-99'
95
 
97
 
98
  $fieldset->addField('notification_backorder', 'text', array(
99
  'name' => 'notification_backorder',
100
+ 'label' => Mage::helper('dropship360')->__('Percentage to Trigger Notification For Backorder(%)'),
101
  'required' => true,
102
+ 'title' => Mage::helper('dropship360')->__('Percentage to Trigger Notification For Backorder'),
103
  'value' => isset($formData['notification_backorder']) ? $formData['notification_backorder'] : '',
104
  'class' => ' validate-digits validate-number-range number-range-1-99'
105
 
106
  ));
107
  $fieldset->addField('notification_sent_to_supplier', 'text', array(
108
  'name' => 'notification_sent_to_supplier',
109
+ 'label' => Mage::helper('dropship360')->__('Percentage to Trigger Notification For Sent To Supplier (%)'),
110
  'required' => true,
111
+ 'title' => Mage::helper('dropship360')->__('Percentage to Trigger Notification For Sent To Supplier'),
112
  'value' => isset($formData['notification_sent_to_supplier']) ? $formData['notification_sent_to_supplier'] : '',
113
  'class' => ' validate-digits validate-number-range number-range-1-99'
114
 
125
  ));
126
  $fieldset->addField('email_adress', 'text', array(
127
  'name' => 'email',
128
+ 'label' => Mage::helper('dropship360')->__('Email Address'),
129
+ 'title' => Mage::helper('dropship360')->__('Email Address'),
130
  'required'=> true,
131
  'value' => isset($formData['email']) ? $formData['email'] : '',
132
  'class' => 'email-adress'
143
  $fieldset->addField('dropshipstatus', 'select', array(
144
  'name' => 'dropshipstatus',
145
  'options' => $this->prepareOptionValue(),
146
+ 'label' => Mage::helper('dropship360')->__('Dropship Status'),
147
+ 'title' => Mage::helper('dropship360')->__('Dropship Status'),
148
  'value' => isset($formData['dropshipstatus']) ? $formData['dropshipstatus'] : '',
149
  'required'=> true
150
 
153
  $fieldset->addField('select_monitor_order', 'timestatus', array(
154
  'name' => 'select_monitor_order',
155
  'options' => array(
156
+ 'day' => Mage::helper('dropship360')->__('Days'),
157
+ 'hour' => Mage::helper('dropship360')->__('Hours')
158
 
159
  ),
160
+ 'label' => Mage::helper('dropship360')->__('Period to Monitor All Orders'),
161
+ 'title' => Mage::helper('dropship360')->__('Period to Monitor All Orders'),
162
  'inputname' => 'input_monitor_order',
163
  'selectvalue' => isset($formData['select_monitor_order']) ? $formData['select_monitor_order'] : '',
164
  'inputvalue' => isset($formData['input_monitor_order']) ? $formData['input_monitor_order'] : '',
168
  $fieldset->addField('select_open_monitor', 'timestatus', array(
169
  'name' => 'select_open_monitor',
170
  'options' => array(
171
+ 'day' => Mage::helper('dropship360')->__('Days'),
172
+ 'hour' => Mage::helper('dropship360')->__('Hours')
173
 
174
  ),
175
+ 'label' => Mage::helper('dropship360')->__('Period Open to Monitor'),
176
+ 'title' => Mage::helper('dropship360')->__('Period Open to Monitor'),
177
  'inputname' => 'input_open_monitor',
178
  'selectvalue' => isset($formData['select_open_monitor']) ? $formData['select_open_monitor'] : '' ,
179
  'inputvalue' => isset($formData['input_open_monitor']) ? $formData['input_open_monitor'] : '',
189
 
190
  protected function prepareOptionValue(){
191
 
192
+ $itemStatus = Mage::helper('dropship360')->getItemStatuses();
193
  $options = array();
194
+ $options[' '] = Mage::helper('dropship360')->__('--Please Select--');
195
  foreach($itemStatus as $status )
196
  {
197
  if(in_array($status,array('Transmitting','Backorder','Sent to Supplier')))
198
+ $options[$status] = Mage::helper('dropship360')->__($status);
199
  }
200
  return $options;
201
  }
204
  protected function _getAdditionalElementTypes()
205
  {
206
  return array(
207
+ 'timestatus' => Mage::getConfig()->getBlockClassName('dropship360/adminhtml_reports_form_timestatus'),
208
+ 'getemailaddress' => Mage::getConfig()->getBlockClassName('dropship360/adminhtml_upload_edit_button')
209
  );
210
  }
211
 
app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Reports/Activitymonitor/Grid.php CHANGED
@@ -60,16 +60,16 @@ protected function _prepareCollection()
60
  protected function _prepareColumns()
61
  {
62
  $this->addColumn('period', array(
63
- 'header' => Mage::helper('logicbroker')->__('Period Open'),
64
  'align' =>'right',
65
  'width' => 50,
66
  'index' => 'period',
67
  'sortable' => false,
68
  'filter' => false,
69
- 'renderer' => 'logicbroker/adminhtml_reports_activitymonitor_periodopen',
70
  ));
71
  $this->addColumn('increment_id', array(
72
- 'header' => Mage::helper('logicbroker')->__('Order#'),
73
  'align' =>'right',
74
  'width' => 50,
75
  'index' => 'increment_id',
@@ -77,7 +77,7 @@ protected function _prepareCollection()
77
  'filter' => false
78
  ));
79
  $this->addColumn('lb_vendor_name', array(
80
- 'header' => Mage::helper('logicbroker')->__('Supplier'),
81
  'align' =>'right',
82
  'width' => 50,
83
  'index' => 'lb_vendor_name',
@@ -86,7 +86,7 @@ protected function _prepareCollection()
86
  ));
87
 
88
  $this->addColumn('vendor_cost', array(
89
- 'header' => Mage::helper('logicbroker')->__('Cost'),
90
  'align' =>'right',
91
  'width' => 50,
92
  'index' => 'vendor_cost',
@@ -94,7 +94,7 @@ protected function _prepareCollection()
94
  'filter' => false
95
  ));
96
  $this->addColumn('product_name', array(
97
- 'header' => Mage::helper('logicbroker')->__('Product Name'),
98
  'align' =>'left',
99
  'width' => 50,
100
  'index' => 'product_name',
@@ -103,7 +103,7 @@ protected function _prepareCollection()
103
  ));
104
 
105
  $this->addColumn('sku', array(
106
- 'header' => Mage::helper('logicbroker')->__('Product Sku'),
107
  'align' =>'left',
108
  'width' => 50,
109
  'index' => 'sku',
@@ -113,7 +113,7 @@ protected function _prepareCollection()
113
  ));
114
 
115
  $this->addColumn('lb_vendor_sku', array(
116
- 'header' => Mage::helper('logicbroker')->__('Supplier Sku'),
117
  'align' =>'left',
118
  'width' => 50,
119
  'index' => 'lb_vendor_sku',
@@ -123,7 +123,7 @@ protected function _prepareCollection()
123
  ));
124
 
125
  $this->addColumn('updated_at', array(
126
- 'header' => Mage::helper('logicbroker')->__('Last Update'),
127
  'align' =>'left',
128
  'width' => 50,
129
  'index' => 'updated_at',
@@ -133,7 +133,7 @@ protected function _prepareCollection()
133
  ));
134
 
135
  $this->addColumn('created_at', array(
136
- 'header' => Mage::helper('logicbroker')->__('Order Date'),
137
  'align' =>'left',
138
  'width' => 80,
139
  'index' => 'created_at',
@@ -143,7 +143,7 @@ protected function _prepareCollection()
143
  ));
144
 
145
  $this->addColumn('lb_item_status', array(
146
- 'header' => Mage::helper('logicbroker')->__('Item Status'),
147
  'align' =>'left',
148
  'width' => 50,
149
  'index' => 'lb_item_status',
60
  protected function _prepareColumns()
61
  {
62
  $this->addColumn('period', array(
63
+ 'header' => Mage::helper('dropship360')->__('Period Open'),
64
  'align' =>'right',
65
  'width' => 50,
66
  'index' => 'period',
67
  'sortable' => false,
68
  'filter' => false,
69
+ 'renderer' => 'dropship360/adminhtml_reports_activitymonitor_periodopen',
70
  ));
71
  $this->addColumn('increment_id', array(
72
+ 'header' => Mage::helper('dropship360')->__('Order#'),
73
  'align' =>'right',
74
  'width' => 50,
75
  'index' => 'increment_id',
77
  'filter' => false
78
  ));
79
  $this->addColumn('lb_vendor_name', array(
80
+ 'header' => Mage::helper('dropship360')->__('Supplier'),
81
  'align' =>'right',
82
  'width' => 50,
83
  'index' => 'lb_vendor_name',
86
  ));
87
 
88
  $this->addColumn('vendor_cost', array(
89
+ 'header' => Mage::helper('dropship360')->__('Cost'),
90
  'align' =>'right',
91
  'width' => 50,
92
  'index' => 'vendor_cost',
94
  'filter' => false
95
  ));
96
  $this->addColumn('product_name', array(
97
+ 'header' => Mage::helper('dropship360')->__('Product Name'),
98
  'align' =>'left',
99
  'width' => 50,
100
  'index' => 'product_name',
103
  ));
104
 
105
  $this->addColumn('sku', array(
106
+ 'header' => Mage::helper('dropship360')->__('Product Sku'),
107
  'align' =>'left',
108
  'width' => 50,
109
  'index' => 'sku',
113
  ));
114
 
115
  $this->addColumn('lb_vendor_sku', array(
116
+ 'header' => Mage::helper('dropship360')->__('Supplier Sku'),
117
  'align' =>'left',
118
  'width' => 50,
119
  'index' => 'lb_vendor_sku',
123
  ));
124
 
125
  $this->addColumn('updated_at', array(
126
+ 'header' => Mage::helper('dropship360')->__('Last Update'),
127
  'align' =>'left',
128
  'width' => 50,
129
  'index' => 'updated_at',
133
  ));
134
 
135
  $this->addColumn('created_at', array(
136
+ 'header' => Mage::helper('dropship360')->__('Order Date'),
137
  'align' =>'left',
138
  'width' => 80,
139
  'index' => 'created_at',
143
  ));
144
 
145
  $this->addColumn('lb_item_status', array(
146
+ 'header' => Mage::helper('dropship360')->__('Item Status'),
147
  'align' =>'left',
148
  'width' => 50,
149
  'index' => 'lb_item_status',
app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Reports/Form/Timestatus.php CHANGED
@@ -16,8 +16,9 @@ class Logicbroker_Dropship360_Block_Adminhtml_Reports_Form_Timestatus extends Va
16
  $selectOption = $this->getOptions();
17
  $inputname = trim($this->getInputname());
18
  $selectValue = ($this->getSelectvalue()) ? $this->getSelectvalue() : '';
19
- $inputValue = ($this->getInputvalue()) ? $this->getInputvalue() : 0;
20
  $display = ($inputValue) ? 'display:block;' : 'display:none;';
 
21
 
22
  foreach($selectOption as $value=>$label){
23
  $isSelect = ($value == $selectValue) ? 'selected="selected"' : '';
@@ -25,7 +26,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Reports_Form_Timestatus extends Va
25
  }
26
 
27
  $html = '<div style = "float: left;"><select name= "'.$this->getName().'" id="'.$this->getId().'" title="'.$this->getTitle().'" class="select '.$required.'" onchange = showinputbox("'.$inputname.'",this)>'.$options.'</select></div>';
28
- $html .= '<div id = "input_box_'.$inputname.'" style = "padding-left:15px;float: left;" class = "'.$inputname.'#'.$this->getName().'" ><input maxlength = "3" name="'.$inputname.'" id="'.$inputname.'" value="'.$inputValue.'" type="text" class=" required-entry validate-digits validate-number-range number-range-1-999 input-text" style="'.$display.'width:110px !important">';
29
  $html .= '<input name="'.$inputname.'_post" id="'.$inputname.'_post" type= "hidden" ></div>';
30
  return $html;
31
 
16
  $selectOption = $this->getOptions();
17
  $inputname = trim($this->getInputname());
18
  $selectValue = ($this->getSelectvalue()) ? $this->getSelectvalue() : '';
19
+ $inputValue = ($this->getInputvalue()) ? $this->getInputvalue() : '';
20
  $display = ($inputValue) ? 'display:block;' : 'display:none;';
21
+ $classInputbox = ($inputValue) ? 'required-entry validate-digits validate-number-range number-range-1-999' : '';
22
 
23
  foreach($selectOption as $value=>$label){
24
  $isSelect = ($value == $selectValue) ? 'selected="selected"' : '';
26
  }
27
 
28
  $html = '<div style = "float: left;"><select name= "'.$this->getName().'" id="'.$this->getId().'" title="'.$this->getTitle().'" class="select '.$required.'" onchange = showinputbox("'.$inputname.'",this)>'.$options.'</select></div>';
29
+ $html .= '<div id = "input_box_'.$inputname.'" style = "padding-left:15px;float: left;" class = "'.$inputname.'#'.$this->getName().'" ><input maxlength = "3" name="'.$inputname.'" id="'.$inputname.'" value="'.$inputValue.'" type="text" class="'.$classInputbox.' input-text" style="'.$display.'width:110px !important">';
30
  $html .= '<input name="'.$inputname.'_post" id="'.$inputname.'_post" type= "hidden" ></div>';
31
  return $html;
32
 
app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Reports/Staticemailgrid.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Adminhtml
23
+ * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Adminhtml sales report page content block
29
+ *
30
+ * @category Mage
31
+ * @package Mage_Adminhtml
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+
35
+ class Logicbroker_Dropship360_Block_Adminhtml_Reports_Staticemailgrid extends Mage_Core_Block_Template
36
+ {
37
+ public function getTemplateFile()
38
+ {
39
+ $params = array('_relative'=>true);
40
+ $area = $this->getArea();
41
+ $package = 'default';
42
+ if ($area) {
43
+ $params['_area'] = $area;
44
+ $params['_package'] = $package;
45
+ }
46
+ $templateName = Mage::getDesign()->getTemplateFilename($this->getTemplate(), $params);
47
+ return $templateName;
48
+ }
49
+
50
+ public function getPeriodToOpen($updatedat){
51
+
52
+ $currentDate = Mage::getModel('core/date')->date();
53
+ $lastUpdateDate = Mage::app()->getLocale()->date($updatedat, Varien_Date::DATETIME_INTERNAL_FORMAT);
54
+ $start_date = new DateTime($currentDate);
55
+ $since_start = $start_date->diff(new DateTime($lastUpdateDate));
56
+ return $since_start->d.' days '.$since_start->h.' hours '.$since_start->i.' minutes' ;
57
+ }
58
+ public function formatDate($date){
59
+ $format = Mage::app()->getLocale()->getDateTimeFormat(
60
+ Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM
61
+ );
62
+ $date = Mage::app()->getLocale()
63
+ ->date($date, Varien_Date::DATETIME_INTERNAL_FORMAT)->toString($format);
64
+ return $date;
65
+ }
66
+ }
app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Sales/Order/View/Items.php CHANGED
@@ -14,10 +14,10 @@ class Logicbroker_Dropship360_Block_Adminhtml_Sales_Order_View_Items extends Mag
14
  */
15
  public function getItemsCollection()
16
  {
17
- $id = $this->getRequest()->getParam('order_id');
18
  $collection = Mage::getResourceModel('sales/order_item_collection');
19
- $collection->getSelect()->joinLeft( array('lbs'=> Mage::getSingleton('core/resource')->getTableName('logicbroker/orderitems')), "main_table.item_id = lbs.item_id",array("lbs.lb_item_status", "lbs.lb_vendor_sku","lbs.lb_vendor_code"))->where("main_table.order_id =".$id);
20
- $collection->getSelect()->joinLeft( array('lbr'=> Mage::getSingleton('core/resource')->getTableName('logicbroker/ranking')), "lbs.lb_vendor_code = lbr.lb_vendor_code",array("lbr.lb_vendor_name"));
21
  return $collection;
22
  }
23
  }
14
  */
15
  public function getItemsCollection()
16
  {
17
+ $id = $this->getOrder()->getId();
18
  $collection = Mage::getResourceModel('sales/order_item_collection');
19
+ $collection->getSelect()->joinLeft( array('lbs'=> Mage::getSingleton('core/resource')->getTableName('dropship360/orderitems')), "main_table.item_id = lbs.item_id",array("lbs.lb_item_status", "lbs.lb_vendor_sku","lbs.lb_vendor_code"))->where("main_table.order_id =".$id);
20
+ $collection->getSelect()->joinLeft( array('lbr'=> Mage::getSingleton('core/resource')->getTableName('dropship360/ranking')), "lbs.lb_vendor_code = lbr.lb_vendor_code",array("lbr.lb_vendor_name"));
21
  return $collection;
22
  }
23
  }
app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Showhistory.php CHANGED
@@ -11,9 +11,9 @@ class Logicbroker_Dropship360_Block_Adminhtml_Showhistory extends Mage_Adminhtml
11
  public function __construct()
12
  {
13
  $this->_controller = 'adminhtml_ranking';
14
- $this->_blockGroup = 'logicbroker';
15
- $this->_headerText = Mage::helper('logicbroker')->__('Supplier Ranking Log');
16
- $this->__addBackButton = Mage::helper('logicbroker')->__('Back');
17
  $this->addButton('back',array(
18
  'label' => 'Back',
19
  'onclick' => 'setLocation(\'' . $this->getUrl('*/*/') .'\')',
@@ -26,7 +26,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Showhistory extends Mage_Adminhtml
26
  }
27
 
28
  public function getLogCollection(){
29
- $collection = Mage::getModel('logicbroker/rankinglog')->getCollection();
30
  $collection->getSelect()->order('created_at desc');
31
  $logtable = array();
32
  foreach($collection as $value){
11
  public function __construct()
12
  {
13
  $this->_controller = 'adminhtml_ranking';
14
+ $this->_blockGroup = 'dropship360';
15
+ $this->_headerText = Mage::helper('dropship360')->__('Supplier Ranking Log');
16
+ $this->__addBackButton = Mage::helper('dropship360')->__('Back');
17
  $this->addButton('back',array(
18
  'label' => 'Back',
19
  'onclick' => 'setLocation(\'' . $this->getUrl('*/*/') .'\')',
26
  }
27
 
28
  public function getLogCollection(){
29
+ $collection = Mage::getModel('dropship360/rankinglog')->getCollection();
30
  $collection->getSelect()->order('created_at desc');
31
  $logtable = array();
32
  foreach($collection as $value){
app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Sourcing.php CHANGED
@@ -11,17 +11,17 @@ class Logicbroker_Dropship360_Block_Adminhtml_Sourcing extends Mage_Adminhtml_Bl
11
  public function __construct()
12
  {
13
  $this->_controller = 'adminhtml_sourcing';
14
- $this->_blockGroup = 'logicbroker';
15
- $this->_headerText = Mage::helper('logicbroker')->__('PO Management');
16
- $this->_addButtonLabel = Mage::helper('logicbroker')->__('Add Supplier');
17
  parent::__construct();
18
  $this->removeButton('add');
19
  }
20
 
21
  public function getLbOrderItemsDetails($item){
22
 
23
- $lbItemCollection = Mage::getModel('logicbroker/orderitems')->getCollection()->addFieldTofilter('item_order_id',$item->getOrderId())->addFieldTofilter('sku',$item->getSku());
24
- $lbItemCollection->getSelect()->joinLeft( array('lbr'=> Mage::getSingleton('core/resource')->getTableName('logicbroker/ranking')), "main_table.lb_vendor_code = lbr.lb_vendor_code",array("lbr.lb_vendor_name"));
25
  return $lbItemCollection->getFirstItem ();
26
  }
27
  }
11
  public function __construct()
12
  {
13
  $this->_controller = 'adminhtml_sourcing';
14
+ $this->_blockGroup = 'dropship360';
15
+ $this->_headerText = Mage::helper('dropship360')->__('PO Management');
16
+ $this->_addButtonLabel = Mage::helper('dropship360')->__('Add Supplier');
17
  parent::__construct();
18
  $this->removeButton('add');
19
  }
20
 
21
  public function getLbOrderItemsDetails($item){
22
 
23
+ $lbItemCollection = Mage::getModel('dropship360/orderitems')->getCollection()->addFieldTofilter('item_order_id',$item->getOrderId())->addFieldTofilter('sku',$item->getSku());
24
+ $lbItemCollection->getSelect()->joinLeft( array('lbr'=> Mage::getSingleton('core/resource')->getTableName('dropship360/ranking')), "main_table.lb_vendor_code = lbr.lb_vendor_code",array("lbr.lb_vendor_name"));
25
  return $lbItemCollection->getFirstItem ();
26
  }
27
  }
app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Sourcing/Edit.php CHANGED
@@ -14,12 +14,12 @@ class Logicbroker_Dropship360_Block_Adminhtml_Sourcing_Edit extends Mage_Adminht
14
 
15
 
16
  $this->_objectId = 'lb_item_id';
17
- $this->_blockGroup = 'logicbroker';
18
  $this->_controller = 'adminhtml_sourcing';
19
  parent::__construct();
20
 
21
- $this->_updateButton('save', 'label', Mage::helper('logicbroker')->__('Save Sourcing'));
22
- $this->_updateButton('delete', 'label', Mage::helper('logicbroker')->__('Delete Supplier'));
23
 
24
  $this->_addButton('saveandcontinue', array(
25
  'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
@@ -58,9 +58,9 @@ class Logicbroker_Dropship360_Block_Adminhtml_Sourcing_Edit extends Mage_Adminht
58
  public function getHeaderText()
59
  {
60
  if( Mage::registry('sourcing_data') && Mage::registry('sourcing_data')->getLbItemId() ) {
61
- return Mage::helper('logicbroker')->__("Edit Item Sourcing Supplier", $this->htmlEscape(Mage::registry('sourcing_data')->getTitle()));
62
  } else {
63
- return Mage::helper('logicbroker')->__('Select Sourcing Supplier');
64
  }
65
  }
66
 
14
 
15
 
16
  $this->_objectId = 'lb_item_id';
17
+ $this->_blockGroup = 'dropship360';
18
  $this->_controller = 'adminhtml_sourcing';
19
  parent::__construct();
20
 
21
+ $this->_updateButton('save', 'label', Mage::helper('dropship360')->__('Save Sourcing'));
22
+ $this->_updateButton('delete', 'label', Mage::helper('dropship360')->__('Delete Supplier'));
23
 
24
  $this->_addButton('saveandcontinue', array(
25
  'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
58
  public function getHeaderText()
59
  {
60
  if( Mage::registry('sourcing_data') && Mage::registry('sourcing_data')->getLbItemId() ) {
61
+ return Mage::helper('dropship360')->__("Edit Item Sourcing Supplier", $this->htmlEscape(Mage::registry('sourcing_data')->getTitle()));
62
  } else {
63
+ return Mage::helper('dropship360')->__('Select Sourcing Supplier');
64
  }
65
  }
66
 
app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Sourcing/Edit/Tab/Form.php CHANGED
@@ -22,21 +22,21 @@ class Logicbroker_Dropship360_Block_Adminhtml_Sourcing_Edit_Tab_Form extends Mag
22
  $form = new Varien_Data_Form();
23
  $sku = Mage::registry('sourcing_data')->getData('sku');
24
  $this->setForm($form);
25
- $fieldset = $form->addFieldset('logicbroker_form', array('legend'=>Mage::helper('logicbroker')->__('Item Sourcing Information')));
26
 
27
  if(in_array(Mage::registry('sourcing_data')->getData('lb_item_status'),$this->_statusArray)){
28
  $fieldset->addField('lb_vendor_code', 'select', array(
29
- 'label' => Mage::helper('logicbroker')->__('Supplier'),
30
  'class' => 'required-entry validate-select',
31
  'required' => true,
32
  'name' => 'lb_vendor_code',
33
- 'values' => Mage::getModel('logicbroker/system_config_source_vendorlist')->vendorListSourcing(true,$sku),
34
  'default' => '',
35
  'note' => 'Select your Dropship Supplier to source this item and bypass the dropship360 sourcing rule.'
36
  ));
37
  }
38
  $fieldset->addField('lb_item_status', 'text', array(
39
- 'label' => Mage::helper('logicbroker')->__('Logicbroker Item Status'),
40
  'name' => 'lb_item_status',
41
  'note'=>'Read only filed',
42
  'readonly'=> true
@@ -44,7 +44,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Sourcing_Edit_Tab_Form extends Mag
44
 
45
 
46
  $fieldset->addField('sku', 'text', array(
47
- 'label' => Mage::helper('logicbroker')->__('Sku'),
48
  'name' => 'sku',
49
  'note'=>'Read only filed',
50
  'readonly'=> true
22
  $form = new Varien_Data_Form();
23
  $sku = Mage::registry('sourcing_data')->getData('sku');
24
  $this->setForm($form);
25
+ $fieldset = $form->addFieldset('logicbroker_form', array('legend'=>Mage::helper('dropship360')->__('Item Sourcing Information')));
26
 
27
  if(in_array(Mage::registry('sourcing_data')->getData('lb_item_status'),$this->_statusArray)){
28
  $fieldset->addField('lb_vendor_code', 'select', array(
29
+ 'label' => Mage::helper('dropship360')->__('Supplier'),
30
  'class' => 'required-entry validate-select',
31
  'required' => true,
32
  'name' => 'lb_vendor_code',
33
+ 'values' => Mage::getModel('dropship360/system_config_source_vendorlist')->vendorListSourcing(true,$sku),
34
  'default' => '',
35
  'note' => 'Select your Dropship Supplier to source this item and bypass the dropship360 sourcing rule.'
36
  ));
37
  }
38
  $fieldset->addField('lb_item_status', 'text', array(
39
+ 'label' => Mage::helper('dropship360')->__('Logicbroker Item Status'),
40
  'name' => 'lb_item_status',
41
  'note'=>'Read only filed',
42
  'readonly'=> true
44
 
45
 
46
  $fieldset->addField('sku', 'text', array(
47
+ 'label' => Mage::helper('dropship360')->__('Sku'),
48
  'name' => 'sku',
49
  'note'=>'Read only filed',
50
  'readonly'=> true
app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Sourcing/Edit/Tabs.php CHANGED
@@ -16,15 +16,15 @@ class Logicbroker_Dropship360_Block_Adminhtml_Sourcing_Edit_Tabs extends Mage_Ad
16
  parent::__construct();
17
  $this->setId('logicbroker_tabs');
18
  $this->setDestElementId('edit_form');
19
- $this->setTitle(Mage::helper('logicbroker')->__('Item Sourcing Information'));
20
  }
21
 
22
  protected function _beforeToHtml()
23
  {
24
  $this->addTab('form_section', array(
25
- 'label' => Mage::helper('logicbroker')->__('Item Sourcing Information'),
26
- 'title' => Mage::helper('logicbroker')->__('Item Sourcing Information'),
27
- 'content' => $this->getLayout()->createBlock('logicbroker/adminhtml_sourcing_edit_tab_form')->toHtml(),
28
  ));
29
 
30
  return parent::_beforeToHtml();
16
  parent::__construct();
17
  $this->setId('logicbroker_tabs');
18
  $this->setDestElementId('edit_form');
19
+ $this->setTitle(Mage::helper('dropship360')->__('Item Sourcing Information'));
20
  }
21
 
22
  protected function _beforeToHtml()
23
  {
24
  $this->addTab('form_section', array(
25
+ 'label' => Mage::helper('dropship360')->__('Item Sourcing Information'),
26
+ 'title' => Mage::helper('dropship360')->__('Item Sourcing Information'),
27
+ 'content' => $this->getLayout()->createBlock('dropship360/adminhtml_sourcing_edit_tab_form')->toHtml(),
28
  ));
29
 
30
  return parent::_beforeToHtml();
app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Sourcing/Grid.php CHANGED
@@ -27,13 +27,13 @@ class Logicbroker_Dropship360_Block_Adminhtml_Sourcing_Grid extends Mage_Adminht
27
  $collection->getSelect()->columns('if(`main_table`.`row_total` <> 0, `main_table`.`row_total`,(SELECT config.`row_total` FROM '.$tableName.' as simple INNER JOIN '.$tableName.' as config
28
  ON (simple.parent_item_id = config.item_id) where simple.item_id= `main_table`.`item_id`)) as row_total');
29
 
30
- $collection->getSelect()->join(array('lbItems'=>Mage::getSingleton('core/resource')->getTableName('logicbroker/orderitems')),
31
  'lbItems.item_id = main_table.item_id', array('item_order_id','lb_item_id'=>'id','lb_item_status','magento_sku'=>'sku','lb_vendor_code','lb_vendor_sku','vendor_cost','updated_by','updated_at'));
32
 
33
  $collection->getSelect()->join(array('salesOrder'=>Mage::getSingleton('core/resource')->getTableName('sales/order')),
34
  'salesOrder.entity_id = main_table.order_id', array('increment_id','status','created_at'));
35
 
36
- $collection->getSelect()->joinleft(array('lbRanking'=>Mage::getSingleton('core/resource')->getTableName('logicbroker/ranking')),
37
  'lbRanking.lb_vendor_code = lbItems.lb_vendor_code', array('lb_vendor_name'));
38
  $this->setCollection($collection);
39
  return parent::_prepareCollection();
@@ -47,10 +47,10 @@ ON (simple.parent_item_id = config.item_id) where simple.item_id= `main_table`.`
47
 
48
  protected function prepareOptionValue(){
49
 
50
- $itemStatus = array_merge(Mage::helper('logicbroker')->getItemStatuses(), array('Sent to Vendor'));
51
  foreach($itemStatus as $status )
52
  {
53
- $options[$status] = Mage::helper('logicbroker')->__($status);
54
  }
55
  return $options;
56
  }
@@ -58,13 +58,13 @@ ON (simple.parent_item_id = config.item_id) where simple.item_id= `main_table`.`
58
  protected function _prepareColumns()
59
  {
60
  $this->addColumn('increment_id', array(
61
- 'header' => Mage::helper('logicbroker')->__('Order #'),
62
  'align' =>'right',
63
  'width' => '50px',
64
  'index' => 'increment_id',
65
  ));
66
  $this->addColumn('created_at', array(
67
- 'header' => Mage::helper('logicbroker')->__('Order Date'),
68
  'align' =>'right',
69
  'width' => '50px',
70
  'type' => 'datetime',
@@ -72,7 +72,7 @@ ON (simple.parent_item_id = config.item_id) where simple.item_id= `main_table`.`
72
  'index' => 'created_at',
73
  ));
74
  $this->addColumn('magento_sku', array(
75
- 'header' => Mage::helper('logicbroker')->__('Product Sku'),
76
  'align' =>'right',
77
  'width' => '50px',
78
  "filter_index" => "lbItems.sku",
@@ -80,7 +80,7 @@ ON (simple.parent_item_id = config.item_id) where simple.item_id= `main_table`.`
80
  ));
81
 
82
  $this->addColumn('lb_vendor_name', array(
83
- 'header' => Mage::helper('logicbroker')->__('Supplier'),
84
  'align' =>'left',
85
  'width' => '80px',
86
  'index' => 'lb_vendor_name',
@@ -88,14 +88,14 @@ ON (simple.parent_item_id = config.item_id) where simple.item_id= `main_table`.`
88
 
89
 
90
  $this->addColumn('lb_vendor_sku', array(
91
- 'header' => Mage::helper('logicbroker')->__('Supplier Sku'),
92
  'align' =>'left',
93
  'width' => '80px',
94
  'index' => 'lb_vendor_sku',
95
  ));
96
  $store = $this->_getStore();
97
  $this->addColumn('vendor_cost', array(
98
- 'header' => Mage::helper('logicbroker')->__('Supplier Cost'),
99
  'align' =>'left',
100
  'width' => '80px',
101
  'index' => 'vendor_cost',
@@ -104,7 +104,7 @@ ON (simple.parent_item_id = config.item_id) where simple.item_id= `main_table`.`
104
  ));
105
 
106
  $this->addColumn('row_total', array(
107
- 'header' => Mage::helper('logicbroker')->__('Price'),
108
  'align' =>'left',
109
  'width' => '80px',
110
  'index' => 'row_total',
@@ -112,7 +112,7 @@ ON (simple.parent_item_id = config.item_id) where simple.item_id= `main_table`.`
112
  'currency_code' => $store->getBaseCurrency()->getCode(),
113
  ));
114
  $this->addColumn('qty_ordered', array(
115
- 'header' => Mage::helper('logicbroker')->__('Qty'),
116
  'align' =>'left',
117
  'width' => '80px',
118
  'index' => 'qty_ordered',
@@ -120,7 +120,7 @@ ON (simple.parent_item_id = config.item_id) where simple.item_id= `main_table`.`
120
 
121
 
122
  $this->addColumn('lb_item_status', array(
123
- 'header' => Mage::helper('logicbroker')->__('Drop Ship Status'),
124
  'align' =>'left',
125
  'width' => '80px',
126
  'index' => 'lb_item_status',
@@ -129,7 +129,7 @@ ON (simple.parent_item_id = config.item_id) where simple.item_id= `main_table`.`
129
  ));
130
 
131
  $this->addColumn('status', array(
132
- 'header' => Mage::helper('logicbroker')->__('Order Status'),
133
  'align' =>'left',
134
  'width' => '80px',
135
  'index' => 'status',
@@ -138,7 +138,7 @@ ON (simple.parent_item_id = config.item_id) where simple.item_id= `main_table`.`
138
  ));
139
 
140
  $this->addColumn('updated_by', array(
141
- 'header' => Mage::helper('logicbroker')->__('Last Updated By'),
142
  'align' =>'left',
143
  'width' => '80px',
144
  'index' => 'updated_by',
@@ -151,7 +151,7 @@ ON (simple.parent_item_id = config.item_id) where simple.item_id= `main_table`.`
151
  )
152
  ));
153
  $this->addColumn('updated_at', array(
154
- 'header' => Mage::helper('logicbroker')->__('Updated On'),
155
  'align' =>'right',
156
  'width' => '50px',
157
  'type' => 'datetime',
@@ -165,7 +165,7 @@ ON (simple.parent_item_id = config.item_id) where simple.item_id= `main_table`.`
165
  'header' => Mage::helper('sales')->__('Action'),
166
  'width' => '50px',
167
  'type' => 'action',
168
- 'renderer' => 'logicbroker/adminhtml_sourcing_history_renderer_action',
169
  'filter' => false,
170
  'sortable' => false,
171
  'index' => 'stores',
@@ -174,7 +174,7 @@ ON (simple.parent_item_id = config.item_id) where simple.item_id= `main_table`.`
174
 
175
  $this->addColumn('action',
176
  array(
177
- 'header' => Mage::helper('logicbroker')->__('Edit'),
178
  'width' => '100px',
179
  'type' => 'textaction',
180
  'filter' => false,
@@ -185,8 +185,8 @@ ON (simple.parent_item_id = config.item_id) where simple.item_id= `main_table`.`
185
  ));
186
 
187
 
188
- $this->addExportType('*/*/exportCsv', Mage::helper('logicbroker')->__('CSV'));
189
- $this->addExportType('*/*/exportXml', Mage::helper('logicbroker')->__('XML'));
190
  return parent::_prepareColumns();
191
  }
192
 
27
  $collection->getSelect()->columns('if(`main_table`.`row_total` <> 0, `main_table`.`row_total`,(SELECT config.`row_total` FROM '.$tableName.' as simple INNER JOIN '.$tableName.' as config
28
  ON (simple.parent_item_id = config.item_id) where simple.item_id= `main_table`.`item_id`)) as row_total');
29
 
30
+ $collection->getSelect()->join(array('lbItems'=>Mage::getSingleton('core/resource')->getTableName('dropship360/orderitems')),
31
  'lbItems.item_id = main_table.item_id', array('item_order_id','lb_item_id'=>'id','lb_item_status','magento_sku'=>'sku','lb_vendor_code','lb_vendor_sku','vendor_cost','updated_by','updated_at'));
32
 
33
  $collection->getSelect()->join(array('salesOrder'=>Mage::getSingleton('core/resource')->getTableName('sales/order')),
34
  'salesOrder.entity_id = main_table.order_id', array('increment_id','status','created_at'));
35
 
36
+ $collection->getSelect()->joinleft(array('lbRanking'=>Mage::getSingleton('core/resource')->getTableName('dropship360/ranking')),
37
  'lbRanking.lb_vendor_code = lbItems.lb_vendor_code', array('lb_vendor_name'));
38
  $this->setCollection($collection);
39
  return parent::_prepareCollection();
47
 
48
  protected function prepareOptionValue(){
49
 
50
+ $itemStatus = array_merge(Mage::helper('dropship360')->getItemStatuses(), array('Sent to Vendor'));
51
  foreach($itemStatus as $status )
52
  {
53
+ $options[$status] = Mage::helper('dropship360')->__($status);
54
  }
55
  return $options;
56
  }
58
  protected function _prepareColumns()
59
  {
60
  $this->addColumn('increment_id', array(
61
+ 'header' => Mage::helper('dropship360')->__('Order #'),
62
  'align' =>'right',
63
  'width' => '50px',
64
  'index' => 'increment_id',
65
  ));
66
  $this->addColumn('created_at', array(
67
+ 'header' => Mage::helper('dropship360')->__('Order Date'),
68
  'align' =>'right',
69
  'width' => '50px',
70
  'type' => 'datetime',
72
  'index' => 'created_at',
73
  ));
74
  $this->addColumn('magento_sku', array(
75
+ 'header' => Mage::helper('dropship360')->__('Product Sku'),
76
  'align' =>'right',
77
  'width' => '50px',
78
  "filter_index" => "lbItems.sku",
80
  ));
81
 
82
  $this->addColumn('lb_vendor_name', array(
83
+ 'header' => Mage::helper('dropship360')->__('Supplier'),
84
  'align' =>'left',
85
  'width' => '80px',
86
  'index' => 'lb_vendor_name',
88
 
89
 
90
  $this->addColumn('lb_vendor_sku', array(
91
+ 'header' => Mage::helper('dropship360')->__('Supplier Sku'),
92
  'align' =>'left',
93
  'width' => '80px',
94
  'index' => 'lb_vendor_sku',
95
  ));
96
  $store = $this->_getStore();
97
  $this->addColumn('vendor_cost', array(
98
+ 'header' => Mage::helper('dropship360')->__('Supplier Cost'),
99
  'align' =>'left',
100
  'width' => '80px',
101
  'index' => 'vendor_cost',
104
  ));
105
 
106
  $this->addColumn('row_total', array(
107
+ 'header' => Mage::helper('dropship360')->__('Price'),
108
  'align' =>'left',
109
  'width' => '80px',
110
  'index' => 'row_total',
112
  'currency_code' => $store->getBaseCurrency()->getCode(),
113
  ));
114
  $this->addColumn('qty_ordered', array(
115
+ 'header' => Mage::helper('dropship360')->__('Qty'),
116
  'align' =>'left',
117
  'width' => '80px',
118
  'index' => 'qty_ordered',
120
 
121
 
122
  $this->addColumn('lb_item_status', array(
123
+ 'header' => Mage::helper('dropship360')->__('Drop Ship Status'),
124
  'align' =>'left',
125
  'width' => '80px',
126
  'index' => 'lb_item_status',
129
  ));
130
 
131
  $this->addColumn('status', array(
132
+ 'header' => Mage::helper('dropship360')->__('Order Status'),
133
  'align' =>'left',
134
  'width' => '80px',
135
  'index' => 'status',
138
  ));
139
 
140
  $this->addColumn('updated_by', array(
141
+ 'header' => Mage::helper('dropship360')->__('Last Updated By'),
142
  'align' =>'left',
143
  'width' => '80px',
144
  'index' => 'updated_by',
151
  )
152
  ));
153
  $this->addColumn('updated_at', array(
154
+ 'header' => Mage::helper('dropship360')->__('Updated On'),
155
  'align' =>'right',
156
  'width' => '50px',
157
  'type' => 'datetime',
165
  'header' => Mage::helper('sales')->__('Action'),
166
  'width' => '50px',
167
  'type' => 'action',
168
+ 'renderer' => 'dropship360/adminhtml_sourcing_history_renderer_action',
169
  'filter' => false,
170
  'sortable' => false,
171
  'index' => 'stores',
174
 
175
  $this->addColumn('action',
176
  array(
177
+ 'header' => Mage::helper('dropship360')->__('Edit'),
178
  'width' => '100px',
179
  'type' => 'textaction',
180
  'filter' => false,
185
  ));
186
 
187
 
188
+ $this->addExportType('*/*/exportCsv', Mage::helper('dropship360')->__('CSV'));
189
+ $this->addExportType('*/*/exportXml', Mage::helper('dropship360')->__('XML'));
190
  return parent::_prepareColumns();
191
  }
192
 
app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Sourcing/History/View.php CHANGED
@@ -13,7 +13,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Sourcing_History_View extends Mage
13
  public function __construct()
14
  {
15
  $this->_objectId = 'lb_item_id';
16
- $this->_blockGroup = 'logicbroker';
17
  $this->_controller = 'adminhtml_sourcing_history';
18
  $this->_mode = 'view';
19
  parent::__construct();
@@ -38,7 +38,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Sourcing_History_View extends Mage
38
  public function getHeaderText()
39
  {
40
  $itemId = $this->getRequest()->getParam('lb_item_id');
41
- $orderItems = Mage::getModel('logicbroker/orderitems')->load($itemId, 'item_id');
42
  $orderId = Mage::getModel('sales/order')->load($orderItems->getItemOrderId())->getIncrementId();
43
  $createdDate = Mage::helper('core')->formatDate($orderItems->getCreatedAt(), 'medium', true);
44
  return Mage::helper('sales')->__('Item Sku %s | Order # %s | %s', $orderItems->getSku(), $orderId, $createdDate);
13
  public function __construct()
14
  {
15
  $this->_objectId = 'lb_item_id';
16
+ $this->_blockGroup = 'dropship360';
17
  $this->_controller = 'adminhtml_sourcing_history';
18
  $this->_mode = 'view';
19
  parent::__construct();
38
  public function getHeaderText()
39
  {
40
  $itemId = $this->getRequest()->getParam('lb_item_id');
41
+ $orderItems = Mage::getModel('dropship360/orderitems')->load($itemId, 'item_id');
42
  $orderId = Mage::getModel('sales/order')->load($orderItems->getItemOrderId())->getIncrementId();
43
  $createdDate = Mage::helper('core')->formatDate($orderItems->getCreatedAt(), 'medium', true);
44
  return Mage::helper('sales')->__('Item Sku %s | Order # %s | %s', $orderItems->getSku(), $orderId, $createdDate);
app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Sourcing/History/View/Form.php CHANGED
@@ -22,7 +22,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Sourcing_History_View_Form extends
22
  public function getHistory()
23
  {
24
  $lbItemId = Mage::app()->getRequest()->getParam('lb_item_id');
25
- $itemStatusHistory = Mage::getModel ( 'logicbroker/orderitems' )->load($lbItemId, 'item_id')->getItemStatusHistory();
26
  return unserialize($itemStatusHistory);
27
  }
28
 
22
  public function getHistory()
23
  {
24
  $lbItemId = Mage::app()->getRequest()->getParam('lb_item_id');
25
+ $itemStatusHistory = Mage::getModel ( 'dropship360/orderitems' )->load($lbItemId, 'item_id')->getItemStatusHistory();
26
  return unserialize($itemStatusHistory);
27
  }
28
 
app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Sourcing/History/View/Tabs.php CHANGED
@@ -13,14 +13,14 @@ class Logicbroker_Dropship360_Block_Adminhtml_Sourcing_History_View_Tabs extends
13
  parent::__construct();
14
  $this->setId('adminhtml_sourcing_history_view');
15
  $this->setDestElementId('history_view');
16
- $this->setTitle(Mage::helper('logicbroker')->__('Order Item History'));
17
  }
18
 
19
  protected function _beforeToHtml()
20
  {
21
  $this->addTab('form_section', array(
22
- 'label' => Mage::helper('logicbroker')->__('Order Item History'),
23
- 'title' => Mage::helper('logicbroker')->__('Order Item History'),
24
  ));
25
 
26
  return parent::_beforeToHtml();
13
  parent::__construct();
14
  $this->setId('adminhtml_sourcing_history_view');
15
  $this->setDestElementId('history_view');
16
+ $this->setTitle(Mage::helper('dropship360')->__('Order Item History'));
17
  }
18
 
19
  protected function _beforeToHtml()
20
  {
21
  $this->addTab('form_section', array(
22
+ 'label' => Mage::helper('dropship360')->__('Order Item History'),
23
+ 'title' => Mage::helper('dropship360')->__('Order Item History'),
24
  ));
25
 
26
  return parent::_beforeToHtml();
app/code/community/Logicbroker/Dropship360/Block/Adminhtml/System/Config/Fieldset/Hint.php CHANGED
@@ -29,7 +29,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_System_Config_Fieldset_Hint
29
 
30
  public function getStoreList(){
31
 
32
- return Mage::getModel('logicbroker/system_config_source_store')->toOptionArray();
33
 
34
  }
35
 
29
 
30
  public function getStoreList(){
31
 
32
+ return Mage::getModel('dropship360/system_config_source_store')->toOptionArray();
33
 
34
  }
35
 
app/code/community/Logicbroker/Dropship360/Block/Adminhtml/System/Config/Ftpconnectionbutton.php CHANGED
@@ -91,11 +91,11 @@ class Logicbroker_Dropship360_Block_Adminhtml_System_Config_Ftpconnectionbutton
91
 
92
  public function getTermsAndConditionsUrl()
93
  {
94
- return Mage::helper('logicbroker')->getConfigObject('apiconfig/termsandconditions/link');
95
  }
96
 
97
  public function getHelpUrl()
98
  {
99
- return Mage::helper('logicbroker')->getConfigObject('apiconfig/helpurl/link');
100
  }
101
  }
91
 
92
  public function getTermsAndConditionsUrl()
93
  {
94
+ return Mage::helper('dropship360')->getConfigObject('apiconfig/termsandconditions/link');
95
  }
96
 
97
  public function getHelpUrl()
98
  {
99
+ return Mage::helper('dropship360')->getConfigObject('apiconfig/helpurl/link');
100
  }
101
  }
app/code/community/Logicbroker/Dropship360/Block/Adminhtml/System/Config/Helplink.php CHANGED
@@ -10,7 +10,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_System_Config_Helplink extends Mag
10
  {
11
  protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
12
  {
13
- $url = Mage::helper('logicbroker')->getConfigObject('apiconfig/helpurl/link');
14
  $html = parent::_getElementHtml($element);
15
  $html .= "<a href='{$url}' target='_blank' title='logicbroker'>Visit dropship360 Knowledge Base</a>";
16
  return $html;
10
  {
11
  protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
12
  {
13
+ $url = Mage::helper('dropship360')->getConfigObject('apiconfig/helpurl/link');
14
  $html = parent::_getElementHtml($element);
15
  $html .= "<a href='{$url}' target='_blank' title='logicbroker'>Visit dropship360 Knowledge Base</a>";
16
  return $html;
app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Upload.php CHANGED
@@ -64,7 +64,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Upload extends Mage_Adminhtml_Bloc
64
  protected function _construct()
65
  {
66
  parent::_construct();
67
- $this->_blockGroup = 'logicbroker';
68
  $this->_controller = 'adminhtml_upload';
69
  }
70
 
@@ -95,7 +95,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Upload extends Mage_Adminhtml_Bloc
95
  protected function getActiveRankers()
96
  {
97
  $rankersArray = array();
98
- $collection = Mage::getModel('logicbroker/ranking')->getCollection()->addFieldToFilter('is_dropship','yes');
99
  if($collection->count() > 0){
100
  foreach($collection as $data){
101
  $rankersArray[] = $data->getLbVendorCode();
64
  protected function _construct()
65
  {
66
  parent::_construct();
67
+ $this->_blockGroup = 'dropship360';
68
  $this->_controller = 'adminhtml_upload';
69
  }
70
 
95
  protected function getActiveRankers()
96
  {
97
  $rankersArray = array();
98
+ $collection = Mage::getModel('dropship360/ranking')->getCollection()->addFieldToFilter('is_dropship','yes');
99
  if($collection->count() > 0){
100
  foreach($collection as $data){
101
  $rankersArray[] = $data->getLbVendorCode();
app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Upload/Bulkassign.php CHANGED
@@ -36,7 +36,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Upload_Bulkassign extends Mage_Adm
36
  return $this;
37
  }
38
  $this->setShowFinished(true);
39
- $batchModel = Mage::getModel('logicbroker/uploadvendor')->prepareBulkassignmentCollection($this->getBulkVendorCode());
40
  if (count($batchModel) > 0) {
41
 
42
  $numberOfRecords = 100;
@@ -174,7 +174,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Upload_Bulkassign extends Mage_Adm
174
  protected function isManualUploadRunning(){
175
 
176
  $result = false;
177
- if(Mage::helper('logicbroker')->isProcessRunning('manual_upload')){
178
  $result = true;
179
  }
180
  return $result;
36
  return $this;
37
  }
38
  $this->setShowFinished(true);
39
+ $batchModel = Mage::getModel('dropship360/uploadvendor')->prepareBulkassignmentCollection($this->getBulkVendorCode());
40
  if (count($batchModel) > 0) {
41
 
42
  $numberOfRecords = 100;
174
  protected function isManualUploadRunning(){
175
 
176
  $result = false;
177
+ if(Mage::helper('dropship360')->isProcessRunning('manual_upload')){
178
  $result = true;
179
  }
180
  return $result;
app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Upload/Edit/Form.php CHANGED
@@ -24,7 +24,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Upload_Edit_Form extends Mage_Admi
24
  ));
25
  $legend = ($isProductSetupMode) ? $this->getLegendtext() : 'Import Settings';
26
  $fieldset = $form->addFieldset('base_fieldset', array('legend' => Mage::helper('importexport')->__($legend)));
27
- $isProcessContinue = Mage::helper('logicbroker')->isProcessRunning('bulk_assign');
28
  $fieldset->addField('productsetupmode', 'hidden', array(
29
  'name' => 'productsetupmode',
30
  'value' => $isProductSetupMode
@@ -35,7 +35,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Upload_Edit_Form extends Mage_Admi
35
  'title' => Mage::helper('importexport')->__('Supplier'),
36
  'label' => Mage::helper('importexport')->__('Supplier'),
37
  'required' => true,
38
- 'values' => Mage::getModel('logicbroker/system_config_source_vendorlist')->getAllVendor()
39
  ));
40
  if($isProductSetupMode){
41
  $fieldset->addType('custombutton', 'Logicbroker_Dropship360_Block_Adminhtml_Upload_Edit_Button');
24
  ));
25
  $legend = ($isProductSetupMode) ? $this->getLegendtext() : 'Import Settings';
26
  $fieldset = $form->addFieldset('base_fieldset', array('legend' => Mage::helper('importexport')->__($legend)));
27
+ $isProcessContinue = Mage::helper('dropship360')->isProcessRunning('bulk_assign');
28
  $fieldset->addField('productsetupmode', 'hidden', array(
29
  'name' => 'productsetupmode',
30
  'value' => $isProductSetupMode
35
  'title' => Mage::helper('importexport')->__('Supplier'),
36
  'label' => Mage::helper('importexport')->__('Supplier'),
37
  'required' => true,
38
+ 'values' => Mage::getModel('dropship360/system_config_source_vendorlist')->getAllVendor()
39
  ));
40
  if($isProductSetupMode){
41
  $fieldset->addType('custombutton', 'Logicbroker_Dropship360_Block_Adminhtml_Upload_Edit_Button');
app/code/community/Logicbroker/Dropship360/Block/Adminhtml/Vendorproductuploadhistory.php CHANGED
@@ -8,34 +8,135 @@
8
  */
9
  class Logicbroker_Dropship360_Block_Adminhtml_Vendorproductuploadhistory extends Mage_Adminhtml_Block_Widget_Grid_Container
10
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  public function __construct()
12
  {
13
  $backButtonUrl = Mage::helper('core/http')->getHttpReferer() ? Mage::helper('core/http')->getHttpReferer() : Mage::getUrl('*/*/');
14
  $this->_controller = 'adminhtml_ranking';
15
- $this->_blockGroup = 'logicbroker';
16
- $this->_headerText = Mage::helper('logicbroker')->__('Supplier Product Upload Log');
17
- $this->__addBackButton = Mage::helper('logicbroker')->__('Back');
18
  $this->addButton('back',array(
19
  'label' => 'Back',
20
  'onclick' => 'setLocation(\'' . $backButtonUrl .'\')',
21
  'class' => 'back',
22
  )
23
  );
 
24
  parent::__construct();
25
  $this->removeButton('add');
26
 
27
  }
28
 
 
 
 
 
 
 
 
29
  public function getLogCollection(){
30
 
31
- $conn = Mage::getModel('logicbroker/uploadvendor')->getDatabaseConnection();
32
- $tableVendorImportLog = Mage::getSingleton ( 'core/resource' )->getTableName ( 'logicbroker/vendor_import_log' );
33
  $select = $conn->select()->from($tableVendorImportLog)->order('created_at DESC');
34
  $stmt = $conn->query($select);
35
  $rows = $stmt->fetchAll();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
 
 
 
 
 
 
 
 
37
 
38
- return $rows;
39
  }
40
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  }
8
  */
9
  class Logicbroker_Dropship360_Block_Adminhtml_Vendorproductuploadhistory extends Mage_Adminhtml_Block_Widget_Grid_Container
10
  {
11
+
12
+ protected $_message = array(
13
+ 'row_magento_sku'=>'Missing Data at Row(s) for Magento Sku row_num',
14
+ 'row_vendor_sku'=>'Missing Data at Row(s) for Vendor Sku row_num',
15
+ 'row_qty'=>'Bad Data for Qty at Row(s) row_num',
16
+ 'row_cost'=>'Bad Data for Cost at Row(s) row_num',
17
+ 'empty_file'=>'Sorry,we cant find the record to update inventory',
18
+ 'inventory_update_error'=>'Error in updating magento product inventory, magento_sku',
19
+ 'magento_sku_exists'=>'magento product sku not exist magento_sku',
20
+ 'inventory_add_error'=>'Error in adding magento product inventory, magento_sku',
21
+ 'combination_notexist'=>'Vendor Sku vendor_sku & Supplier code vendor_code combination does not exist',
22
+ 'already_assigned'=>'Vendor sku vendor_sku is already been assigned for this vendor',
23
+ 'duplicate_vendor_sku'=>'Vendor sku vendor_sku is duplicate in Magento Sku magento_sku for this supplier',
24
+ 'combination_exist'=> 'Vendor sku vendor_sku or Supplier code vendor_code combination already present for Magento Sku magento_sku',
25
+ 'data_notchnage'=> 'Cost & Qty for Vendor Sku vendor_sku & Supplier code vendor_code not changed',
26
+ 'lb_upc_notexist'=> 'UPC attribute missing vendor_sku',
27
+ 'lb_upc_multiple'=> 'Multiple Match found for UPC vendor_sku',
28
+ 'lb_mnp_notexist'=> 'MNP attribute missing vendor_sku',
29
+ 'lb_mnp_multiple'=> 'Multiple Match found for MNP vendor_sku',
30
+ 'sku_multiple'=> 'Multiple Match found for SKU vendor_sku',
31
+ 'attribute_notexist'=> 'Attribute assigned for Supplier code vendor_code does not exist for Vendor sku vendor_sku'
32
+ );
33
+ protected $_replace = array('magento_sku','vendor_sku','vendor_code');
34
  public function __construct()
35
  {
36
  $backButtonUrl = Mage::helper('core/http')->getHttpReferer() ? Mage::helper('core/http')->getHttpReferer() : Mage::getUrl('*/*/');
37
  $this->_controller = 'adminhtml_ranking';
38
+ $this->_blockGroup = 'dropship360';
39
+ $this->_headerText = Mage::helper('dropship360')->__('Supplier Product Upload Log');
40
+ $this->__addBackButton = Mage::helper('dropship360')->__('Back');
41
  $this->addButton('back',array(
42
  'label' => 'Back',
43
  'onclick' => 'setLocation(\'' . $backButtonUrl .'\')',
44
  'class' => 'back',
45
  )
46
  );
47
+
48
  parent::__construct();
49
  $this->removeButton('add');
50
 
51
  }
52
 
53
+ public function getMessageArray(){
54
+ return $this->_message;
55
+ }
56
+
57
+ public function getReplaceValue(){
58
+ return $this->_replace;
59
+ }
60
  public function getLogCollection(){
61
 
62
+ $conn = Mage::getModel('dropship360/uploadvendor')->getDatabaseConnection();
63
+ $tableVendorImportLog = Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship360/vendor_import_log' );
64
  $select = $conn->select()->from($tableVendorImportLog)->order('created_at DESC');
65
  $stmt = $conn->query($select);
66
  $rows = $stmt->fetchAll();
67
+ return $rows;
68
+ }
69
+
70
+ public function getLogDescriptionCollection($error_id){
71
+ $conn = Mage::getModel('dropship360/uploadvendor')->getDatabaseConnection();
72
+ $tableVendorImportLog = Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship360/vendor_import_log_desc' );
73
+ $select = $conn->select()->from($tableVendorImportLog)->where('error_id ='.$error_id);
74
+ $stmt = $conn->query($select);
75
+ $rows = $stmt->fetchAll();
76
+ return $rows;
77
+ }
78
+
79
+ public function parseDescription($data,$vendorCode){
80
+
81
+ $decodedata = $this->prepareRowData($data);
82
+ if(!is_array($decodedata) || empty($decodedata))
83
+ return empty($decodedata) ? implode('',$decodedata) : $decodedata;
84
+ $htmlStart = '<ul>';
85
+ $htmlEnd = '</ul>';
86
+ foreach($decodedata as $data){
87
+ $msg = $this->_message[$data['error_type']];
88
+
89
+ if(is_array($data['value']) && !empty($data['value'])){
90
+
91
+ $htmlStart .= $this->genrateHtml($data['value'],$msg,$vendorCode);
92
+ }else{
93
+ $htmlStart .= '<li>'.str_replace('row_num',$data['value'],$msg).'</li>';
94
+ }
95
+ }
96
+ return $htmlStart.$htmlEnd;
97
+ }
98
+
99
+ public function genrateHtml($value,$msg,$vendorCode){
100
 
101
+ $string = $msg;
102
+ $value['vendor_code'] = $vendorCode;
103
+ foreach($this->_replace as $val){
104
+
105
+ if(strstr($string,$val))
106
+ $string = str_replace($val,$value[$val],$string);
107
+ }
108
 
109
+ return '<li>'.$string.'</li>';
110
  }
111
 
112
+ public function prepareRowData($data)
113
+ {
114
+ $decodedata = array();
115
+ $dataTemp = array();
116
+ if(is_numeric($data))
117
+ {
118
+ $rowData = $this->getLogDescriptionCollection($data);
119
+ if(count($rowData) > 0)
120
+ {
121
+ foreach($rowData as $eachRow)
122
+ {
123
+ $decodedata[] = array_merge($dataTemp, $this->getDecodedJson($eachRow['description']));
124
+ }
125
+ }
126
+ }else
127
+ {
128
+ $decodedata = $this->getDecodedJson($data);
129
+ }
130
+ return $decodedata;
131
+ }
132
+ protected function getDecodedJson($data)
133
+ {
134
+ if(empty($data) || !Mage::helper('dropship360')->isJson($data)){
135
+ return $data;
136
+ }
137
+ $data = trim($data,'"');
138
+ $data = trim($data,'\'');
139
+ $decodedata = Mage::helper('core')->jsonDecode($data);
140
+ return $decodedata;
141
+ }
142
  }
app/code/community/Logicbroker/Dropship360/Helper/Data.php CHANGED
@@ -17,6 +17,13 @@ class Logicbroker_Dropship360_Helper_Data extends Mage_Core_Helper_Abstract
17
  const LOGICBROKER_ITEM_STATUS_CANCELLED = 'Cancelled';
18
  const LOGICBROKER_ITEM_STATUS_NO_DROPSHIP = 'No Dropship';
19
  const LOGICBROKER_ITEM_STATUS_COMPLETED = 'Completed';
 
 
 
 
 
 
 
20
  protected $_maxtime = 60; // time in minutes
21
  public function getConfigObject($nodeName = null)
22
  {
@@ -64,11 +71,11 @@ class Logicbroker_Dropship360_Helper_Data extends Mage_Core_Helper_Abstract
64
  }
65
  /* End of LBN - 935 change */
66
 
67
- protected function getDatabaseConnection() {
68
  return Mage::getSingleton ( 'core/resource' );
69
  }
70
 
71
- protected function getTableName($name)
72
  {
73
  return $this->getDatabaseConnection()->getTableName ( $name );
74
  }
@@ -108,7 +115,7 @@ class Logicbroker_Dropship360_Helper_Data extends Mage_Core_Helper_Abstract
108
  $write = $this->getDatabaseConnection()->getConnection ( 'core_write' );
109
  $updatedAt = Mage::getModel('core/date')->gmtDate();
110
  $createAt = Mage::getModel('core/date')->gmtDate();
111
- $tmpTableName = $this->getTableName ( 'logicbroker/tmpdata' );
112
  $insert = 'insert into '.$tmpTableName.' (tmpdata,created_at,updated_at) values("'.$type.'","'.$createAt.'","'.$updatedAt.'")';
113
  $write->beginTransaction ();
114
  $write->query($insert);
@@ -125,7 +132,7 @@ class Logicbroker_Dropship360_Helper_Data extends Mage_Core_Helper_Abstract
125
 
126
  $write = $this->getDatabaseConnection()->getConnection ( 'core_write' );
127
  $updatedAt = Mage::getModel('core/date')->gmtDate();
128
- $tmpTableName = $this->getTableName ( 'logicbroker/tmpdata' );
129
  $update = 'update '.$tmpTableName.' set updated_at = '.$updatedAt.' where tmpdata = "'.$type.'"' ;
130
  $write->beginTransaction ();
131
  $write->query($update);
@@ -140,7 +147,7 @@ class Logicbroker_Dropship360_Helper_Data extends Mage_Core_Helper_Abstract
140
  protected function deleteTmpTableData($type){
141
 
142
  $write = $this->getDatabaseConnection()->getConnection ( 'core_write' );
143
- $tmpTableName = $this->getTableName ( 'logicbroker/tmpdata' );
144
  $delete = 'delete from '.$tmpTableName.' where tmpdata = "'.$type.'"' ;
145
  $write->beginTransaction ();
146
  $write->query($delete);
@@ -155,7 +162,7 @@ class Logicbroker_Dropship360_Helper_Data extends Mage_Core_Helper_Abstract
155
  public function selectTmpTableData($type){
156
 
157
  $read = $this->getDatabaseConnection()->getConnection ( 'core_read' );
158
- $tmpTableName = $this->getTableName ( 'logicbroker/tmpdata' );
159
  $select = 'Select * from '.$tmpTableName.' where tmpdata = "'.$type.'" ORDER BY id DESC limit 1';
160
  $result = $read->fetchAll($select);
161
 
@@ -212,8 +219,8 @@ class Logicbroker_Dropship360_Helper_Data extends Mage_Core_Helper_Abstract
212
  }
213
 
214
  protected function getLogCollection($params){
215
- $conn = Mage::getModel('logicbroker/uploadvendor')->getDatabaseConnection();
216
- $tableVendorImportLog = Mage::getSingleton ( 'core/resource' )->getTableName ( 'logicbroker/vendor_import_log' );
217
  $select = $conn->select()->from($tableVendorImportLog)
218
  ->where("created_at=?", $params['vdate']);
219
  $result = $conn->query($select);
@@ -228,7 +235,7 @@ class Logicbroker_Dropship360_Helper_Data extends Mage_Core_Helper_Abstract
228
  */
229
  protected function _getCsvHeaders()
230
  {
231
- $headers = array(0 => 'Date', 1 => 'Message') ;
232
  return $headers;
233
  }
234
 
@@ -236,13 +243,16 @@ class Logicbroker_Dropship360_Helper_Data extends Mage_Core_Helper_Abstract
236
  * Generates CSV file with error's list according to the collection in the $this->_list
237
  * @return array
238
  */
239
- public function generateErrorList($params)
240
  {
241
- $this->_list = $this->getLogCollection($params);
242
- $ftpError = explode('<li>', $this->_list['ftp_error_desc']);
243
- if (!is_null($this->_list)) {
244
- $items = $this->_list;
245
- if (count($items) > 0) {
 
 
 
246
  $io = new Varien_Io_File();
247
  $path = Mage::getBaseDir('var') . DS . 'export' . DS;
248
  $name = md5(microtime());
@@ -252,24 +262,66 @@ class Logicbroker_Dropship360_Helper_Data extends Mage_Core_Helper_Abstract
252
  $io->streamOpen($file, 'w+');
253
  $io->streamLock(true);
254
  $io->streamWriteCsv($this->_getCsvHeaders());
255
-
256
- $error = array();
257
- foreach( $ftpError as $ferror){
258
- if(strip_tags($ferror) != "") {
259
- $date = Mage::helper('core')->formatDate($this->_list['created_at'], 'medium', true);
260
- $error[] = array(0=>$date, 1=>strip_tags($ferror));
 
 
 
 
 
 
 
261
  }
 
 
 
 
 
 
 
 
 
 
 
262
  }
263
- foreach ($error as $e) {
264
- $io->streamWriteCsv($e);
265
  }
266
  return array(
267
  'type' => 'filename',
268
  'value' => $file,
269
- 'rm' => true
 
270
  );
271
  }
272
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
273
  }
274
 
275
  /**
@@ -301,4 +353,71 @@ class Logicbroker_Dropship360_Helper_Data extends Mage_Core_Helper_Abstract
301
  }
302
  return $serializeData;
303
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
304
  }
17
  const LOGICBROKER_ITEM_STATUS_CANCELLED = 'Cancelled';
18
  const LOGICBROKER_ITEM_STATUS_NO_DROPSHIP = 'No Dropship';
19
  const LOGICBROKER_ITEM_STATUS_COMPLETED = 'Completed';
20
+ const LOGICBROKER_PRODUCT_LINK_UPC = 'UPC';
21
+ const LOGICBROKER_PRODUCT_LINK_MNP = 'Manufacturer Part Number';
22
+ const LOGICBROKER_PRODUCT_LINK_SKU = 'Magento Sku';
23
+ const LOGICBROKER_PRODUCT_LINK_NONE = 'None';
24
+ const LOGICBROKER_PRODUCT_LINK_CODE_UPC = 'lb_upc';
25
+ const LOGICBROKER_PRODUCT_LINK_CODE_MNP = 'lb_mnp';
26
+ const LOGICBROKER_PRODUCT_LINK_CODE_SKU = 'sku';
27
  protected $_maxtime = 60; // time in minutes
28
  public function getConfigObject($nodeName = null)
29
  {
71
  }
72
  /* End of LBN - 935 change */
73
 
74
+ public function getDatabaseConnection() {
75
  return Mage::getSingleton ( 'core/resource' );
76
  }
77
 
78
+ public function getTableName($name)
79
  {
80
  return $this->getDatabaseConnection()->getTableName ( $name );
81
  }
115
  $write = $this->getDatabaseConnection()->getConnection ( 'core_write' );
116
  $updatedAt = Mage::getModel('core/date')->gmtDate();
117
  $createAt = Mage::getModel('core/date')->gmtDate();
118
+ $tmpTableName = $this->getTableName ( 'dropship360/tmpdata' );
119
  $insert = 'insert into '.$tmpTableName.' (tmpdata,created_at,updated_at) values("'.$type.'","'.$createAt.'","'.$updatedAt.'")';
120
  $write->beginTransaction ();
121
  $write->query($insert);
132
 
133
  $write = $this->getDatabaseConnection()->getConnection ( 'core_write' );
134
  $updatedAt = Mage::getModel('core/date')->gmtDate();
135
+ $tmpTableName = $this->getTableName ( 'dropship360/tmpdata' );
136
  $update = 'update '.$tmpTableName.' set updated_at = '.$updatedAt.' where tmpdata = "'.$type.'"' ;
137
  $write->beginTransaction ();
138
  $write->query($update);
147
  protected function deleteTmpTableData($type){
148
 
149
  $write = $this->getDatabaseConnection()->getConnection ( 'core_write' );
150
+ $tmpTableName = $this->getTableName ( 'dropship360/tmpdata' );
151
  $delete = 'delete from '.$tmpTableName.' where tmpdata = "'.$type.'"' ;
152
  $write->beginTransaction ();
153
  $write->query($delete);
162
  public function selectTmpTableData($type){
163
 
164
  $read = $this->getDatabaseConnection()->getConnection ( 'core_read' );
165
+ $tmpTableName = $this->getTableName ( 'dropship360/tmpdata' );
166
  $select = 'Select * from '.$tmpTableName.' where tmpdata = "'.$type.'" ORDER BY id DESC limit 1';
167
  $result = $read->fetchAll($select);
168
 
219
  }
220
 
221
  protected function getLogCollection($params){
222
+ $conn = Mage::getModel('dropship360/uploadvendor')->getDatabaseConnection();
223
+ $tableVendorImportLog = Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship360/vendor_import_log' );
224
  $select = $conn->select()->from($tableVendorImportLog)
225
  ->where("created_at=?", $params['vdate']);
226
  $result = $conn->query($select);
235
  */
236
  protected function _getCsvHeaders()
237
  {
238
+ $headers = array('Supplier Code','Supplier','Magento Sku','vendor_sku','cost','inventory','Failure Reason') ;
239
  return $headers;
240
  }
241
 
243
  * Generates CSV file with error's list according to the collection in the $this->_list
244
  * @return array
245
  */
246
+ public function generateErrorList($params,$isFtp = false)
247
  {
248
+ $ftpCollection = (!$isFtp) ? $this->getLogCollection($params) : $params;
249
+ //$ftpError = explode('<li>', $this->_list['ftp_error_desc']);
250
+ if (!empty($ftpCollection)) {
251
+ if (count($ftpCollection) > 0) {
252
+ if($ftpCollection['failure'] > 3000){
253
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship360')->__('Data size is too big for export'));
254
+ return array('error' => true);
255
+ }
256
  $io = new Varien_Io_File();
257
  $path = Mage::getBaseDir('var') . DS . 'export' . DS;
258
  $name = md5(microtime());
262
  $io->streamOpen($file, 'w+');
263
  $io->streamLock(true);
264
  $io->streamWriteCsv($this->_getCsvHeaders());
265
+ $rowData = (!is_null($ftpCollection['ftp_error_desc'])) ? $ftpCollection['ftp_error_desc'] : $ftpCollection['error_id'];
266
+ $prepareValue = $this->prepareExportVaues($rowData, $ftpCollection['lb_vendor_code']);
267
+ if(is_array($prepareValue)){
268
+ foreach($prepareValue as $value){
269
+ $csv[] = $ftpCollection['lb_vendor_code'];
270
+ $csv[] = $this->getSupplierName($ftpCollection['lb_vendor_code']);
271
+ $csv[] = $value['magento_sku'];
272
+ $csv[] = $value['vendor_sku'];
273
+ $csv[] = $value['cost'];
274
+ $csv[] = $value['qty'];
275
+ $csv[] = $value['reason'];
276
+ $io->streamWriteCsv($csv);
277
+ unset($csv);
278
  }
279
+ }else
280
+ {
281
+ $csv[] = $ftpCollection['lb_vendor_code'];
282
+ $csv[] = $this->getSupplierName($ftpCollection['lb_vendor_code']);
283
+ $csv[] = '';
284
+ $csv[] = '';
285
+ $csv[] ='';
286
+ $csv[] = '';
287
+ $csv[] = $ftpCollection['ftp_error_desc'];
288
+ $io->streamWriteCsv($csv);
289
+ unset($csv);
290
  }
 
 
291
  }
292
  return array(
293
  'type' => 'filename',
294
  'value' => $file,
295
+ 'rm' => true,
296
+ 'error'=> false
297
  );
298
  }
299
  }
300
+ public function prepareExportVaues($description,$vendorCode){
301
+ $csvData = array();
302
+ $decodedata = Mage::app()->getLayout()->createBlock('dropship360/adminhtml_vendorproductuploadhistory')->prepareRowData($description);
303
+ if(!is_array($decodedata) || empty($decodedata))
304
+ return empty($decodedata) ? implode('',$decodedata) : $decodedata;
305
+ foreach($decodedata as $data){
306
+ $msgArray = Mage::app()->getLayout()->createBlock('dropship360/adminhtml_vendorproductuploadhistory')->getMessageArray();
307
+ $msg = $msgArray[$data['error_type']];
308
+ if(is_array($data['value']) && !empty($data['value'])){
309
+ $csvData[] = array('magento_sku'=>$data['value']['magento_sku'],'vendor_sku'=>$data['value']['vendor_sku'],'cost'=>$data['value']['cost'],'qty'=>$data['value']['qty'],'reason'=> $this->genrateHtml($data['value'],$msg,$vendorCode));
310
+ }else{
311
+ $csvData[] = array('magento_sku'=>'','vendor_sku'=>'','cost'=>'','qty'=>'','reason'=> (strstr($msg,'row_num')) ? str_replace('row_num',$data['value'],$msg) : str_replace('empty_file',$data['value'],$msg) );
312
+ }
313
+ }
314
+ return $csvData;
315
+ }
316
+ public function genrateHtml($value,$msg,$vendorCode){
317
+ $replace = Mage::app()->getLayout()->createBlock('dropship360/adminhtml_vendorproductuploadhistory')->getReplaceValue();
318
+ $string = $msg;
319
+ $value['vendor_code'] = $vendorCode;
320
+ foreach($replace as $val){
321
+ if(strstr($string,$val))
322
+ $string = str_replace($val,$value[$val],$string);
323
+ }
324
+ return $string;
325
  }
326
 
327
  /**
353
  }
354
  return $serializeData;
355
  }
356
+
357
+ public function sendMail($templateObject,$email,$templateId,$attachment = null){
358
+
359
+ $result = false;
360
+
361
+ if(empty($templateId) || empty($email))
362
+ return $result;
363
+ $mailTemplate = Mage::getModel('core/email_template');
364
+ if($attachment)
365
+ {
366
+ $content = file_get_contents($attachment);
367
+ //$content = str_replace('></',">\n</",$content);
368
+ // this is for to set the file format
369
+ $at = new Zend_Mime_Part($content);
370
+ $at->type = 'application/csv'; // if u have PDF then it would like -> 'application/pdf'
371
+ $at->disposition = Zend_Mime::DISPOSITION_INLINE;
372
+ $at->encoding = Zend_Mime::ENCODING_8BIT;
373
+ $at->filename = 'outdated_productlist'.date('ymdHis').'.csv';
374
+ $mailTemplate->getMail()->addAttachment($at);
375
+ //$emailTemplate->_mail->addAttachment($at);
376
+ }
377
+ /* @var $mailTemplate Mage_Core_Model_Email_Template */
378
+ $mailTemplate->setDesignConfig(array('area' => 'backend'));
379
+ if($templateObject->getBcc())
380
+ {
381
+ $mailTemplate->addBcc($templateObject->getBcc());
382
+ }
383
+ //$mailTemplate->setTemplateSubject($subject);
384
+ $name = explode('@',$email);
385
+ $mailTemplate->sendTransactional(
386
+ $templateId,
387
+ 'general',
388
+ $email,
389
+ $name[0],
390
+ array('templatevar' => $templateObject)
391
+ );
392
+ (!$mailTemplate->getSentSuccess()) ? $result = false : $result = true;
393
+ return $result;
394
+ }
395
+
396
+ /**
397
+ * Turn on read uncommitted mode
398
+ */
399
+ public function turnOnReadUncommittedMode()
400
+ {
401
+ $this->getDatabaseConnection()->getConnection('read')->query("SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED");
402
+ }
403
+ /**
404
+ * Turn on read committed mode
405
+ */
406
+ public function turnOnReadCommittedMode()
407
+ {
408
+ $this->getDatabaseConnection()->getConnection('read')->query("SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED");
409
+ }
410
+ public function isJson($data){
411
+ $result = false;
412
+ $data = trim($data,'"');
413
+ $data = trim($data,'\'');
414
+ $data = stripslashes($data);
415
+ $decodedata = json_decode($data);
416
+ $result = (json_last_error() == JSON_ERROR_NONE) ? true : false;
417
+ return $result;
418
+ }
419
+ public function getSupplierName($vendorCode){
420
+ $vendorRankModel = Mage::getSingleton('dropship360/ranking')->load($vendorCode,'lb_vendor_code');
421
+ return $vendorRankModel->getLbVendorName();
422
+ }
423
  }
app/code/community/Logicbroker/Dropship360/Model/Api2/Createroleandrule.php CHANGED
@@ -4,6 +4,7 @@
4
  *
5
  * @category Community
6
  * @package Logicbroker_Dropship360
 
7
  */
8
  class Logicbroker_Dropship360_Model_Api2_Createroleandrule
9
  {
@@ -172,12 +173,12 @@ class Logicbroker_Dropship360_Model_Api2_Createroleandrule
172
 
173
  protected function createAdminUserAndRole(){
174
 
175
- $resource = '__root__,admin/logicbroker,admin/logicbroker/integration,admin/logicbroker/order_sourcing,admin/logicbroker/vendor_ranking,admin/logicbroker/inventory,admin/logicbroker/suppliers';
176
  $roleName = 'logicbrokerds360';
177
 
178
  $role = Mage::getModel('admin/roles');
179
  $username = 'logicbrokerds360';
180
- $email = Mage::helper('logicbroker')->getConfigObject('apiconfig/email/toaddress');
181
  $user = Mage::getModel('admin/user');
182
  $user->loadByUsername($username);
183
  if(!$user->getId()){
4
  *
5
  * @category Community
6
  * @package Logicbroker_Dropship360
7
+ * No use of this class currently as Rest may be a part of future release refer lbn-1351
8
  */
9
  class Logicbroker_Dropship360_Model_Api2_Createroleandrule
10
  {
173
 
174
  protected function createAdminUserAndRole(){
175
 
176
+ $resource = '__root__,admin/logicbroker,admin/dropship360/integration,admin/dropship360/order_sourcing,admin/dropship360/vendor_ranking,admin/dropship360/inventory,admin/dropship360/suppliers';
177
  $roleName = 'logicbrokerds360';
178
 
179
  $role = Mage::getModel('admin/roles');
180
  $username = 'logicbrokerds360';
181
+ $email = Mage::helper('dropship360')->getConfigObject('apiconfig/email/toaddress');
182
  $user = Mage::getModel('admin/user');
183
  $user->loadByUsername($username);
184
  if(!$user->getId()){
app/code/community/Logicbroker/Dropship360/Model/Api2/Inventory/Rest/Admin/V1.php CHANGED
@@ -10,7 +10,7 @@ class Logicbroker_Dropship360_Model_Api2_Inventory_Rest_Admin_V1 extends Logicbr
10
  {
11
  protected function _create(array $data)
12
  {
13
- if(Mage::helper('logicbroker')->isProcessRunning('bulk_assign')){
14
  $message = 'Bulk product setup is currently running hence cannot run REST import';
15
  echo $message;
16
  //Mage::log($message, null, 'logicbroker_log_report.log');
@@ -21,7 +21,7 @@ class Logicbroker_Dropship360_Model_Api2_Inventory_Rest_Admin_V1 extends Logicbr
21
  foreach($requestData as $chunkData)
22
  {
23
  $processedData['vendordata'] = $chunkData;
24
- $result[] = Mage::getModel('logicbroker/inventory')->prepareInventoryTable($processedData);
25
  }
26
 
27
  foreach($result as $row){
10
  {
11
  protected function _create(array $data)
12
  {
13
+ if(Mage::helper('dropship360')->isProcessRunning('bulk_assign')){
14
  $message = 'Bulk product setup is currently running hence cannot run REST import';
15
  echo $message;
16
  //Mage::log($message, null, 'logicbroker_log_report.log');
21
  foreach($requestData as $chunkData)
22
  {
23
  $processedData['vendordata'] = $chunkData;
24
+ $result[] = Mage::getModel('dropship360/inventory')->prepareInventoryTable($processedData);
25
  }
26
 
27
  foreach($result as $row){
app/code/community/Logicbroker/Dropship360/Model/Api2/Product/Rest/Admin/V1.php CHANGED
@@ -17,7 +17,7 @@ class Logicbroker_Dropship360_Model_Api2_Product_Rest_Admin_V1 extends Logicbrok
17
  foreach($requestData as $chunkData)
18
  {
19
  $processedData['productdata'] = $chunkData;
20
- $result[] = Mage::getModel('logicbroker/productimport')->_init()->processData($processedData);
21
  }
22
  $time_end = now();
23
  echo 'Start Time = '.$time_start;
17
  foreach($requestData as $chunkData)
18
  {
19
  $processedData['productdata'] = $chunkData;
20
+ $result[] = Mage::getModel('dropship360/productimport')->_init()->processData($processedData);
21
  }
22
  $time_end = now();
23
  echo 'Start Time = '.$time_start;
app/code/community/Logicbroker/Dropship360/Model/Csvparser.php ADDED
@@ -0,0 +1,266 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Logicbroker
5
+ * @category Community
6
+ * @package Logicbroker_Dropship360
7
+ */
8
+
9
+ class Logicbroker_Dropship360_Model_Csvparser
10
+ {
11
+
12
+ protected $dbConnection;
13
+ protected $tableName;
14
+ protected $vendorObject;
15
+ protected $chunksize = 50;
16
+ //protected $chnagedValue = array();
17
+ protected $ftpCSVFormat = array('vendor_code','vendor_sku','qty','cost');
18
+ protected $manualCSVFormat = array('vendor_sku','qty','cost');
19
+ protected $productSetupCSVFormat = array('magento_sku','vendor_sku');
20
+ protected $_exportHeaders = array('Supplier Code','Supplier','Magento Sku','Vendor Sku','Cost','Inventory','Last Sync Date');
21
+ protected $_indexVendorSku = 0;
22
+ protected $_indexStock = 1;
23
+ protected $_indexPrice = 2;
24
+
25
+ public function __construct(){
26
+
27
+ $this->dbConnection = Mage::helper('dropship360')->getDatabaseConnection();
28
+ $this->tableName = Mage::helper('dropship360')->getTableName('dropship360/csvtmpdata');
29
+ $this->vendorObject = Mage::getModel('dropship360/inventory');
30
+ }
31
+
32
+ // check is csv for manual or ftp other csv will not process data
33
+ protected function isProcessRequired($header)
34
+ {
35
+ $result = true;
36
+ if($header[0] == 'vendor_code')
37
+ {
38
+ $diffArray=array_diff($this->ftpCSVFormat,$header);
39
+ $result = (count($diffArray) == 0);
40
+ }else
41
+ {
42
+ $diffArray=array_diff($this->manualCSVFormat,$header);
43
+ $result = (count($diffArray) == 0);
44
+ }
45
+ //var_dump($result);
46
+ //die;
47
+ return $result;
48
+ }
49
+
50
+ protected function checkFtpHeader($header)
51
+ {
52
+ if(count($header) == 4 )
53
+ {
54
+ $this->_indexVendorSku = 1;
55
+ $this->_indexStock = 2;
56
+ $this->_indexPrice = 3;
57
+ }
58
+ }
59
+
60
+ public function getChangedValue($csvData,$vendorCode){
61
+
62
+ $parsedData = array();
63
+ if(count($csvData) <= 1 || !$this->isProcessRequired($csvData[0]))
64
+ {
65
+ return $csvData;
66
+ }
67
+ $this->emptyTable();
68
+ $this->checkFtpHeader($csvData[0]);
69
+ $insertQuery = $this->insertMultiple($csvData,$vendorCode);
70
+ if($insertQuery/*$this->executeStm($insertQuery)*/){
71
+ $parsedData = $this->prepareCsvjoin($csvData[0]);
72
+ //array_unshift($parsedData,$csvData[0]);
73
+ }
74
+ else{
75
+ $parsedData = $csvData;
76
+ }
77
+ return $parsedData;
78
+ }
79
+
80
+ protected function insertMultiple($csvData,$vendorCode){
81
+ $connection = $this->dbConnection->getConnection ( 'core_write' );
82
+ $csvArray = array();
83
+ $chunkCsvData = array_chunk($csvData,$this->chunksize);
84
+ foreach($chunkCsvData as $value)
85
+ {
86
+ foreach ($value as $key=>$data)
87
+ {
88
+ if($key == 0)
89
+ continue;
90
+ $csvArray[] = array('vendor_code'=>$vendorCode,'csv_vendor_sku'=>trim($data [$this->_indexVendorSku]),'csv_stock'=>$data [$this->_indexStock],'csv_price'=>$data [$this->_indexPrice]);
91
+ }
92
+ try {
93
+ $connection->insertOnDuplicate($this->tableName,$csvArray,array('csv_vendor_sku','csv_stock','csv_price'));
94
+ } catch (Exception $e) {
95
+ Mage::log($e->getTrace(),null,'logicbroker_debug.log');
96
+ return false;
97
+ }
98
+ $csvArray = array();
99
+ }
100
+ return true;
101
+ }
102
+
103
+ protected function executeStm($query){
104
+
105
+ $write = $this->dbConnection->getConnection ( 'core_write' );
106
+ $write->beginTransaction ();
107
+ $write->query($query);
108
+ try {
109
+ $write->commit ();
110
+ return true;
111
+ } catch ( Exception $e ) {
112
+ $write->rollBack ();
113
+ Mage::log($e->getMessage(), null, 'vendor_inventory_import_error.log');
114
+ return false;
115
+ }
116
+
117
+ }
118
+
119
+ protected function prepareCsvjoin($header){
120
+ $chnagedValue =array();
121
+ $chnagedValue[] = $header;
122
+ $collection = $this->vendorObject->getCollection()->addFieldToSelect(array('lb_vendor_code','lb_vendor_sku','stock','cost'));
123
+ $collection->getSelect()->join(array('inventory'=>$this->tableName),
124
+ 'inventory.vendor_code = main_table.lb_vendor_code and inventory.csv_vendor_sku = main_table.lb_vendor_sku')->where('inventory.csv_stock != main_table.stock or inventory.csv_price != main_table.cost');
125
+
126
+ if($collection->getSize() > 0 ){
127
+
128
+ foreach($collection as $data){
129
+ $query = 'UPDATE '.$this->tableName.' set is_processed = 1 where csv_vendor_sku = "'.$data->getCsvVendorSku().'" and vendor_code = "'.$data->getLbVendorCode().'"';
130
+ $chnagedValue[$data->getRowId()] = array($data->getCsvVendorSku(),$data->getCsvStock(),$data->getCsvPrice());
131
+ $this->executeStm($query);
132
+ }
133
+ }
134
+ return $chnagedValue;
135
+ }
136
+
137
+ public function emptyTable()
138
+ {
139
+ $write = $this->dbConnection->getConnection ( 'core_write' );
140
+ $query = 'TRUNCATE TABLE '.$this->tableName;
141
+ try {
142
+ $write->query($query);
143
+ } catch ( Exception $e ) {
144
+
145
+ Mage::log($e->getMessage(), null, 'vendor_inventory_import_error.log');
146
+ return false;
147
+ }
148
+
149
+ }
150
+ public function getCsvFile($itemObject)
151
+ {
152
+ $io = new Varien_Io_File();
153
+ $path = Mage::getBaseDir('var') . DS . 'export' . DS;
154
+ $name = md5(microtime());
155
+ $file = $path . DS . $name . '.csv';
156
+ $io->setAllowCreateFolders(true);
157
+ $io->open(array('path' => $path));
158
+ $io->streamOpen($file, 'w+');
159
+ $io->streamLock(true);
160
+ $io->streamWriteCsv($this->_exportHeaders);
161
+ $this->_exportCsvItem($itemObject,$io);
162
+ $io->streamUnlock();
163
+ $io->streamClose();
164
+ return array(
165
+ 'type' => 'filename',
166
+ 'value' => $file,
167
+ 'rm' => true // can delete file after use
168
+ );
169
+ }
170
+ protected function _exportCsvItem($itemObject, Varien_Io_File $adapter)
171
+ {
172
+ $row = array();
173
+ foreach ($itemObject as $item) {
174
+ $row[] = $item->getLbVendorCode();
175
+ $row[] = $item->getLbVendorName();
176
+ $row[] = $item->getProductSku();
177
+ $row[] = $item->getLbVendorSku();
178
+ $row[] = $item->getCost();
179
+ $row[] = $item->getStock();
180
+ $row[] = $this->formatDate($item->getUpdatedAt());
181
+ $adapter->streamWriteCsv($row);
182
+ unset($row);
183
+ }
184
+ }
185
+ public function formatDate($date){
186
+ $format = Mage::app()->getLocale()->getDateTimeFormat(
187
+ Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM
188
+ );
189
+ $date = Mage::app()->getLocale()
190
+ ->date($date, Varien_Date::DATETIME_INTERNAL_FORMAT)->toString($format);
191
+ return $date;
192
+ }
193
+ public function generateManualCsvRow($csvData,$isProductSetupMode,$lb_vendor_code)
194
+ {
195
+ $records = array();
196
+ foreach($csvData as $row => $csvRowData)
197
+ {
198
+ if($row == 0)
199
+ continue;
200
+ if(!$isProductSetupMode)
201
+ {
202
+ (count($csvRowData) <= 3) ? array_unshift($csvRowData, "") : $csvRowData;
203
+ if(is_numeric($csvRowData[2])){
204
+ /* LBN - 935 change */
205
+ $magento_sku = Mage::getModel('dropship360/uploadvendor')->getMagentoSku($lb_vendor_code, trim($csvRowData[1]));
206
+ $csvqty = (!empty($magento_sku)) ? Mage::helper('dropship360')->getIsQtyDecimal($magento_sku,$csvRowData[2]) : $csvRowData[2];;
207
+ }
208
+ else
209
+ {
210
+ $csvqty = $csvRowData[2];
211
+ }
212
+ }
213
+ if(!$isProductSetupMode)
214
+ $records[$row] = array('vendor_sku'=>trim($csvRowData[1]),'qty'=>$csvqty ,'cost'=>$csvRowData[3],'lb_vendor_code'=>$lb_vendor_code);
215
+ else
216
+ $records[$row] = array('magento_sku'=>trim($csvRowData[0]),'vendor_sku'=>trim($csvRowData[1]),'qty'=>0 ,'cost'=>0,'lb_vendor_code'=>$lb_vendor_code);
217
+ }
218
+ return $records;
219
+ }
220
+ public function generateFtpCsvRow($csvData,$vendorCode)
221
+ {
222
+ $records = array();
223
+ foreach($csvData as $row => $csvRowData)
224
+ {
225
+ if($row == 0)
226
+ continue;
227
+ //patch for backwards compatible for ftp change lbn-1070
228
+ (count($csvRowData) <= 3) ? array_unshift($csvRowData, "") : $csvRowData;
229
+ if(is_numeric($csvRowData[2]) || $csvRowData[2] > 0){
230
+ /* LBN - 935 change */
231
+ $magento_sku = Mage::getModel('dropship360/uploadvendor')->getMagentoSku($vendorCode, trim($csvRowData[1]));
232
+ (! empty ( $magento_sku )) ? $qty = Mage::helper ( 'dropship360' )->getIsQtyDecimal ( $magento_sku, $csvRowData [2] ) : $qty = $csvRowData [2];
233
+ /* End of LBN - 935 change */
234
+ }else{
235
+ $qty = $csvRowData[2];
236
+ }
237
+ $records[$row] = array('lb_vendor_code'=>$vendorCode,'vendor_sku'=>trim($csvRowData[1]),'qty'=>$qty ,'cost'=>$csvRowData[3]);
238
+ //$vendorCode = $csvRowData[0];
239
+ }
240
+ return $records;
241
+ }
242
+ public function isCsvFileEmpty()
243
+ {
244
+ return (count($this->getCsvRows()) > 0) ? false : true;
245
+ }
246
+ protected function getCsvRows()
247
+ {
248
+ $rows = array();
249
+ $conn = $this->dbConnection->getConnection ( 'core_read' );
250
+ $select = $conn->select()->from($this->tableName)->where('is_processed = 0');
251
+ $stmt = $conn->query($select);
252
+ $rows = $stmt->fetchAll();
253
+ return $rows;
254
+ }
255
+ public function getUnprocessedCsvRows($vendorCode,$isFtp){
256
+ $records = array();
257
+ $rows = $this->getCsvRows();
258
+ if(count($rows) > 0 ){
259
+ foreach($rows as $row){
260
+ $records[$row['row_id']] = array('lb_vendor_code'=>$vendorCode,'vendor_sku'=>trim($row['csv_vendor_sku']),'qty'=>$row['csv_stock'] ,'cost'=>$row['csv_price']);
261
+ }
262
+ }
263
+ return $records;
264
+ }
265
+ }
266
+
app/code/community/Logicbroker/Dropship360/Model/Inventory.php CHANGED
@@ -13,9 +13,11 @@ class Logicbroker_Dropship360_Model_Inventory extends Mage_Core_Model_Abstract
13
  protected $_productInventorySubtract = 0;
14
  protected $_productInventoryUpdate = 0;
15
  protected $_stockBeforeQtyDecimalCheck = '';
 
 
16
  protected function _construct()
17
  {
18
- $this->_init("logicbroker/inventory");
19
  }
20
 
21
  public function prepareInventoryTable($restReqest)
@@ -27,7 +29,7 @@ class Logicbroker_Dropship360_Model_Inventory extends Mage_Core_Model_Abstract
27
 
28
  protected function updateProductStock()
29
  {
30
- $dataCollection = Mage::getModel('logicbroker/inventory')->getCollection();
31
  $stockData = array();
32
  if($dataCollection->count() < 0){
33
  return;
@@ -64,7 +66,7 @@ class Logicbroker_Dropship360_Model_Inventory extends Mage_Core_Model_Abstract
64
  try {
65
  $stockItem->save();
66
  } catch (Exception $e) {
67
- Mage::helper('logicbroker')->genrateLog(0,'mgento inventory update started','mgento inventory update ended','Section :Error In Setting/update magento inventory: '.$e->getMessage().' sku : '.$sku);
68
  echo $e->getMessage();
69
  }
70
  }
@@ -75,8 +77,8 @@ class Logicbroker_Dropship360_Model_Inventory extends Mage_Core_Model_Abstract
75
  protected function prepareData($restReqest)
76
  {
77
  $result = array();
78
- $buffer = Mage::getStoreConfig('logicbroker_sourcing/inventory/buffer');
79
- $vendorModel = Mage::getModel('logicbroker/ranking')->getCollection();
80
  foreach ($restReqest as $value) {
81
  foreach ($value as $key=>$val) {
82
  $result[$val['lb_vendor_code']] = $this->saveLbInventory($val, $buffer);
@@ -85,98 +87,58 @@ class Logicbroker_Dropship360_Model_Inventory extends Mage_Core_Model_Abstract
85
  return $result;
86
  }
87
 
88
- /**
89
- * This function is used to save Vendor inventory
90
- * @param array $val
91
- * @return array $msg
92
- */
93
- protected function saveLbInventory($val, $buffer)
94
  {
95
- if(!is_numeric($val['cost']) || $val['cost'] < 0){
96
- $ignoreData[]= 'cost';
 
 
 
 
97
  }
98
- if(!is_numeric($val['stock']) || $val['stock'] < 0){
99
- $ignoreData[]= 'stock';
100
  }
101
- $arrayUpdate1 = array();
102
- $arrayUpdate1['cost'] = $val['cost'];
103
- $arrayUpdate1['stock']= $val['stock'];
104
- $costFlag = true;
105
- $stockFlag = true;
106
 
107
- if(!is_numeric($val['stock']) || $val['stock'] < 0 || trim($val['stock']) == "")
108
  {
109
- $stockFlag = false;
 
 
110
  }
111
 
112
- if(!is_numeric($val['cost']) || $val['cost'] < 0 || trim($val['cost']) == "")
 
113
  {
114
- $costFlag = false;
115
- }
116
-
117
- $checkVendorCode = trim($val['lb_vendor_code']);
118
- $checkProductSku = trim($val['product_sku']);
119
- if(empty($val['product_sku']) && empty($val['lb_vendor_sku'])){
120
- return $msg = 'Please provide the Supplier SKU or Product SKU details';
121
- }
122
-
123
- if(empty($checkVendorCode)){
124
- return $msg = 'Error In Importing "lb_vendor_code" Cannot Be Empty';
125
- }
126
-
127
- if(!empty($buffer)){
128
- if($buffer > $val['stock']){
129
- $val['stock'] = 0;
130
- }else{
131
- $val['stock'] = $val['stock'] - $buffer;
132
- }
133
- }
134
-
135
- $dataCollection = Mage::getModel('logicbroker/inventory');
136
- $vendorObject = Mage::getModel('logicbroker/ranking');
137
- $vendorCollection = $vendorObject->load($val['lb_vendor_code'],'lb_vendor_code');
138
- $lb_vendor_sku = trim($val['lb_vendor_sku']);
139
  if($lb_vendor_sku != ''){
140
  $collection = $dataCollection->getCollection()->addFieldToFilter('lb_vendor_code',$val['lb_vendor_code'])->addFieldToFilter('lb_vendor_sku',$lb_vendor_sku);
141
- $cntCollection = $collection->count();
142
- if($cntCollection == 0 && $checkProductSku != ''){
143
  if(!(Mage::getModel('catalog/product')->getIdBySku($val['product_sku']))){
144
- return $msg = 'Can not import Supplier inventory for non-existing product';
 
145
  }
146
- $collection = $dataCollection->getCollection()->addFieldToFilter('lb_vendor_code',$val['lb_vendor_code'])->addFieldToFilter('product_sku',$checkProductSku);
147
  }
148
  }
149
  else{
150
- if($checkProductSku != ''){
151
  if(!(Mage::getModel('catalog/product')->getIdBySku($val['product_sku']))){
152
- return $msg = 'Can not import Supplier inventory for non-existing product';
 
153
  }
154
  $collection = $dataCollection->getCollection()->addFieldToFilter('lb_vendor_code',$val['lb_vendor_code'])->addFieldToFilter('product_sku',$val['product_sku']);
155
  } else{
156
- return $msg = 'Can not import Supplier inventory for blank product sku';
157
- }
158
- }
159
- $product_sku = $collection->getFirstItem()->getProductSku();
160
-
161
- /* LBN - 935 change */
162
- $val['stock'] = Mage::helper('logicbroker')->getIsQtyDecimal($product_sku,$val['stock']);
163
-
164
- $collectionCount = $collection->getSize();
165
- if($collectionCount >= 2 && empty($checkProductSku))
166
- {
167
- return $msg = 'Multiple records found. Please provide Product SKU';
168
  }
169
- if($collection->getSize() > 0){
170
- $collection->getFirstItem ()->setUpdatedAt(now());
171
- if($stockFlag == true){
172
- $collection->getFirstItem ()->setStock($val['stock']);
173
  }
174
 
175
- if($costFlag == true){
176
- $collection->getFirstItem ()->setCost($val['cost']);
177
- }
178
- $arrayUpdate2 = array('updated_by'=>'system','product_sku'=>$product_sku,'lb_vendor_code'=>$val['lb_vendor_code']);
179
- $arrayUpdate = array_merge($arrayUpdate1, $arrayUpdate2);
180
  if(count($ignoreData)>0){
181
  if(in_array('stock', $ignoreData)) {
182
  $msg = 'Cost Updated Successfully, Stock Ignored due to invalid data for';
@@ -195,14 +157,56 @@ class Logicbroker_Dropship360_Model_Inventory extends Mage_Core_Model_Abstract
195
  $msg = 'Cost & Stock Updated Successfully for';
196
  $type = 'update';
197
  }
198
- $this->_saveInventoryLog($type,$arrayUpdate);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
199
  if(count($ignoreData)!=2){
200
  $collection->getFirstItem ()->save();
201
  $this->_updateVendorList($vendorCollection,$val,false);
202
  }
203
- return $msg;
204
  }else{
205
- return 'Vendor Sku '.$val['lb_vendor_sku'].' and Magento SKU '.$val['product_sku'].' combination odes not exist for vendor ';
206
  }
207
  }
208
 
@@ -251,7 +255,7 @@ class Logicbroker_Dropship360_Model_Inventory extends Mage_Core_Model_Abstract
251
  //patch for unique combination keys vendor_code and vendor_sku
252
  if($this->checkCodeSkuCombination($data['lb_vendor_code'],$data['lb_vendor_sku']) > 0 )
253
  {
254
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('logicbroker')->__('Duplicate entry found for %s , %s',$data['lb_vendor_code'],$data['lb_vendor_sku']));
255
  $errorArr[] = 'yes';
256
  }else{
257
  $errorArr[] = 'no';
@@ -260,7 +264,7 @@ class Logicbroker_Dropship360_Model_Inventory extends Mage_Core_Model_Abstract
260
  $isUnique = (array_unique($arrVendorCode) == $arrVendorCode);
261
  $isEntrySame = $isUnique ? false : true;
262
  if($isEntrySame)
263
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('logicbroker')->__('Duplicate Supplier Entry'));
264
  $isUniqueCombination = in_array('yes',$errorArr);
265
  }
266
  //patch for unique combination keys vendor_code and vendor_sku
@@ -275,7 +279,7 @@ class Logicbroker_Dropship360_Model_Inventory extends Mage_Core_Model_Abstract
275
  }
276
 
277
  protected function _addNewInventoryVendor($request,$productSku){
278
- $vendorCollection = Mage::getModel('logicbroker/ranking')->load($request['lb_vendor_code'],'lb_vendor_code');
279
  $request['created_at'] = now();
280
  $request['updated_at'] = now();
281
  $request['product_sku'] = $productSku;
@@ -283,7 +287,7 @@ class Logicbroker_Dropship360_Model_Inventory extends Mage_Core_Model_Abstract
283
  $request['lb_vendor_name'] = $vendorCollection->getLbVendorName();
284
  $request['lb_vendor_sku'] = trim($request['lb_vendor_sku']);
285
  if(!empty($productSku)){
286
- $qty = Mage::helper('logicbroker')->getIsQtyDecimal($productSku, $request['stock']);
287
  }
288
  else{
289
  $qty = $request['stock'];
@@ -294,7 +298,7 @@ class Logicbroker_Dropship360_Model_Inventory extends Mage_Core_Model_Abstract
294
  $this->save();
295
  $this->_saveInventoryLog('add',$request);
296
  $this->_productInventoryAdd = $this->_productInventoryAdd + $request['stock'];
297
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('logicbroker')->__('%s Added Successfully ',$request['lb_vendor_name']));
298
  }catch(Exception $e){
299
  Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
300
  }
@@ -312,13 +316,13 @@ class Logicbroker_Dropship360_Model_Inventory extends Mage_Core_Model_Abstract
312
  $request['lb_vendor_sku'] = trim($request['lb_vendor_sku']);
313
  if(!empty($productSku)){
314
  $this->_stockBeforeQtyDecimalCheck = $request['stock'];
315
- $request['stock'] = Mage::helper('logicbroker')->getIsQtyDecimal($productSku, $request['stock']);
316
  }
317
 
318
  if($DbValues['lb_vendor_sku'] != $request['lb_vendor_sku']){
319
  //patch for unique combination keys vendor_code and vendor_sku
320
  if($this->checkCodeSkuCombination($vendorCode,$request['lb_vendor_sku']) > 0){
321
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('logicbroker')->__('Duplicate entry found for %s , %s',$vendorCode,$request['lb_vendor_sku']));
322
  return false;
323
  }
324
  }
@@ -332,7 +336,7 @@ class Logicbroker_Dropship360_Model_Inventory extends Mage_Core_Model_Abstract
332
  $this->_saveInventoryLog('update',array('updated_by'=>Mage::getSingleton('admin/session')->getUser()->getUsername(),'product_sku'=>$model->getProductSku(),'lb_vendor_code'=>$model->getLbVendorCode(),'cost'=>$model->getCost(),'stock'=>$model->getStock()));
333
  $this->_productInventoryUpdate = $this->_productInventoryUpdate + $request['stock'];
334
 
335
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('logicbroker')->__('%s Updated Successfully',$vendorName));
336
  }catch(Exception $e){
337
  Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
338
  }
@@ -345,26 +349,26 @@ class Logicbroker_Dropship360_Model_Inventory extends Mage_Core_Model_Abstract
345
  protected function _deleteInvendorVendor($vendorId){
346
  $model = $this->load($vendorId);
347
  $vendorCode = $model->getLbVendorCode();
348
- $vendorCollection = Mage::getModel('logicbroker/ranking')->load($vendorCode,'lb_vendor_code');
349
  $request = array('lb_vendor_name'=>$vendorCollection->getLbVendorName(),'updated_by'=>Mage::getSingleton('admin/session')->getUser()->getUsername(),'product_sku'=>$model->getProductSku(),'lb_vendor_code'=>$model->getLbVendorCode(),'cost'=>$model->getCost(),'stock'=>$model->getStock(),'updated_at' => now());
350
  try{
351
  $model->delete();
352
  $this->_saveInventoryLog('delete',$request);
353
  $this->_productInventorySubtract = $this->_productInventorySubtract + $request['stock'];
354
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('logicbroker')->__('%s Deleted Successfully ',$request['lb_vendor_name']));
355
  }catch(Exception $e){
356
  Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
357
  }
358
  }
359
 
360
  public function _saveInventoryLog($type,$request){
361
- $modelLog = Mage::getModel('logicbroker/inventorylog');
362
  $request['activity'] = $type;
363
  if($type=='add')
364
  $request['created_at'] = now();
365
  $request['updated_at'] = now();
366
  if(!isset($request['lb_vendor_name'])){
367
- $vendorRankModel = Mage::getModel('logicbroker/ranking')->load($request['lb_vendor_code'],'lb_vendor_code');
368
  $request['lb_vendor_name'] = $vendorRankModel->getLbVendorName();
369
  }
370
  $modelLog->setData($request);
@@ -409,6 +413,54 @@ class Logicbroker_Dropship360_Model_Inventory extends Mage_Core_Model_Abstract
409
  }
410
  return $finalStock;
411
  }
412
-
413
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
414
  }
13
  protected $_productInventorySubtract = 0;
14
  protected $_productInventoryUpdate = 0;
15
  protected $_stockBeforeQtyDecimalCheck = '';
16
+ protected $_iserror = true;
17
+ protected $_errorMsg = '';
18
  protected function _construct()
19
  {
20
+ $this->_init("dropship360/inventory");
21
  }
22
 
23
  public function prepareInventoryTable($restReqest)
29
 
30
  protected function updateProductStock()
31
  {
32
+ $dataCollection = Mage::getModel('dropship360/inventory')->getCollection();
33
  $stockData = array();
34
  if($dataCollection->count() < 0){
35
  return;
66
  try {
67
  $stockItem->save();
68
  } catch (Exception $e) {
69
+ Mage::helper('dropship360')->genrateLog(0,'mgento inventory update started','mgento inventory update ended','Section :Error In Setting/update magento inventory: '.$e->getMessage().' sku : '.$sku);
70
  echo $e->getMessage();
71
  }
72
  }
77
  protected function prepareData($restReqest)
78
  {
79
  $result = array();
80
+ $buffer = trim(Mage::getStoreConfig('logicbroker_sourcing/inventory/buffer'));
81
+ $vendorModel = Mage::getModel('dropship360/ranking')->getCollection();
82
  foreach ($restReqest as $value) {
83
  foreach ($value as $key=>$val) {
84
  $result[$val['lb_vendor_code']] = $this->saveLbInventory($val, $buffer);
87
  return $result;
88
  }
89
 
90
+ protected function validateRowData($val)
 
 
 
 
 
91
  {
92
+ if(empty($val['product_sku']) && empty($val['lb_vendor_sku'])){
93
+ $this->_errorMsg = 'Please provide the Supplier SKU or Product SKU details';
94
+ $this->_iserror = false;
95
+ }elseif(empty($val['lb_vendor_code'])){
96
+ $this->_errorMsg = 'Error In Importing "lb_vendor_code" Cannot Be Empty';
97
+ $this->_iserror = false;
98
  }
99
+ return $this->_iserror;
 
100
  }
 
 
 
 
 
101
 
102
+ protected function updateStock($val,$buffer)
103
  {
104
+ if(!empty($buffer))
105
+ ($buffer > $val['stock']) ? $val['stock'] = 0 : $val['stock'] = $val['stock'] - $buffer;
106
+ return $val['stock'];
107
  }
108
 
109
+
110
+ protected function _prepareCollection($val)
111
  {
112
+ $dataCollection = Mage::getModel('dropship360/inventory');
113
+ $collection = null;
114
+ $lb_vendor_sku = $val['lb_vendor_sku'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  if($lb_vendor_sku != ''){
116
  $collection = $dataCollection->getCollection()->addFieldToFilter('lb_vendor_code',$val['lb_vendor_code'])->addFieldToFilter('lb_vendor_sku',$lb_vendor_sku);
117
+ if($collection->getSize() == 0 && $val['product_sku'] != ''){
 
118
  if(!(Mage::getModel('catalog/product')->getIdBySku($val['product_sku']))){
119
+ $this->_errorMsg = 'Can not import Supplier inventory for non-existing product';
120
+ return $collection;
121
  }
122
+ $collection = $dataCollection->getCollection()->addFieldToFilter('lb_vendor_code',$val['lb_vendor_code'])->addFieldToFilter('product_sku',$val['product_sku']);
123
  }
124
  }
125
  else{
126
+ if($val['product_sku'] != ''){
127
  if(!(Mage::getModel('catalog/product')->getIdBySku($val['product_sku']))){
128
+ $this->_errorMsg = 'Can not import Supplier inventory for non-existing product';
129
+ return $collection;
130
  }
131
  $collection = $dataCollection->getCollection()->addFieldToFilter('lb_vendor_code',$val['lb_vendor_code'])->addFieldToFilter('product_sku',$val['product_sku']);
132
  } else{
133
+ $this->_errorMsg = 'Can not import Supplier inventory for blank product sku';
134
+ return $collection;
135
+ }
 
 
 
 
 
 
 
 
 
136
  }
137
+ return $collection;
 
 
 
138
  }
139
 
140
+ protected function getLogMsg($ignoreData)
141
+ {
 
 
 
142
  if(count($ignoreData)>0){
143
  if(in_array('stock', $ignoreData)) {
144
  $msg = 'Cost Updated Successfully, Stock Ignored due to invalid data for';
157
  $msg = 'Cost & Stock Updated Successfully for';
158
  $type = 'update';
159
  }
160
+ return array('msg'=>$msg,'type'=>$type);
161
+ }
162
+
163
+ /**
164
+ * This function is used to save Vendor inventory
165
+ * @param array $val
166
+ * @return array $msg
167
+ */
168
+ protected function saveLbInventory($rowVal, $buffer)
169
+ {
170
+ $val = array_map('trim',$rowVal);
171
+ $originalStock = $val['stock'];
172
+ $vendorObject = Mage::getModel('dropship360/ranking');
173
+ $vendorCollection = $vendorObject->load($val['lb_vendor_code'],'lb_vendor_code');
174
+ if(!$this->validateRowData($val))
175
+ {
176
+ return $this->_errorMsg;
177
+ }
178
+
179
+ $ignoreData = array();
180
+ (!is_numeric($val['cost']) || $val['cost'] < 0) ? $ignoreData[]= 'cost' : '';
181
+ (!is_numeric($val['stock']) || $val['stock'] < 0) ? $ignoreData[]= 'stock' : '';
182
+ (!is_numeric($val['stock']) || $val['stock'] < 0 || $val['stock'] == "") ? $stockFlag = false : $stockFlag = true;
183
+ (!is_numeric($val['cost']) || $val['cost'] < 0 || $val['cost'] == "") ? $costFlag = false : $costFlag = true;
184
+ $val['stock'] = $this->updateStock($val,$buffer);
185
+ $collection = $this->_prepareCollection($val);
186
+ if(is_null($collection)){
187
+ return $this->_errorMsg;
188
+ }
189
+ $product_sku = $collection->getFirstItem()->getProductSku();
190
+ /* LBN - 935 change */
191
+ $val['stock'] = Mage::helper('dropship360')->getIsQtyDecimal($product_sku,$val['stock']);
192
+ if($collection->getSize() >= 2 && empty($val['product_sku']))
193
+ {
194
+ return 'Multiple records found. Please provide Product SKU';
195
+ }
196
+ if($collection->getSize() > 0){
197
+ $collection->getFirstItem ()->setUpdatedAt(now());
198
+ ($stockFlag == true) ? $collection->getFirstItem ()->setStock($val['stock']) : '';
199
+ ($costFlag == true) ? $collection->getFirstItem ()->setCost($val['cost']) : '';
200
+ $arrayUpdate = array('updated_by'=>'system','product_sku'=>$product_sku,'lb_vendor_code'=>$val['lb_vendor_code'],'cost'=>$val['cost'],'stock'=>$originalStock);
201
+ $logDetail = $this->getLogMsg($ignoreData);
202
+ $this->_saveInventoryLog($logDetail['type'],$arrayUpdate);
203
  if(count($ignoreData)!=2){
204
  $collection->getFirstItem ()->save();
205
  $this->_updateVendorList($vendorCollection,$val,false);
206
  }
207
+ return $logDetail['msg'];
208
  }else{
209
+ return 'Vendor Sku "'.$val['lb_vendor_sku'].'" and Magento SKU "'.$val['product_sku'].'" combination does not exist for vendor ';
210
  }
211
  }
212
 
255
  //patch for unique combination keys vendor_code and vendor_sku
256
  if($this->checkCodeSkuCombination($data['lb_vendor_code'],$data['lb_vendor_sku']) > 0 )
257
  {
258
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship360')->__('Duplicate entry found for %s , %s',$data['lb_vendor_code'],$data['lb_vendor_sku']));
259
  $errorArr[] = 'yes';
260
  }else{
261
  $errorArr[] = 'no';
264
  $isUnique = (array_unique($arrVendorCode) == $arrVendorCode);
265
  $isEntrySame = $isUnique ? false : true;
266
  if($isEntrySame)
267
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship360')->__('Duplicate Supplier Entry'));
268
  $isUniqueCombination = in_array('yes',$errorArr);
269
  }
270
  //patch for unique combination keys vendor_code and vendor_sku
279
  }
280
 
281
  protected function _addNewInventoryVendor($request,$productSku){
282
+ $vendorCollection = Mage::getModel('dropship360/ranking')->load($request['lb_vendor_code'],'lb_vendor_code');
283
  $request['created_at'] = now();
284
  $request['updated_at'] = now();
285
  $request['product_sku'] = $productSku;
287
  $request['lb_vendor_name'] = $vendorCollection->getLbVendorName();
288
  $request['lb_vendor_sku'] = trim($request['lb_vendor_sku']);
289
  if(!empty($productSku)){
290
+ $qty = Mage::helper('dropship360')->getIsQtyDecimal($productSku, $request['stock']);
291
  }
292
  else{
293
  $qty = $request['stock'];
298
  $this->save();
299
  $this->_saveInventoryLog('add',$request);
300
  $this->_productInventoryAdd = $this->_productInventoryAdd + $request['stock'];
301
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('dropship360')->__('%s Added Successfully ',$request['lb_vendor_name']));
302
  }catch(Exception $e){
303
  Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
304
  }
316
  $request['lb_vendor_sku'] = trim($request['lb_vendor_sku']);
317
  if(!empty($productSku)){
318
  $this->_stockBeforeQtyDecimalCheck = $request['stock'];
319
+ $request['stock'] = Mage::helper('dropship360')->getIsQtyDecimal($productSku, $request['stock']);
320
  }
321
 
322
  if($DbValues['lb_vendor_sku'] != $request['lb_vendor_sku']){
323
  //patch for unique combination keys vendor_code and vendor_sku
324
  if($this->checkCodeSkuCombination($vendorCode,$request['lb_vendor_sku']) > 0){
325
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship360')->__('Duplicate entry found for %s , %s',$vendorCode,$request['lb_vendor_sku']));
326
  return false;
327
  }
328
  }
336
  $this->_saveInventoryLog('update',array('updated_by'=>Mage::getSingleton('admin/session')->getUser()->getUsername(),'product_sku'=>$model->getProductSku(),'lb_vendor_code'=>$model->getLbVendorCode(),'cost'=>$model->getCost(),'stock'=>$model->getStock()));
337
  $this->_productInventoryUpdate = $this->_productInventoryUpdate + $request['stock'];
338
 
339
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('dropship360')->__('%s Updated Successfully',$vendorName));
340
  }catch(Exception $e){
341
  Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
342
  }
349
  protected function _deleteInvendorVendor($vendorId){
350
  $model = $this->load($vendorId);
351
  $vendorCode = $model->getLbVendorCode();
352
+ $vendorCollection = Mage::getModel('dropship360/ranking')->load($vendorCode,'lb_vendor_code');
353
  $request = array('lb_vendor_name'=>$vendorCollection->getLbVendorName(),'updated_by'=>Mage::getSingleton('admin/session')->getUser()->getUsername(),'product_sku'=>$model->getProductSku(),'lb_vendor_code'=>$model->getLbVendorCode(),'cost'=>$model->getCost(),'stock'=>$model->getStock(),'updated_at' => now());
354
  try{
355
  $model->delete();
356
  $this->_saveInventoryLog('delete',$request);
357
  $this->_productInventorySubtract = $this->_productInventorySubtract + $request['stock'];
358
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('dropship360')->__('%s Deleted Successfully ',$request['lb_vendor_name']));
359
  }catch(Exception $e){
360
  Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
361
  }
362
  }
363
 
364
  public function _saveInventoryLog($type,$request){
365
+ $modelLog = Mage::getModel('dropship360/inventorylog');
366
  $request['activity'] = $type;
367
  if($type=='add')
368
  $request['created_at'] = now();
369
  $request['updated_at'] = now();
370
  if(!isset($request['lb_vendor_name'])){
371
+ $vendorRankModel = Mage::getModel('dropship360/ranking')->load($request['lb_vendor_code'],'lb_vendor_code');
372
  $request['lb_vendor_name'] = $vendorRankModel->getLbVendorName();
373
  }
374
  $modelLog->setData($request);
413
  }
414
  return $finalStock;
415
  }
416
+ /* method use to send email notification to logicbroker
417
+ * that first vendor has been added to logicbroker_vendor_inventory
418
+ */
419
+ protected function _afterSave()
420
+ {
421
+ $colSize = $this->getCollection()->getSize();
422
+ $notifyVs = Mage::getStoreConfigFlag('logicbroker/notification/vendor_setup');
423
+ if($colSize == 1 && !$notifyVs)
424
+ {
425
+ $this->sendVendorNotification();
426
+ Mage::getModel('dropship360/logicbroker')->saveNotificationValue(1,'logicbroker/notification/vendor_setup');
427
+ }
428
+ parent::_afterSave();
429
+ return;
430
+ }
431
+
432
+ protected function sendVendorNotification(){
433
+
434
+ try {
435
+ $fieldsetData['subject'] = 'DS360 Product Setup completed on Magento';
436
+ $postObject = new Varien_Object();
437
+ $postObject->setData($fieldsetData);
438
+ $templateId = 'logicbroker_productsetup_notification';
439
+ $email = Mage::helper('dropship360')->getConfigObject('apiconfig/email/toaddress');
440
+ $isMailSent = Mage::helper('dropship360')->sendMail($postObject,$email,$templateId);
441
+ if (!$isMailSent) {
442
+ Mage::helper('dropship360')->genrateLog(0,'Order notification started','Order notification ended','First product setup complete successfully but email sending failed');
443
+ }
444
+ return true;
445
+ } catch (Exception $e) {
446
+ return false;//$e->getMassage();
447
+ }
448
+ }
449
+ public function upDateVendorName($vendor){
450
+ if(empty($vendor['code']) || empty($vendor['name']))
451
+ {
452
+ return;
453
+ }
454
+ $table = Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship360/inventory' );
455
+ $update = 'UPDATE '.$table.' SET lb_vendor_name = "'.$vendor['name'].'" WHERE lb_vendor_code = "'.$vendor['code'].'"';
456
+ $conObj = Mage::getSingleton ( 'core/resource' )->getConnection('core_write');
457
+ $conObj->beginTransaction();
458
+ $conObj->query($update);
459
+ try {
460
+ $conObj->commit ();
461
+ } catch ( Exception $e ) {
462
+ $conObj->rollBack ();
463
+ Mage::getSingleton ( 'adminhtml/session' )->addError($e->getMessage ());
464
+ }
465
+ }
466
  }
app/code/community/Logicbroker/Dropship360/Model/Inventorylog.php CHANGED
@@ -11,7 +11,7 @@ class Logicbroker_Dropship360_Model_Inventorylog extends Mage_Core_Model_Abstrac
11
  {
12
  protected function _construct(){
13
 
14
- $this->_init("logicbroker/inventorylog");
15
  }
16
  }
17
 
11
  {
12
  protected function _construct(){
13
 
14
+ $this->_init("dropship360/inventorylog");
15
  }
16
  }
17
 
app/code/community/Logicbroker/Dropship360/Model/Logicbroker.php CHANGED
@@ -16,13 +16,15 @@ class Logicbroker_Dropship360_Model_Logicbroker {
16
  $roleName = 'logicbroker';
17
  $parentId = '';
18
  $roleType = 'G';
19
- $ruleNodes = array();
 
20
 
21
  if (!is_array($fieldsetData)) {
22
  return false;
23
  }
24
  $role->load($roleName, 'role_name');
25
- $ruleNodes = array('all');
 
26
  try {
27
  $role = $role->setName($roleName)
28
  ->setPid($parentId)
@@ -157,28 +159,75 @@ class Logicbroker_Dropship360_Model_Logicbroker {
157
 
158
  public function send($attachment = null,$fieldsetData) {
159
  try {
160
-
161
- $fieldsetData['isnewreg'] = true;
162
- $postObject = new Varien_Object();
163
- $postObject->setData($fieldsetData);
164
- $mailTemplate = Mage::getModel('core/email_template');
165
- /* @var $mailTemplate Mage_Core_Model_Email_Template */
166
- $mailTemplate->setDesignConfig(array('area' => 'frontend'))
167
- ->sendTransactional(
168
- 'logicbroker_email_email_template',
169
- 'general',
170
- Mage::helper('logicbroker')->getConfigObject('apiconfig/email/toaddress'),
171
- Mage::helper('logicbroker')->getConfigObject('apiconfig/email/toname'),
172
- array('templatevar' => $postObject)
173
- );
174
- if (!$mailTemplate->getSentSuccess()) {
175
- Mage::helper('logicbroker')->genrateLog(0,'Installation notification started','Installation notification ended','Module installation notifiaction mail sending failed');
176
- return false;
177
- }
178
- return true;
179
  } catch (Exception $e) {
180
  return false;//$e->getMassage();
181
  }
182
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183
 
184
  }
16
  $roleName = 'logicbroker';
17
  $parentId = '';
18
  $roleType = 'G';
19
+ $definedRole = Mage::helper('dropship360')->getConfigObject('apiconfig/soap_role');
20
+ $ruleNodes = (!empty($definedRole)) ? explode(',',$definedRole) : array('all');
21
 
22
  if (!is_array($fieldsetData)) {
23
  return false;
24
  }
25
  $role->load($roleName, 'role_name');
26
+ //$ruleNodes = array('all');
27
+ //$ruleNodes = $definedRole;
28
  try {
29
  $role = $role->setName($roleName)
30
  ->setPid($parentId)
159
 
160
  public function send($attachment = null,$fieldsetData) {
161
  try {
162
+ $fieldsetData['isnewreg'] = true;
163
+ $version = Mage::helper('dropship360')->getConfigObject('default/logicbroker_integration/integration/ds360_version');
164
+ $fieldsetData['subject'] = 'New DS360 Package Extension version '.$version.' was installed';
165
+ $postObject = new Varien_Object();
166
+ $postObject->setData($fieldsetData);
167
+ $templateId = 'logicbroker_email_email_template';
168
+ $email = Mage::helper('dropship360')->getConfigObject('apiconfig/email/toaddress');
169
+ $isMailSent = Mage::helper('dropship360')->sendMail($postObject,$email,$templateId);
170
+ if (!$isMailSent) {
171
+ Mage::helper('dropship360')->genrateLog(0,'Installation notification started','Installation notification ended','Module installation notifiaction mail sending failed');
172
+ }
173
+ Mage::getSingleton('adminhtml/session')->unsNotification();
174
+ return true;
 
 
 
 
 
 
175
  } catch (Exception $e) {
176
  return false;//$e->getMassage();
177
  }
178
  }
179
+
180
+ public function prepareNotification($object,$orderId){
181
+ if($object == null || $orderId == null)
182
+ return;
183
+ $collection = $object->getCollection();
184
+ if($collection->getSize() == 0 )
185
+ $this->saveNotificationValue($orderId,'logicbroker/setup_notification/order');
186
+ }
187
+ public function saveNotificationValue($value = null,$path){
188
+ $data = array(
189
+ 'scope' => 'default',
190
+ 'scope_id' => '0',
191
+ 'path' => $path,
192
+ 'value' => $value,
193
+ );
194
+ try{
195
+ Mage::getModel('core/config_data')->load($data['path'],'path');
196
+ Mage::getModel('core/config_data')->setData($data)->save();
197
+ }catch(Exception $e){
198
+ return false;
199
+ }
200
+ }
201
+
202
+ public function setupNotification()
203
+ {
204
+ $order = Mage::getStoreConfig('logicbroker/setup_notification/order');
205
+
206
+ if($order)
207
+ {
208
+ $inventory = Mage::getModel('dropship360/orderitems')->getCollection()->addFieldToFilter('item_order_id',$order)->addFieldToFilter('lb_item_status','Transmitting');
209
+ if($inventory->getSize() > 0){
210
+
211
+ try {
212
+ $fieldsetData['order'] = Mage::getModel('sales/order')->load($order);
213
+ $fieldsetData['subject'] = 'DS360 Order has been Placed on Magento';
214
+ $postObject = new Varien_Object();
215
+ $postObject->setData($fieldsetData);
216
+ $templateId = 'logicbroker_order_notification';
217
+ $email = Mage::helper('dropship360')->getConfigObject('apiconfig/email/toaddress');
218
+ $isMailSent = Mage::helper('dropship360')->sendMail($postObject,$email,$templateId);
219
+ if (!$isMailSent) {
220
+ Mage::helper('dropship360')->genrateLog(0,'Order notification started','Order notification ended','First order goes to transmitting successfully email sending failed');
221
+ }
222
+ $this->saveNotificationValue(null,'logicbroker/setup_notification/order');
223
+ return true;
224
+ } catch (Exception $e) {
225
+ return false;//$e->getMassage();
226
+ }
227
+
228
+ }
229
+
230
+ }
231
+ }
232
 
233
  }
app/code/community/Logicbroker/Dropship360/Model/Observer.php CHANGED
@@ -13,9 +13,12 @@ class Logicbroker_Dropship360_Model_Observer {
13
  const XML_PATH_LOGICBROKER_ORDER_BEGIN_SOURCING_STATUS = 'Reprocess';
14
  const XML_PATH_LOGICBROKER_ORDER_BACKORDERED = 'Backorder';
15
  const XML_PATH_LOGICBROKER_EMAIL_SHIPMENT = 'logicbroker_sourcing/rank/email_shipment';
16
- const STATUS_RUNNING = 'running';
17
- const STATUS_SUCCESS = 'success';
 
 
18
  protected $_orderStatus;
 
19
 
20
  public static function getWorkingDir()
21
  {
@@ -31,18 +34,19 @@ class Logicbroker_Dropship360_Model_Observer {
31
  if(in_array($item->getProductType(),array('simple','grouped')) ){
32
  $started = 0;
33
  $ended = 1;
34
- $logMsg = 'Item inserted @'.Mage::getSingleton ( 'core/resource' )->getTableName ( 'logicbroker/orderitems' ). ' sku : '.$item->getSku().','.$object->getOrder()->getIncrementId();
35
- Mage::helper('logicbroker')->genrateLog(++$started,'Order Item Inserted Started',null,$logMsg);
36
  $this->getOrderSourcing($item, $object);
37
- Mage::helper('logicbroker')->genrateLog(++$ended,null,'Order Item Inserted Ended',null);
38
  }
39
  }
40
  }
41
 
42
  protected function getOrderSourcing($item, $object){
43
- $orderSourcingInstance = Mage::getModel ( 'logicbroker/orderitems' );
 
44
  $orderStatus = $object->getOrder()->getStatus();
45
- $itemStatusHistory = Mage::helper('logicbroker')->getSerialisedData($orderSourcingInstance, 'Sourcing', $orderStatus);
46
  $orderSourcingInstance->setSku ( $item->getSku() );
47
  $orderSourcingInstance->setItemId ( $item->getItemId() );
48
  $orderSourcingInstance->setItemOrderId ( $object->getOrder()->getEntityId() );
@@ -53,37 +57,55 @@ class Logicbroker_Dropship360_Model_Observer {
53
  try {
54
  $orderSourcingInstance->save ();
55
  } catch ( Execption $e ) {
56
- Mage::helper('logicbroker')->genrateLog(0,null,null,'Section : order item inserted Error: '.$e->getMessage().' sku : '.$item->getSku());
57
  echo $e->getMessage();
58
  }
59
 
60
- //As item get saved in logicbroker_sales_orders_items we run our sourcing logic
61
- $assigned = $this->assignToVendor($item);
62
-
 
 
 
63
  }
64
 
65
  public function logicbrokerSourcing() {
 
66
  if(!Mage::getStoreConfig(self::CRON_STRING_PATH_SOURCING)) {
67
- Mage::helper('logicbroker')->genrateLog(0,'Sourcing started','Sourcing started','Sourcing can not be started as cron time not set');
 
 
 
 
 
68
  return;
69
  }
70
- Mage::helper('logicbroker')->genrateLog(1,'Sourcing Started for '.Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_REPROCESS.' Item status',null,null);
71
- $this->setLbVendorRanking (Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_REPROCESS);
 
72
  $this->addCronStatus('logicbroker_sourcing/cron_settings/dispaly_sourcing_updated_time', Mage::helper('core')->formatDate(now(), 'medium', true));
73
- Mage::helper('logicbroker')->genrateLog(2,null,'Sourcing Ended for ' .Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_REPROCESS.' Item status',null);
 
74
  return;
75
  }
76
 
77
  public function logicbrokerBackorder()
78
  {
 
79
  if(!Mage::getStoreConfig(self::CRON_STRING_PATH_BACKORDER)) {
80
- Mage::helper('logicbroker')->genrateLog(0,'Backorder sourcing started','Backorder sourcing ended','Backorder Sourcing can not be started as cron time not set');
81
  return;
82
  }
83
- Mage::helper('logicbroker')->genrateLog(1,'Backorder Sourcing Started for '.Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_BACKORDER . ' item status',null,null);
84
- $this->setLbVendorRanking (Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_BACKORDER,true);
 
 
 
 
 
85
  $this->addCronStatus('logicbroker_sourcing/cron_settings/display_backorder_updated_time', Mage::helper('core')->formatDate(now(), 'medium', true));
86
- Mage::helper('logicbroker')->genrateLog(1,'Backorder Sourcing Ended for '.Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_BACKORDER .' item status',null,null);
 
87
  return;
88
  }
89
 
@@ -99,45 +121,38 @@ class Logicbroker_Dropship360_Model_Observer {
99
  return;
100
  }
101
 
102
- protected function setLbVendorRanking($crontype,$isBackorderedCron = false)
103
  {
104
  $reprocess = Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_REPROCESS;
105
- $lbOrderInstances = Mage::getModel('logicbroker/ordersourcing');
106
- $collection = $lbOrderInstances->prepareItemCollection($crontype);
107
- if($collection->count() > 0 ){
108
- foreach ( $collection as $orderData ) {
109
- $orderCollection = Mage::getModel('sales/order')->Load($orderData->getItemOrderId());
110
-
111
- Mage::helper('logicbroker')->genrateLog(0,null,null,'<---->Item Processing Started : '.$orderData->getSku());
112
-
 
 
 
 
 
113
  if ($crontype == Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_REPROCESS) {
114
-
115
- //Patch : skip sourcing process if order is deleted
116
- if (! $orderCollection->getEntityId ()) {
117
- Mage::helper ( 'logicbroker' )->genrateLog ( 0, null, null, 'Order not exists for => order_id: ' . $orderData->getItemOrderId () . ' hence cannot continue' );
118
- continue;
119
- }
120
- $this->_orderStatus = $orderCollection->getStatus();
121
  $assigned = $this->assignToVendor(Mage::getModel('sales/order_item')->Load($orderData->getItemId()));
122
- $orderCollection->addStatusHistoryComment($orderData->getSku().': Item status changed to '.$assigned);
123
-
124
  }else
125
- {
126
- $orderItems = Mage::getModel ( 'logicbroker/orderitems' )->load($orderData->getItemId(),'item_id');
127
- $itemStatusHistory = Mage::helper('logicbroker')->getSerialisedData($orderItems, $reprocess, $orderCollection->getStatus());
128
- $orderItems->setLbItemStatus ($reprocess)
129
- ->setitemStatusHistory($itemStatusHistory)
130
- ->save();
131
- $orderCollection->addStatusHistoryComment($orderData->getSku().': Item status changed to '.$reprocess);
132
-
133
  }
134
- $orderCollection->save();
135
- Mage::helper('logicbroker')->genrateLog(0,null,null,'####### Item Processing ended : '.$orderData->getSku());
136
 
137
-
 
 
138
  }
139
  }else {
140
- Mage::helper('logicbroker')->genrateLog(0,null,null,'Order collection is empty for => Cron_type: '.$crontype.' hence cannot continue');
141
  return;
142
  }
143
  }
@@ -152,10 +167,11 @@ class Logicbroker_Dropship360_Model_Observer {
152
  $vendorCode = '';
153
  $inventoryStock = '';
154
  $defaultVendor = (Mage::getStoreConfig('logicbroker_sourcing/rank/defaultbackorder') == 'none') ? '' : Mage::getStoreConfig('logicbroker_sourcing/rank/defaultbackorder');
155
- $orderItemInstance = Mage::getModel ( 'logicbroker/orderitems' );
156
  $orderItemInstance->load ( $itemId, 'item_id' );
157
  $collectionVendor = $orderItemInstance->prepareOrderItemData($item);
158
  $arrDefaultVendorDetails = array();
 
159
 
160
  if ($collectionVendor->count () > 0) {
161
  if($collectionVendor->count () >= 1){
@@ -205,31 +221,69 @@ class Logicbroker_Dropship360_Model_Observer {
205
 
206
  if(!empty($vendorCode)){
207
  if ($vendorCode && $inventoryStock >= $qtyInvoiced) {
208
-
209
- $itemStatus = 'Transmitting';
210
- $itemStatusHistory = Mage::helper('logicbroker')->getSerialisedData($orderItemInstance, $itemStatus, $this->_orderStatus);
211
- $orderItemInstance->setItemData($orderItemInstance,$itemStatusComplete,$item,$vendorCode,$vendorCost*$qtyInvoiced,$vendorSku,$itemStatusHistory);
212
- $orderItemInstance->updateLbVendorInvenory ( $vendorCode, $productSku,$qtyInvoiced );
213
- Mage::helper('logicbroker')->genrateLog(0,null,null,'@@@@@@@@ Sourcing Details==> stock('.$inventoryStock.') >= qtyinvoiced('.$qtyInvoiced.'),vendor_code ->'.$vendorCode.', item-status->'.$itemStatus);
 
 
 
 
 
 
 
 
 
214
  return $itemStatusComplete;
215
  }
216
  if ($isDefaultVendor && $inventoryStock <= $qtyInvoiced && !empty($defaultVendor) && in_array($defaultVendor,$arrVendorAvailable)) {
217
- $itemStatusHistory = Mage::helper('logicbroker')->getSerialisedData($orderItemInstance, 'Transmitting', $this->_orderStatus);
218
- $orderItemInstance->setItemData($orderItemInstance,$itemStatusComplete,$item,$defaultVendor,$arrDefaultVendorDetails['cost']*$qtyInvoiced,$arrDefaultVendorDetails['lb_vendor_sku'],$itemStatusHistory);
219
- Mage::helper('logicbroker')->genrateLog(0,null,null,'@@@@@@@@ Sourcing Details Default vendor set ==>stock('.$inventoryStock.') >= qtyinvoiced('.$qtyInvoiced.'),vendor_code ->'.$vendorCode.', item-status->Transmitting');
 
 
 
 
 
 
 
 
 
 
220
  return $itemStatusComplete;
221
  }
222
  if ($vendorCode && $inventoryStock <= $qtyInvoiced) {
223
- $itemStatus = 'Backorder';
224
- $itemStatusHistory =Mage::helper('logicbroker')->getSerialisedData($orderItemInstance, $itemStatus, $this->_orderStatus);
225
- $orderItemInstance->setItemData($orderItemInstance,$itemStatusBackorder,$item,$vendorCode,$vendorCost*$qtyInvoiced,$vendorSku,$itemStatusHistory);
226
- Mage::helper('logicbroker')->genrateLog(0,null,null,'@@@@@@@@ Sourcing Details==>stock('.$inventoryStock.') <= qtyinvoiced('.$qtyInvoiced.'),vendor_code ->'.$vendorCode.', item-status->'.$itemStatus);
 
 
 
 
 
 
 
 
 
227
  return $itemStatusBackorder;
228
  }
229
  }else{
230
- $itemStatusHistory = Mage::helper('logicbroker')->getSerialisedData($orderItemInstance,'No Dropship', $this->_orderStatus);
231
- $orderItemInstance->setItemData($orderItemInstance,'No Dropship',$item,$vendorCode,$qtyInvoiced,"",$itemStatusHistory);
232
- Mage::helper('logicbroker')->genrateLog(0,null,null,'@@@@@@@@ Sourcing Details==> No vendor Set ,vendor_code ->'.$vendorCode.', item-status->No Dropship');
 
 
 
 
 
 
 
 
 
 
233
  return $itemStatusNoDropShip;
234
  }
235
  }
@@ -259,14 +313,14 @@ class Logicbroker_Dropship360_Model_Observer {
259
  *
260
  */
261
  $customFieldValue = $this->_getRequest()->getPost('product');
262
- $result = Mage::getModel('logicbroker/inventory')->saveTabVendorData($customFieldValue);
263
 
264
  /**
265
  * Uncomment the line below to save the product
266
  *
267
  */
268
  //if(!$result)
269
- //Mage::getSingleton('adminhtml/session')->addError(Mage::helper('logicbroker')->__('Vendor Data Cannot be saved'));
270
 
271
  //$product->save();
272
 
@@ -287,7 +341,7 @@ class Logicbroker_Dropship360_Model_Observer {
287
  }
288
 
289
  $finalStock = $result['inventory'];
290
- $finalStock = Mage::helper('logicbroker')->getIsQtyDecimal($sku, $finalStock);
291
  $conn = Mage::getSingleton ( 'core/resource' )->getConnection ( 'core_write' );
292
 
293
  $tableNameStatus = Mage::getSingleton ( 'core/resource' )->getTableName ( 'cataloginventory/stock_status' );
@@ -405,11 +459,11 @@ class Logicbroker_Dropship360_Model_Observer {
405
  public function catalogProductDeleteAfter(Varien_Event_Observer $observer)
406
  {
407
  $deletedProductSku = $observer->getEvent()->getProduct()->getSku();
408
- $orderItem = Mage::getModel ('logicbroker/inventory')->getCollection()->addFieldToFilter('product_sku', $deletedProductSku);
409
  if($orderItem->getSize() > 0){
410
  foreach($orderItem as $data){
411
  try {
412
- Mage::getModel ('logicbroker/inventory')->load($data->getId())->delete();
413
  } catch (Exception $e) {
414
  Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
415
  }
@@ -417,4 +471,30 @@ class Logicbroker_Dropship360_Model_Observer {
417
  }
418
  return $this;
419
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
420
  }
13
  const XML_PATH_LOGICBROKER_ORDER_BEGIN_SOURCING_STATUS = 'Reprocess';
14
  const XML_PATH_LOGICBROKER_ORDER_BACKORDERED = 'Backorder';
15
  const XML_PATH_LOGICBROKER_EMAIL_SHIPMENT = 'logicbroker_sourcing/rank/email_shipment';
16
+ const XML_PATH_INVENTORY_NOTIFICATION_EMAIL = 'logicbroker_sourcing/inventory_notification/email';
17
+ const XML_PATH_INVENTORY_NOTIFICATION_EMAIL_ENABLED = 'logicbroker_sourcing/inventory_notification/enabled';
18
+ const XML_PATH_INVENTORY_NOTIFICATION_DAYS = 'logicbroker_sourcing/inventory_notification/days';
19
+ const XML_PATH_LOGICSOURCING_SOURCING_TYPE = 'logicbroker_sourcing/rank/sourcing_type';
20
  protected $_orderStatus;
21
+ protected $_itemData = array();
22
 
23
  public static function getWorkingDir()
24
  {
34
  if(in_array($item->getProductType(),array('simple','grouped')) ){
35
  $started = 0;
36
  $ended = 1;
37
+ $logMsg = 'Item inserted @'.Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship360/orderitems' ). ' sku : '.$item->getSku().','.$object->getOrder()->getIncrementId();
38
+ Mage::helper('dropship360')->genrateLog(++$started,'Order Item Inserted Started',null,$logMsg);
39
  $this->getOrderSourcing($item, $object);
40
+ Mage::helper('dropship360')->genrateLog(++$ended,null,'Order Item Inserted Ended',null);
41
  }
42
  }
43
  }
44
 
45
  protected function getOrderSourcing($item, $object){
46
+ $orderSourcingInstance = Mage::getModel ( 'dropship360/orderitems' );
47
+ Mage::getModel('dropship360/logicbroker')->prepareNotification($orderSourcingInstance,$object->getOrder()->getEntityId());
48
  $orderStatus = $object->getOrder()->getStatus();
49
+ $itemStatusHistory = Mage::helper('dropship360')->getSerialisedData($orderSourcingInstance, 'Sourcing', $orderStatus);
50
  $orderSourcingInstance->setSku ( $item->getSku() );
51
  $orderSourcingInstance->setItemId ( $item->getItemId() );
52
  $orderSourcingInstance->setItemOrderId ( $object->getOrder()->getEntityId() );
57
  try {
58
  $orderSourcingInstance->save ();
59
  } catch ( Execption $e ) {
60
+ Mage::helper('dropship360')->genrateLog(0,null,null,'Section : order item inserted Error: '.$e->getMessage().' sku : '.$item->getSku());
61
  echo $e->getMessage();
62
  }
63
 
64
+ //As item get saved in logicbroker_sales_orders_items we run our sourcing logic
65
+ if(Mage::getStoreConfigFlag(self::XML_PATH_LOGICSOURCING_SOURCING_TYPE)){
66
+ $this->assignToVendor($item);
67
+ Mage::getResourceModel('dropship360/orderitems')->saveOrderItems($this->_itemData,$object->getOrder());
68
+ $this->_itemData = array();
69
+ }
70
  }
71
 
72
  public function logicbrokerSourcing() {
73
+ $sourcingObj = Mage::getModel('dropship360/ordersourcing');
74
  if(!Mage::getStoreConfig(self::CRON_STRING_PATH_SOURCING)) {
75
+ Mage::helper('dropship360')->genrateLog(0,'Sourcing started','Sourcing started','Sourcing can not be started as cron time not set');
76
+ return;
77
+ }
78
+ if($sourcingObj->checkRunningStatus('sourcing')){
79
+
80
+ Mage::helper('dropship360')->genrateLog(0,'Sourcing started','Sourcing started','Sourcing can not be started as process already running');
81
  return;
82
  }
83
+ Mage::helper('dropship360')->genrateLog(1,'Sourcing Started for '.Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_REPROCESS.' Item status',null,null);
84
+ $sourcingObj->sourcingStarted(Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_SOURCING);
85
+ $this->setLbVendorRanking (Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_REPROCESS,true);
86
  $this->addCronStatus('logicbroker_sourcing/cron_settings/dispaly_sourcing_updated_time', Mage::helper('core')->formatDate(now(), 'medium', true));
87
+ $sourcingObj->sourcingCompleted(Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_SOURCING);
88
+ Mage::helper('dropship360')->genrateLog(2,null,'Sourcing Ended for ' .Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_REPROCESS.' Item status',null);
89
  return;
90
  }
91
 
92
  public function logicbrokerBackorder()
93
  {
94
+ $sourcingObj = Mage::getModel('dropship360/ordersourcing');
95
  if(!Mage::getStoreConfig(self::CRON_STRING_PATH_BACKORDER)) {
96
+ Mage::helper('dropship360')->genrateLog(0,'Backorder sourcing started','Backorder sourcing ended','Backorder Sourcing can not be started as cron time not set');
97
  return;
98
  }
99
+ if($sourcingObj->checkRunningStatus(Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_BACKORDER)){
100
+ Mage::helper('dropship360')->genrateLog(0,'Backorder sourcing started','Backorder sourcing ended','Backorder Sourcing can not be started process already running');
101
+ return;
102
+ }
103
+ Mage::helper('dropship360')->genrateLog(1,'Backorder Sourcing Started for '.Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_BACKORDER . ' item status',null,null);
104
+ $sourcingObj->sourcingStarted(Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_BACKORDER);
105
+ $this->setLbVendorRanking (Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_BACKORDER);
106
  $this->addCronStatus('logicbroker_sourcing/cron_settings/display_backorder_updated_time', Mage::helper('core')->formatDate(now(), 'medium', true));
107
+ $sourcingObj->sourcingCompleted(Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_BACKORDER);
108
+ Mage::helper('dropship360')->genrateLog(1,'Backorder Sourcing Ended for '.Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_BACKORDER .' item status',null,null);
109
  return;
110
  }
111
 
121
  return;
122
  }
123
 
124
+ protected function setLbVendorRanking($crontype,$isCronSourcing = false)
125
  {
126
  $reprocess = Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_REPROCESS;
127
+ $lbOrderInstances = Mage::getModel('dropship360/ordersourcing');
128
+ $collection = $lbOrderInstances->prepareItemCollection($crontype,$isCronSourcing);
129
+ if(count($collection) > 0 ){
130
+ foreach ( $collection as $orderID => $orderCollectionData ) {
131
+ $orderCollection = Mage::getModel('sales/order')->Load($orderID);
132
+ //Patch : skip sourcing process if order is deleted
133
+ if (! $orderCollection->getEntityId ()) {
134
+ Mage::helper ( 'dropship360' )->genrateLog ( 0, null, null, 'Order not exists for => order_id: ' . $orderID . ' hence cannot continue' );
135
+ continue;
136
+ }
137
+ $this->_orderStatus = $orderCollection->getStatus();
138
+ foreach ($orderCollectionData as $orderData ){
139
+ Mage::helper('dropship360')->genrateLog(0,null,null,'<---->Item Processing Started : '.$orderData->getSku());
140
  if ($crontype == Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_REPROCESS) {
 
 
 
 
 
 
 
141
  $assigned = $this->assignToVendor(Mage::getModel('sales/order_item')->Load($orderData->getItemId()));
 
 
142
  }else
143
+ {
144
+ $orderItems = Mage::getModel( 'dropship360/orderitems' )->load($orderData->getItemId(), 'item_id');
145
+ $itemStatusHistory = Mage::helper('dropship360')->getSerialisedData($orderItems, $reprocess, $this->_orderStatus);
146
+ $this->_itemData[$orderData->getItemId()] = array('lb_item_status'=>$reprocess,'item_status_history'=>$itemStatusHistory);
 
 
 
 
147
  }
148
+ Mage::helper('dropship360')->genrateLog(0,null,null,'####### Item Processing ended : '.$orderData->getSku());
 
149
 
150
+ }
151
+ Mage::getResourceModel('dropship360/orderitems')->saveOrderItems($this->_itemData,$orderCollection,$crontype);
152
+ $this->_itemData = array();
153
  }
154
  }else {
155
+ Mage::helper('dropship360')->genrateLog(0,null,null,'Order collection is empty for => Cron_type: '.$crontype.' hence cannot continue');
156
  return;
157
  }
158
  }
167
  $vendorCode = '';
168
  $inventoryStock = '';
169
  $defaultVendor = (Mage::getStoreConfig('logicbroker_sourcing/rank/defaultbackorder') == 'none') ? '' : Mage::getStoreConfig('logicbroker_sourcing/rank/defaultbackorder');
170
+ $orderItemInstance = Mage::getModel ( 'dropship360/orderitems' );
171
  $orderItemInstance->load ( $itemId, 'item_id' );
172
  $collectionVendor = $orderItemInstance->prepareOrderItemData($item);
173
  $arrDefaultVendorDetails = array();
174
+ $vendorCost = 0;
175
 
176
  if ($collectionVendor->count () > 0) {
177
  if($collectionVendor->count () >= 1){
221
 
222
  if(!empty($vendorCode)){
223
  if ($vendorCode && $inventoryStock >= $qtyInvoiced) {
224
+ $itemStatusHistory = Mage::helper('dropship360')->getSerialisedData($orderItemInstance, $itemStatusComplete, $this->_orderStatus);
225
+ Mage::helper('dropship360')->genrateLog(0,null,null,'@@@@@@@@ Sourcing Details==> stock('.$inventoryStock.') >= qtyinvoiced('.$qtyInvoiced.'),vendor_code ->'.$vendorCode.', item-status->'.$itemStatusComplete);
226
+ Mage::getModel('dropship360/logicbroker')->setupNotification();
227
+ $this->_itemData [$item->getItemId ()] = array (
228
+ 'updateInventory' => true,
229
+ 'qtyInvoiced' =>$qtyInvoiced,
230
+ 'updated_at' => now (),
231
+ 'sku' => $item->getSku (),
232
+ 'updated_by' => 'Cron',
233
+ 'lb_item_status' => $itemStatusComplete,
234
+ 'lb_vendor_code' => $vendorCode,
235
+ 'vendor_cost' => $vendorCost * $qtyInvoiced,
236
+ 'lb_vendor_sku' => $vendorSku,
237
+ 'item_status_history' => $itemStatusHistory
238
+ );
239
  return $itemStatusComplete;
240
  }
241
  if ($isDefaultVendor && $inventoryStock <= $qtyInvoiced && !empty($defaultVendor) && in_array($defaultVendor,$arrVendorAvailable)) {
242
+ $itemStatusHistory = Mage::helper('dropship360')->getSerialisedData($orderItemInstance, $itemStatusComplete, $this->_orderStatus);
243
+ Mage::helper('dropship360')->genrateLog(0,null,null,'@@@@@@@@ Sourcing Details Default vendor set ==>stock('.$inventoryStock.') >= qtyinvoiced('.$qtyInvoiced.'),vendor_code ->'.$vendorCode.', item-status->Transmitting');
244
+ $this->_itemData [$item->getItemId ()] = array (
245
+ 'updateInventory' => false,
246
+ 'updated_at' => now (),
247
+ 'sku' => $item->getSku (),
248
+ 'updated_by' => 'Cron',
249
+ 'lb_item_status' => $itemStatusComplete,
250
+ 'lb_vendor_code' => $defaultVendor,
251
+ 'vendor_cost' => $arrDefaultVendorDetails ['cost'] * $qtyInvoiced,
252
+ 'lb_vendor_sku' => $arrDefaultVendorDetails ['lb_vendor_sku'],
253
+ 'item_status_history' => $itemStatusHistory
254
+ );
255
  return $itemStatusComplete;
256
  }
257
  if ($vendorCode && $inventoryStock <= $qtyInvoiced) {
258
+ $itemStatusHistory =Mage::helper('dropship360')->getSerialisedData($orderItemInstance, $itemStatusBackorder, $this->_orderStatus);
259
+ Mage::helper('dropship360')->genrateLog(0,null,null,'@@@@@@@@ Sourcing Details==>stock('.$inventoryStock.') <= qtyinvoiced('.$qtyInvoiced.'),vendor_code ->'.$vendorCode.', item-status->'.$itemStatusBackorder);
260
+ $this->_itemData [$item->getItemId ()] = array (
261
+ 'updateInventory' => false,
262
+ 'updated_at' => now (),
263
+ 'sku' => $item->getSku (),
264
+ 'updated_by' => 'Cron',
265
+ 'lb_item_status' => $itemStatusBackorder,
266
+ 'lb_vendor_code' => $vendorCode,
267
+ 'vendor_cost' => $vendorCost * $qtyInvoiced,
268
+ 'lb_vendor_sku' => $vendorSku,
269
+ 'item_status_history' => $itemStatusHistory
270
+ );
271
  return $itemStatusBackorder;
272
  }
273
  }else{
274
+ $itemStatusHistory = Mage::helper('dropship360')->getSerialisedData($orderItemInstance,$itemStatusNoDropShip, $this->_orderStatus);
275
+ Mage::helper('dropship360')->genrateLog(0,null,null,'@@@@@@@@ Sourcing Details==> No vendor Set ,vendor_code ->'.$vendorCode.', item-status->No Dropship');
276
+ $this->_itemData [$item->getItemId ()] = array (
277
+ 'updateInventory' => false,
278
+ 'updated_at' => now (),
279
+ 'sku' => $item->getSku (),
280
+ 'updated_by' => 'Cron',
281
+ 'lb_item_status' => $itemStatusNoDropShip,
282
+ 'lb_vendor_code' => $vendorCode,
283
+ 'vendor_cost' => $vendorCost * $qtyInvoiced,
284
+ 'lb_vendor_sku' => '',
285
+ 'item_status_history' => $itemStatusHistory
286
+ );
287
  return $itemStatusNoDropShip;
288
  }
289
  }
313
  *
314
  */
315
  $customFieldValue = $this->_getRequest()->getPost('product');
316
+ $result = Mage::getModel('dropship360/inventory')->saveTabVendorData($customFieldValue);
317
 
318
  /**
319
  * Uncomment the line below to save the product
320
  *
321
  */
322
  //if(!$result)
323
+ //Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship360')->__('Vendor Data Cannot be saved'));
324
 
325
  //$product->save();
326
 
341
  }
342
 
343
  $finalStock = $result['inventory'];
344
+ $finalStock = Mage::helper('dropship360')->getIsQtyDecimal($sku, $finalStock);
345
  $conn = Mage::getSingleton ( 'core/resource' )->getConnection ( 'core_write' );
346
 
347
  $tableNameStatus = Mage::getSingleton ( 'core/resource' )->getTableName ( 'cataloginventory/stock_status' );
459
  public function catalogProductDeleteAfter(Varien_Event_Observer $observer)
460
  {
461
  $deletedProductSku = $observer->getEvent()->getProduct()->getSku();
462
+ $orderItem = Mage::getModel ('dropship360/inventory')->getCollection()->addFieldToFilter('product_sku', $deletedProductSku);
463
  if($orderItem->getSize() > 0){
464
  foreach($orderItem as $data){
465
  try {
466
+ Mage::getModel ('dropship360/inventory')->load($data->getId())->delete();
467
  } catch (Exception $e) {
468
  Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
469
  }
471
  }
472
  return $this;
473
  }
474
+ //@function : notify cutomer for oudated product inventory through email,initiated by cron
475
+ public function notifyForProductUpdateInventory(){
476
+ if (!Mage::getStoreConfigFlag (self::XML_PATH_INVENTORY_NOTIFICATION_EMAIL_ENABLED) || !Mage::getStoreConfigFlag (self::XML_PATH_INVENTORY_NOTIFICATION_DAYS) || !Mage::getStoreConfigFlag (self::XML_PATH_INVENTORY_NOTIFICATION_EMAIL)) {
477
+ return $this;
478
+ }
479
+ $itemObject;
480
+ $fileInfo = array();
481
+ $ioAdapter = new Varien_Io_File();
482
+ $open_monitor_from = Date('Y-m-d h:i:s', strtotime('-'.Mage::getStoreConfig(self::XML_PATH_INVENTORY_NOTIFICATION_DAYS).' day'));
483
+ $open_monitor_to = Mage::getModel('core/date')->gmtDate();
484
+ $itemObject = Mage::getModel('dropship360/inventory')->getCollection()->addFieldTofilter('updated_at', array('from' => $open_monitor_from,'to' => $open_monitor_to));
485
+ if($itemObject->getSize() <= 0){
486
+ Mage::log('cannot send outdated product inventory email collection is empty for form :'.$open_monitor_from.' to :'.$open_monitor_to, null, 'notification_error.log');
487
+ return $this;
488
+ }
489
+ $fileInfo = Mage::getModel('dropship360/csvparser')->getCsvFile($itemObject);
490
+ $mailData['days'] = Mage::getStoreConfig(self::XML_PATH_INVENTORY_NOTIFICATION_DAYS);
491
+ $mailData['subject'] = 'dropship360 list of outdated product inventory';
492
+ $postObject = new Varien_Object();
493
+ $postObject->setData($mailData);
494
+ $email = trim(Mage::getStoreConfig(self::XML_PATH_INVENTORY_NOTIFICATION_EMAIL));
495
+ $templateId = 'logicbroker_outdated_product_inventory';
496
+ $isMailSent = Mage::helper('dropship360')->sendMail($postObject,$email,$templateId,$fileInfo['value']);
497
+ $ioAdapter->rm($fileInfo['value']);
498
+ return $this;
499
+ }
500
  }
app/code/community/Logicbroker/Dropship360/Model/Order/Api.php CHANGED
@@ -82,7 +82,7 @@ class Logicbroker_Dropship360_Model_Order_Api extends Mage_Sales_Model_Order_Api
82
  protected function isDropshipItemReady($order)
83
  {
84
  $result = false;
85
- $lbItemCollection = Mage::getModel('logicbroker/orderitems')->getCollection()->addFieldToFilter('lb_item_status',$this->_itemStatusTansmitting)->addFieldToFilter('item_order_id',$order->getEntityId());
86
  if($lbItemCollection->count() > 0)
87
  $result = true;
88
  return $result;
@@ -90,7 +90,7 @@ class Logicbroker_Dropship360_Model_Order_Api extends Mage_Sales_Model_Order_Api
90
 
91
  protected function addItemDetails($order){
92
  $result = array();
93
- $lbItemCollection = Mage::getModel('logicbroker/orderitems')->getCollection()->addFieldToFilter('item_order_id',$order->getEntityId());
94
  if($lbItemCollection->count() > 0){
95
  unset($result);
96
  foreach($lbItemCollection as $item)
@@ -152,7 +152,7 @@ class Logicbroker_Dropship360_Model_Order_Api extends Mage_Sales_Model_Order_Api
152
  }
153
  $productItems = array();
154
  $productItems = $this->_getAttributes($item, 'order_item');
155
- $lbItems = Mage::getModel('logicbroker/orderitems')->getCollection()
156
  ->addFieldToSelect(array('sku', 'lb_vendor_sku', 'lb_item_status', 'lb_vendor_code', 'item_id'))
157
  ->addFieldToFilter('item_order_id',array('eq'=>$order->getId()))
158
  ->addFieldToFilter('item_id', array('eq'=>$productItems['item_id']))
@@ -189,7 +189,7 @@ class Logicbroker_Dropship360_Model_Order_Api extends Mage_Sales_Model_Order_Api
189
  if(!$status){
190
  $status = Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_SENT_TO_SUPPLIER;
191
  }
192
- if($itemIdArr && in_array(ucfirst($status),Mage::helper('logicbroker')->getItemStatuses())){
193
  foreach($itemIdArr as $itemId){
194
  $result = $this->saveLbStatus($itemId, $status);
195
  }
@@ -208,17 +208,17 @@ class Logicbroker_Dropship360_Model_Order_Api extends Mage_Sales_Model_Order_Api
208
  * @return bool
209
  */
210
  protected function saveLbStatus($itemId, $status){
211
- $lbStatus = Mage::getModel('logicbroker/orderitems')->load($itemId, 'item_id');
212
  $orderCollection = Mage::getModel('sales/order')->load($lbStatus->getItemOrderId());
213
  $orderStatus = $orderCollection->getStatus();
214
- $itemStatusHistory = Mage::helper('logicbroker')->getSerialisedData($lbStatus, ucfirst($status), $orderStatus);
215
  if($lbStatus->getId()){
216
  $lbStatus->setLbItemStatus(ucfirst($status))
217
  ->setUpdatedBy('logicbroker')
218
  ->setItemStatusHistory($itemStatusHistory)
219
  ->setUpdatedAt(Mage::getModel('core/date')->gmtDate())
220
  ->save();
221
- Mage::helper('logicbroker')->genrateLog(0,'API Item Update started','API Item Update ended','Item Status updated by Logicbroker API item-status->'.$status.' ,sku->'.$lbStatus->getSku().' ,orderId->'.$lbStatus->getItemOrderId());
222
  return true;
223
  }
224
  }
@@ -239,7 +239,7 @@ class Logicbroker_Dropship360_Model_Order_Api extends Mage_Sales_Model_Order_Api
239
  $orderItemsdDetails = array();
240
  try{
241
 
242
- $orderCollection = Mage::getModel('logicbroker/orderitems')->getCollection();
243
  $orderCollection->addFieldToFilter('lb_item_status',$orderItemStatus);
244
  $orderCollection->getSelect()->join(array('salesOrder'=>Mage::getSingleton('core/resource')->getTableName('sales/order')),
245
  'salesOrder.entity_id = main_table.item_order_id', array('increment_id','store_id'))->where('store_id = ?', (int)$store_id);
@@ -271,7 +271,7 @@ class Logicbroker_Dropship360_Model_Order_Api extends Mage_Sales_Model_Order_Api
271
  $itemId = array();
272
  $itemOrderId = $order->getEntityId();
273
  $result = false;
274
- $orderCollection = Mage::getModel('logicbroker/orderitems')->getCollection();
275
  $orderCollection->addFieldToFilter('lb_item_status','Transmitting');
276
  $orderCollection->addFieldToFilter('item_order_id',$itemOrderId);
277
 
@@ -290,7 +290,7 @@ class Logicbroker_Dropship360_Model_Order_Api extends Mage_Sales_Model_Order_Api
290
  $itemStatus = Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_SENT_TO_SUPPLIER;
291
  }
292
 
293
- if(!empty($itemId) && in_array(ucfirst($itemStatus),Mage::helper('logicbroker')->getItemStatuses())){
294
  foreach($itemId as $itemId){
295
  $result = $this->saveLbStatus($itemId, $itemStatus);
296
  }
82
  protected function isDropshipItemReady($order)
83
  {
84
  $result = false;
85
+ $lbItemCollection = Mage::getModel('dropship360/orderitems')->getCollection()->addFieldToFilter('lb_item_status',$this->_itemStatusTansmitting)->addFieldToFilter('item_order_id',$order->getEntityId());
86
  if($lbItemCollection->count() > 0)
87
  $result = true;
88
  return $result;
90
 
91
  protected function addItemDetails($order){
92
  $result = array();
93
+ $lbItemCollection = Mage::getModel('dropship360/orderitems')->getCollection()->addFieldToFilter('item_order_id',$order->getEntityId());
94
  if($lbItemCollection->count() > 0){
95
  unset($result);
96
  foreach($lbItemCollection as $item)
152
  }
153
  $productItems = array();
154
  $productItems = $this->_getAttributes($item, 'order_item');
155
+ $lbItems = Mage::getModel('dropship360/orderitems')->getCollection()
156
  ->addFieldToSelect(array('sku', 'lb_vendor_sku', 'lb_item_status', 'lb_vendor_code', 'item_id'))
157
  ->addFieldToFilter('item_order_id',array('eq'=>$order->getId()))
158
  ->addFieldToFilter('item_id', array('eq'=>$productItems['item_id']))
189
  if(!$status){
190
  $status = Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_SENT_TO_SUPPLIER;
191
  }
192
+ if($itemIdArr && in_array(ucfirst($status),Mage::helper('dropship360')->getItemStatuses())){
193
  foreach($itemIdArr as $itemId){
194
  $result = $this->saveLbStatus($itemId, $status);
195
  }
208
  * @return bool
209
  */
210
  protected function saveLbStatus($itemId, $status){
211
+ $lbStatus = Mage::getModel('dropship360/orderitems')->load($itemId, 'item_id');
212
  $orderCollection = Mage::getModel('sales/order')->load($lbStatus->getItemOrderId());
213
  $orderStatus = $orderCollection->getStatus();
214
+ $itemStatusHistory = Mage::helper('dropship360')->getSerialisedData($lbStatus, ucfirst($status), $orderStatus);
215
  if($lbStatus->getId()){
216
  $lbStatus->setLbItemStatus(ucfirst($status))
217
  ->setUpdatedBy('logicbroker')
218
  ->setItemStatusHistory($itemStatusHistory)
219
  ->setUpdatedAt(Mage::getModel('core/date')->gmtDate())
220
  ->save();
221
+ Mage::helper('dropship360')->genrateLog(0,'API Item Update started','API Item Update ended','Item Status updated by Logicbroker API item-status->'.$status.' ,sku->'.$lbStatus->getSku().' ,orderId->'.$lbStatus->getItemOrderId());
222
  return true;
223
  }
224
  }
239
  $orderItemsdDetails = array();
240
  try{
241
 
242
+ $orderCollection = Mage::getModel('dropship360/orderitems')->getCollection();
243
  $orderCollection->addFieldToFilter('lb_item_status',$orderItemStatus);
244
  $orderCollection->getSelect()->join(array('salesOrder'=>Mage::getSingleton('core/resource')->getTableName('sales/order')),
245
  'salesOrder.entity_id = main_table.item_order_id', array('increment_id','store_id'))->where('store_id = ?', (int)$store_id);
271
  $itemId = array();
272
  $itemOrderId = $order->getEntityId();
273
  $result = false;
274
+ $orderCollection = Mage::getModel('dropship360/orderitems')->getCollection();
275
  $orderCollection->addFieldToFilter('lb_item_status','Transmitting');
276
  $orderCollection->addFieldToFilter('item_order_id',$itemOrderId);
277
 
290
  $itemStatus = Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_SENT_TO_SUPPLIER;
291
  }
292
 
293
+ if(!empty($itemId) && in_array(ucfirst($itemStatus),Mage::helper('dropship360')->getItemStatuses())){
294
  foreach($itemId as $itemId){
295
  $result = $this->saveLbStatus($itemId, $itemStatus);
296
  }
app/code/community/Logicbroker/Dropship360/Model/Orderitems.php CHANGED
@@ -10,7 +10,7 @@
10
  class Logicbroker_Dropship360_Model_Orderitems extends Mage_Core_Model_Abstract
11
  {
12
  protected function _construct(){
13
- $this->_init("logicbroker/orderitems");
14
  }
15
 
16
  public function prepareOrderItemData($item){
@@ -23,8 +23,8 @@ class Logicbroker_Dropship360_Model_Orderitems extends Mage_Core_Model_Abstract
23
  else
24
  $orderBy = 'cost ASC';
25
 
26
- $collectionVendor = Mage::getModel ( 'logicbroker/inventory' )->getCollection ()->addFieldToFilter ( 'product_sku', $productSku );
27
- $collectionVendor->getSelect ()->joinleft ( array ('lbRanking' => Mage::getSingleton ( 'core/resource' )->getTableName ( 'logicbroker/ranking' )), 'lbRanking.lb_vendor_code = main_table.lb_vendor_code', array ('*') )->where('lbRanking.is_dropship = "yes" and lbRanking.is_active = "yes"');
28
  $collectionVendor->getSelect ()->order ( $orderBy );
29
  return $collectionVendor;
30
  }
@@ -32,7 +32,7 @@ class Logicbroker_Dropship360_Model_Orderitems extends Mage_Core_Model_Abstract
32
 
33
  public function isVendorCollectionAvailable()
34
  {
35
- if (Mage::getModel ( 'logicbroker/inventory' )->getCollection ()->count() > 0 )
36
  return true;
37
  else
38
  return false;
@@ -56,13 +56,13 @@ class Logicbroker_Dropship360_Model_Orderitems extends Mage_Core_Model_Abstract
56
  try {
57
  $orderItemInstance->save ();
58
  } catch ( Exception $e ) {
59
- Mage::helper('logicbroker')->genrateLog(0,null,null,'Section :Error In Setting order item data: '.$e->getMessage().' sku : '.$item->getSku().','.$item->getOrderId ());
60
  echo $e->getMessage ();
61
  }
62
  }
63
  public function updateLbVendorInvenory($vendorCode,$productSku,$qtyInvoiced)
64
  {
65
- $inventory = Mage::getModel ( 'logicbroker/inventory' )->getCollection()
66
  ->addFieldToFilter('lb_vendor_code',$vendorCode)->addFieldToFilter('product_sku',$productSku);
67
  $filedData = $inventory->getFirstItem()->getData();
68
  $LbInventoryStock = $filedData['stock'];
@@ -70,7 +70,7 @@ class Logicbroker_Dropship360_Model_Orderitems extends Mage_Core_Model_Abstract
70
  $inventory->getFirstItem()->setStock ( ($finalStock > 0) ? $finalStock : 0 );
71
  try {
72
  $inventory->getFirstItem()->save ();
73
- Mage::getModel('logicbroker/inventory')->_saveInventoryLog('update',array('lb_vendor_name'=>$filedData['lb_vendor_name'],'updated_by'=>'system','product_sku'=>$productSku,'lb_vendor_code'=>$vendorCode,'cost'=>$filedData['cost'],'stock'=>($finalStock > 0) ? $finalStock : 0));
74
  } catch ( Exception $e ) {
75
  echo $e->getMessage ();
76
  }
@@ -79,7 +79,7 @@ class Logicbroker_Dropship360_Model_Orderitems extends Mage_Core_Model_Abstract
79
  public function updateSourcingByUser($request)
80
  {
81
  $arrData = array();
82
- $inventoryModel = Mage::getModel('logicbroker/inventory')->getCollection()->addFieldToFilter('lb_vendor_code',$request['lb_vendor_code'])->addFieldToFilter('product_sku',$request['product_sku']);
83
  $arrData['lb_vendor_code'] = $request['lb_vendor_code'];
84
  $arrData['lb_item_status'] = Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_TRANSMITTING;
85
  $arrData['updated_by'] = 'User';
10
  class Logicbroker_Dropship360_Model_Orderitems extends Mage_Core_Model_Abstract
11
  {
12
  protected function _construct(){
13
+ $this->_init("dropship360/orderitems");
14
  }
15
 
16
  public function prepareOrderItemData($item){
23
  else
24
  $orderBy = 'cost ASC';
25
 
26
+ $collectionVendor = Mage::getModel ( 'dropship360/inventory' )->getCollection ()->addFieldToFilter ( 'product_sku', $productSku );
27
+ $collectionVendor->getSelect ()->joinleft ( array ('lbRanking' => Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship360/ranking' )), 'lbRanking.lb_vendor_code = main_table.lb_vendor_code', array ('*') )->where('lbRanking.is_dropship = "yes" and lbRanking.is_active = "yes"');
28
  $collectionVendor->getSelect ()->order ( $orderBy );
29
  return $collectionVendor;
30
  }
32
 
33
  public function isVendorCollectionAvailable()
34
  {
35
+ if (Mage::getModel ( 'dropship360/inventory' )->getCollection ()->count() > 0 )
36
  return true;
37
  else
38
  return false;
56
  try {
57
  $orderItemInstance->save ();
58
  } catch ( Exception $e ) {
59
+ Mage::helper('dropship360')->genrateLog(0,null,null,'Section :Error In Setting order item data: '.$e->getMessage().' sku : '.$item->getSku().','.$item->getOrderId ());
60
  echo $e->getMessage ();
61
  }
62
  }
63
  public function updateLbVendorInvenory($vendorCode,$productSku,$qtyInvoiced)
64
  {
65
+ $inventory = Mage::getModel ( 'dropship360/inventory' )->getCollection()
66
  ->addFieldToFilter('lb_vendor_code',$vendorCode)->addFieldToFilter('product_sku',$productSku);
67
  $filedData = $inventory->getFirstItem()->getData();
68
  $LbInventoryStock = $filedData['stock'];
70
  $inventory->getFirstItem()->setStock ( ($finalStock > 0) ? $finalStock : 0 );
71
  try {
72
  $inventory->getFirstItem()->save ();
73
+ Mage::getModel('dropship360/inventory')->_saveInventoryLog('update',array('lb_vendor_name'=>$filedData['lb_vendor_name'],'updated_by'=>'system','product_sku'=>$productSku,'lb_vendor_code'=>$vendorCode,'cost'=>$filedData['cost'],'stock'=>($finalStock > 0) ? $finalStock : 0));
74
  } catch ( Exception $e ) {
75
  echo $e->getMessage ();
76
  }
79
  public function updateSourcingByUser($request)
80
  {
81
  $arrData = array();
82
+ $inventoryModel = Mage::getModel('dropship360/inventory')->getCollection()->addFieldToFilter('lb_vendor_code',$request['lb_vendor_code'])->addFieldToFilter('product_sku',$request['product_sku']);
83
  $arrData['lb_vendor_code'] = $request['lb_vendor_code'];
84
  $arrData['lb_item_status'] = Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_TRANSMITTING;
85
  $arrData['updated_by'] = 'User';
app/code/community/Logicbroker/Dropship360/Model/Ordersourcing.php CHANGED
@@ -9,23 +9,82 @@
9
 
10
  class Logicbroker_Dropship360_Model_Ordersourcing extends Mage_Core_Model_Abstract
11
  {
12
- protected function _construct()
13
- {
14
- $this->_init("logicbroker/ordersourcing");
 
 
 
 
15
  }
16
-
17
- public function prepareOrderCollection($crontype)
18
- {
19
- $processingOrders = Mage::getModel('sales/order')->getCollection()->addFieldToFilter('status',$crontype);
20
- $processingOrders->getSelect()->limit('20');
21
- return $processingOrders;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  }
23
- public function prepareItemCollection($crontype)
24
  {
25
- $processingItem = Mage::getModel('logicbroker/orderitems')->getCollection()->addFieldToFilter('lb_item_status',$crontype);
26
- $processingItem->getSelect()->limit('20');
27
- return $processingItem;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  }
29
-
30
- }
31
-
9
 
10
  class Logicbroker_Dropship360_Model_Ordersourcing extends Mage_Core_Model_Abstract
11
  {
12
+ protected $_pathSourcingStart = 'logicbroker/sourcing_cron/start_time';
13
+ protected $_pathSourcingComp = 'logicbroker/sourcing_cron/comp_time';
14
+ protected $_pathBackorderStart = 'logicbroker/backorder_cron/start_time';
15
+ protected $_pathBackorderComp = 'logicbroker/backorder_cron/comp_time';
16
+ protected $_waitTIme = 30; //min
17
+ protected function _construct(){
18
+ $this->_init("dropship360/ordersourcing");
19
  }
20
+ public function prepareItemCollection($crontype,$isCronSourcing = false){
21
+ $orderItemColletion = array();
22
+ $rowObj = new Varien_Object();
23
+ $condition = ($isCronSourcing) ? array($crontype,Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_SOURCING) : array($crontype);
24
+ //$orders = $this->getOrderForProcess($condition);
25
+ $processingItem = Mage::getModel('dropship360/orderitems')->getCollection();
26
+ $processingItem->getSelect()->join(array('salesOrder'=>Mage::getSingleton('core/resource')->getTableName('sales/order')),'salesOrder.entity_id = main_table.item_order_id',array('state'));
27
+ $processingItem->addFieldToFilter('state','processing');
28
+ $processingItem->addFieldToFilter('lb_item_status',array('in'=>$condition));
29
+ if($processingItem->getSize() > 0){
30
+ foreach ($processingItem as $item){
31
+ $var = array (
32
+ 'id' => $item->getId (),
33
+ 'item_id' => $item->getItemId (),
34
+ 'item_order_id' => $item->getItemOrderId (),
35
+ 'sku' => $item->getSku (),
36
+ 'lb_vendor_sku' => $item->getLbVendorSku (),
37
+ 'vendor_cost' => $item->getVendorCost (),
38
+ 'lb_item_status' => $item->getLbItemStatus (),
39
+ 'lb_vendor_code' => $item->getLbVendorCode (),
40
+ 'updated_by' => $item->getUpdatedBy (),
41
+ 'item_status_history' => $item->getItemStatusHistory (),
42
+ 'updated_at' => $item->getUpdatedAt ()
43
+ );
44
+ $rowObj = new Varien_Object();
45
+ $orderItemColletion[$item->getItemOrderId()][] = $rowObj->setData($var);
46
+ }
47
+ }
48
+ return $orderItemColletion;
49
+ }
50
+ protected function getOrderForProcess($condition){
51
+ $orderIds = array();
52
+ $processingItem = Mage::getModel('dropship360/orderitems')->getCollection();
53
+ $processingItem->getSelect()->join(array('salesOrder'=>Mage::getSingleton('core/resource')->getTableName('sales/order')),'salesOrder.entity_id = main_table.item_order_id',array('state'));
54
+ $processingItem->addFieldToFilter('state','processing');
55
+ $processingItem->addFieldToFilter('lb_item_status',array('in'=>$condition));
56
+ $processingItem->getSelect()->group('item_order_id');
57
+ //$processingItem->getSelect()->limit('200');
58
+ $processingItem->getSelect()->order('id asc');
59
+ if($processingItem->getSize() > 0){
60
+ foreach ($processingItem as $item){
61
+ $orderIds[] = $item->getItemOrderId();
62
+ }
63
+ }
64
+ return $orderIds;
65
  }
66
+ public function checkRunningStatus($type)
67
  {
68
+ $path = ($type == Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_BACKORDER) ? $this->_pathBackorderStart : $this->_pathSourcingStart;
69
+ if(!Mage::getStoreConfigFlag($path)){
70
+ return false;//job not running
71
+ }
72
+ $now = time() - ($this->_waitTIme * 60);
73
+ $time = strtotime(Mage::getStoreConfig($path));
74
+ /*if ($time < $now) {
75
+ return false;//insert forcefully
76
+ }*/
77
+ return true;
78
+ }
79
+ public function sourcingStarted($type){
80
+ $path = ($type == Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_BACKORDER) ? $this->_pathBackorderStart : $this->_pathSourcingStart;
81
+ $value = strftime('%Y-%m-%d %H:%M:00', time());
82
+ Mage::getResourceModel('dropship360/ordersourcing')->saveConfig($path, $value);
83
+ }
84
+ public function sourcingCompleted($type){
85
+ //$path = ($type == 'backorder') ? $this->_pathBackorderComp : $this->_pathSourcingComp;
86
+ $path = ($type == Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_BACKORDER) ? $this->_pathBackorderStart : $this->_pathSourcingStart;
87
+ $value = '';//strftime('%Y-%m-%d %H:%M:00', time());
88
+ Mage::getResourceModel('dropship360/ordersourcing')->saveConfig($path, $value);
89
  }
90
+ }
 
 
app/code/community/Logicbroker/Dropship360/Model/Ranking.php CHANGED
@@ -11,11 +11,11 @@ class Logicbroker_Dropship360_Model_Ranking extends Mage_Core_Model_Abstract
11
  {
12
  protected function _construct(){
13
 
14
- $this->_init("logicbroker/ranking");
15
  }
16
  public function rearrangeRank($value, $rank){
17
  if($rank > 0 && $rank < $value->getRanking() ){
18
- $rankData = Mage::getModel('logicbroker/ranking')->load($value->getId());
19
  $rankData->setRanking($rank);
20
  $rankData->save();
21
  $rank++;
@@ -29,7 +29,7 @@ class Logicbroker_Dropship360_Model_Ranking extends Mage_Core_Model_Abstract
29
  $arrVendor = array();
30
  if($vendorCollection->count() > 0 ){
31
  foreach ($vendorCollection as $vendor) {
32
- $arrVendor[] = array('name'=>$vendor->getLbVendorName(),'code'=>$vendor->getLbVendorCode());
33
  }
34
  }
35
  return $arrVendor;
@@ -49,7 +49,7 @@ class Logicbroker_Dropship360_Model_Ranking extends Mage_Core_Model_Abstract
49
  }
50
 
51
  protected function saveVendorDetails($value){
52
- $vendorDetail = Mage::getModel('logicbroker/ranking')->load($value['lb_vendor_code'],'lb_vendor_code');
53
  if(!$vendorDetail->getId()){
54
  $vendorDetail->setLbVendorCode($value['lb_vendor_code']);
55
  $vendorDetail->setLbVendorName($value['lb_vendor_name']);
11
  {
12
  protected function _construct(){
13
 
14
+ $this->_init("dropship360/ranking");
15
  }
16
  public function rearrangeRank($value, $rank){
17
  if($rank > 0 && $rank < $value->getRanking() ){
18
+ $rankData = Mage::getModel('dropship360/ranking')->load($value->getId());
19
  $rankData->setRanking($rank);
20
  $rankData->save();
21
  $rank++;
29
  $arrVendor = array();
30
  if($vendorCollection->count() > 0 ){
31
  foreach ($vendorCollection as $vendor) {
32
+ $arrVendor[] = array('name'=>$vendor->getLbVendorName(),'code'=>$vendor->getLbVendorCode(),'link'=>is_null($vendor->getLinkingAttribute()) ? '' : $vendor->getLinkingAttribute());
33
  }
34
  }
35
  return $arrVendor;
49
  }
50
 
51
  protected function saveVendorDetails($value){
52
+ $vendorDetail = Mage::getModel('dropship360/ranking')->load($value['lb_vendor_code'],'lb_vendor_code');
53
  if(!$vendorDetail->getId()){
54
  $vendorDetail->setLbVendorCode($value['lb_vendor_code']);
55
  $vendorDetail->setLbVendorName($value['lb_vendor_name']);
app/code/community/Logicbroker/Dropship360/Model/Rankinglog.php CHANGED
@@ -11,7 +11,7 @@ class Logicbroker_Dropship360_Model_Rankinglog extends Mage_Core_Model_Abstract
11
  {
12
  protected function _construct(){
13
 
14
- $this->_init("logicbroker/Rankinglog");
15
  }
16
 
17
  }
11
  {
12
  protected function _construct(){
13
 
14
+ $this->_init("dropship360/Rankinglog");
15
  }
16
 
17
  }
app/code/community/Logicbroker/Dropship360/Model/Report.php CHANGED
@@ -106,7 +106,7 @@ class Logicbroker_Dropship360_Model_Report
106
 
107
  protected function genrateQueryInput($data){
108
 
109
- $this->_queryInput = array('dropshipStatus'=> $data['dropshipstatus'],'monitor_order'=> $data['input_monitor_order_post'],'open_monitor'=> $data['input_open_monitor_post']);
110
  return $this->_queryInput;
111
  }
112
 
@@ -129,7 +129,7 @@ class Logicbroker_Dropship360_Model_Report
129
  $collectionLbItem = $this->getOrderItemsCollection($open_monitor_from,$open_monitor_to,$orderId,$queryInputs['dropshipStatus']);
130
 
131
  $collectionLbItem->getSelect()->joinleft(array('salesOrder'=>Mage::getSingleton('core/resource')->getTableName('sales/order')),'salesOrder.entity_id = main_table.item_order_id', array('increment_id'));
132
- $collectionLbItem->getSelect()->joinleft(array('lbRanking'=>Mage::getSingleton('core/resource')->getTableName('logicbroker/ranking')),'lbRanking.lb_vendor_code = main_table.lb_vendor_code', array('lb_vendor_name'));
133
  $collectionLbItem->getSelect()->joinLeft(array('prod' => Mage::getSingleton('core/resource')->getTableName('catalog/product')),'prod.sku = main_table.sku',array('magento_pro_id'=>'entity_id'));
134
  $collectionLbItem->getSelect()->joinLeft(array('cpev' => Mage::getSingleton('core/resource')->getTableName('catalog/product').'_varchar'),'cpev.entity_id=prod.entity_id AND cpev.attribute_id='.$prodNameAttrId.'',array('product_name' => 'value'));
135
  $collectionLbItem->setOrder('updated_at', 'desc');
@@ -143,9 +143,10 @@ class Logicbroker_Dropship360_Model_Report
143
  return $this;
144
  }
145
 
 
146
  protected function getOrderItemsCollection($open_monitor_from = null,$open_monitor_to =null,$orderId,$status =null,$includeTime = true)
147
  {
148
- $collectionLbItem = Mage::getModel('logicbroker/orderitems')->getCollection()->addFieldTofilter('item_order_id ', array('in' => $orderId));
149
 
150
  if(!empty($status))
151
  {
@@ -187,65 +188,73 @@ class Logicbroker_Dropship360_Model_Report
187
  return $this;
188
  }
189
 
 
190
  $reportData = $this->getActivityReportData();
 
191
  $otherStatus = $this->calculateNotificationForOtherStatus($reportData);
192
- $helper = Mage::helper('logicbroker');
193
- foreach($otherStatus as $key=>$status){
194
- $reportData['dropshipstatus'] = $key;
195
- $reportData['notificationPer'] = $status;
196
- if($key == $helper::LOGICBROKER_ITEM_STATUS_TRANSMITTING){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
197
  if(!empty($reportData['notification_transmitting']))
198
- ($status >= $reportData['notification_transmitting']) ? $this->sendEmail($reportData) : '';
199
- }
200
- if($key == $helper::LOGICBROKER_ITEM_STATUS_BACKORDER){
201
- if(!empty($reportData['notification_backorder']))
202
- ($status >= $reportData['notification_backorder']) ? $this->sendEmail($reportData) : '';
203
- }
204
- if($key == $helper::LOGICBROKER_ITEM_STATUS_SENT_TO_SUPPLIER){
205
  if(!empty( $reportData['notification_sent_to_supplier']))
206
- ($status >= $reportData['notification_sent_to_supplier']) ? $this->sendEmail($reportData) : '';
207
- }
208
  }
209
- return;
210
  }
211
 
212
-
213
  protected function sendEmail($reportData){
214
 
215
  try {
216
-
217
- $reportData['isnewreg'] = false;
218
- $reportData['emailbody'] = $reportData['dropshipstatus']. ' Status has reached '.$reportData['notificationPer']. '%';
219
- $postObject = new Varien_Object();
220
- $postObject->setData($reportData);
221
- $mailTemplate = Mage::getModel('core/email_template');
222
-
223
- /* @var $mailTemplate Mage_Core_Model_Email_Template */
224
- $mailTemplate->setDesignConfig(array('area' => 'frontend'));
225
- $emails = explode(',',$reportData['email']);
226
-
227
- foreach($emails as $email)
 
 
 
 
 
 
228
  {
229
- $name = explode('@',$email);
230
- $mailTemplate->sendTransactional(
231
- 'logicbroker_email_email_template',
232
- 'general',
233
- $email,
234
- $name[0],
235
- array('templatevar' => $postObject)
236
- );
237
- }
238
- if (!$mailTemplate->getSentSuccess()) {
239
- Mage::helper('logicbroker')->genrateLog(0,'Installation notification started','Installation notification ended','Module installation notifiaction mail sending failed');
240
- return false;
241
-
242
  }
243
-
244
  return true;
245
  } catch (Exception $e) {
246
  return false;
247
  }
248
-
249
  }
250
 
251
  protected function calculateNotificationForOtherStatus($reportData){
@@ -253,22 +262,56 @@ class Logicbroker_Dropship360_Model_Report
253
  $queryInputs = $this->genrateQueryInput($reportData);
254
  $orderId = $this->getOrderIds($queryInputs);
255
  $statusPercent = array();
256
-
257
  $timeStringOpenMonitor = $this->getTimePeriod($queryInputs['open_monitor']);
258
- $open_monitor_from = Date('Y-m-d h:i:s', strtotime($timeStringOpenMonitor));
 
 
 
 
 
 
 
 
 
 
 
259
  $open_monitor_to = Mage::getModel('core/date')->gmtDate();
 
 
 
 
 
 
 
 
 
 
260
 
261
- $otherStatus = array('Transmitting','Backorder','Sent to Supplier');
 
 
 
 
 
 
 
 
 
 
 
262
 
263
- foreach($otherStatus as $data){
264
-
265
- $allItemOrder = $this->getOrderItemsCollection(null,null,$orderId,null,false)->getSize();
266
- $allItemWithtime = $this->getOrderItemsCollection($open_monitor_from,$open_monitor_to,$orderId,$data,true)->getSize();
267
- $statusPercent[$data] = round(($allItemWithtime / $allItemOrder) * $this->_percent);
268
-
269
- }
270
 
271
- return $statusPercent;
 
 
 
 
 
 
 
 
272
  }
273
  }
274
 
106
 
107
  protected function genrateQueryInput($data){
108
 
109
+ $this->_queryInput = array('dropshipStatus'=> $data['dropshipstatus'],'monitor_order'=> isset($data['input_monitor_order_post']) ? $data['input_monitor_order_post'] : '0-day','open_monitor'=> isset($data['input_open_monitor_post']) ? $data['input_open_monitor_post'] : '0-day','transmitting_time'=>isset($data['input_transmitting_filter_post']) ? $data['input_transmitting_filter_post'] : '0-day','sts_time'=>(isset($data['input_sentosup_filter_post']) ? $data['input_sentosup_filter_post'] : '0-day'));
110
  return $this->_queryInput;
111
  }
112
 
129
  $collectionLbItem = $this->getOrderItemsCollection($open_monitor_from,$open_monitor_to,$orderId,$queryInputs['dropshipStatus']);
130
 
131
  $collectionLbItem->getSelect()->joinleft(array('salesOrder'=>Mage::getSingleton('core/resource')->getTableName('sales/order')),'salesOrder.entity_id = main_table.item_order_id', array('increment_id'));
132
+ $collectionLbItem->getSelect()->joinleft(array('lbRanking'=>Mage::getSingleton('core/resource')->getTableName('dropship360/ranking')),'lbRanking.lb_vendor_code = main_table.lb_vendor_code', array('lb_vendor_name'));
133
  $collectionLbItem->getSelect()->joinLeft(array('prod' => Mage::getSingleton('core/resource')->getTableName('catalog/product')),'prod.sku = main_table.sku',array('magento_pro_id'=>'entity_id'));
134
  $collectionLbItem->getSelect()->joinLeft(array('cpev' => Mage::getSingleton('core/resource')->getTableName('catalog/product').'_varchar'),'cpev.entity_id=prod.entity_id AND cpev.attribute_id='.$prodNameAttrId.'',array('product_name' => 'value'));
135
  $collectionLbItem->setOrder('updated_at', 'desc');
143
  return $this;
144
  }
145
 
146
+
147
  protected function getOrderItemsCollection($open_monitor_from = null,$open_monitor_to =null,$orderId,$status =null,$includeTime = true)
148
  {
149
+ $collectionLbItem = Mage::getModel('dropship360/orderitems')->getCollection()->addFieldTofilter('item_order_id', array('in' => $orderId));
150
 
151
  if(!empty($status))
152
  {
188
  return $this;
189
  }
190
 
191
+
192
  $reportData = $this->getActivityReportData();
193
+
194
  $otherStatus = $this->calculateNotificationForOtherStatus($reportData);
195
+ $helper = Mage::helper('dropship360');
196
+ foreach($otherStatus['statusPercent'] as $itemStatus=>$percentage){
197
+ $reportData['dropshipstatus'] = $itemStatus;
198
+ $reportData['notificationPer'] = $percentage;
199
+ $reportData['filter'] = false;
200
+ $this->_selectStatus($itemStatus,$reportData,$percentage);
201
+
202
+ }
203
+ if(!empty($reportData['input_transmitting_filter']) || !empty($reportData['input_sentosup_filter']))
204
+ $this->sendStaticStatusMail($otherStatus['orderid'],$otherStatus['queryInput'],$reportData);
205
+ return $this;
206
+ }
207
+
208
+ protected function _selectStatus($itemStatus,$reportData,$perctange)
209
+ {
210
+ $helper = Mage::helper('dropship360');
211
+ switch($itemStatus)
212
+ {
213
+ case $helper::LOGICBROKER_ITEM_STATUS_TRANSMITTING :
214
  if(!empty($reportData['notification_transmitting']))
215
+ ($perctange >= $reportData['notification_transmitting']) ? $this->sendEmail($reportData) : '';
216
+ break;
217
+ case $helper::LOGICBROKER_ITEM_STATUS_BACKORDER :
218
+ if(!empty($reportData['notification_backorder']))
219
+ ($perctange >= $reportData['notification_backorder']) ? $this->sendEmail($reportData) : '';
220
+ break;
221
+ case $helper::LOGICBROKER_ITEM_STATUS_SENT_TO_SUPPLIER:
222
  if(!empty( $reportData['notification_sent_to_supplier']))
223
+ ($perctange >= $reportData['notification_sent_to_supplier']) ? $this->sendEmail($reportData) : '';
224
+ break;
225
  }
 
226
  }
227
 
 
228
  protected function sendEmail($reportData){
229
 
230
  try {
231
+ if($reportData['filter']){
232
+
233
+ $reportData['subject'] = 'dropship360 has overdue orders sitting in '.$reportData['type'].' Status';
234
+ $postObject = new Varien_Object();
235
+ $postObject->setData($reportData);
236
+ //$emails = explode(',',$reportData['email']);
237
+ $templateId = 'logicbroker_activty_report_staticstatus';
238
+
239
+ }else{
240
+ $reportData['isnewreg'] = false;
241
+ $reportData['emailbody'] = $reportData['dropshipstatus']. ' Status has reached '.$reportData['notificationPer']. '%';
242
+ $reportData['subject'] = 'Activity monitor report data';
243
+ $postObject = new Varien_Object();
244
+ $postObject->setData($reportData);
245
+ $templateId = 'logicbroker_email_email_template';
246
+ }
247
+ $emails = explode(',',$reportData['email']);
248
+ foreach($emails as $email)
249
  {
250
+ $isMailSent = Mage::helper('dropship360')->sendMail($postObject,$email,$templateId);
251
+ if(!$isMailSent)
252
+ Mage::log('Activity report email not sent to :'.$email, null, 'logicbroker_debug.log');
 
 
 
 
 
 
 
 
 
 
253
  }
 
254
  return true;
255
  } catch (Exception $e) {
256
  return false;
257
  }
 
258
  }
259
 
260
  protected function calculateNotificationForOtherStatus($reportData){
262
  $queryInputs = $this->genrateQueryInput($reportData);
263
  $orderId = $this->getOrderIds($queryInputs);
264
  $statusPercent = array();
265
+ $helper = Mage::helper('dropship360');
266
  $timeStringOpenMonitor = $this->getTimePeriod($queryInputs['open_monitor']);
267
+ $otherStatus = array($helper::LOGICBROKER_ITEM_STATUS_TRANSMITTING,$helper::LOGICBROKER_ITEM_STATUS_BACKORDER,$helper::LOGICBROKER_ITEM_STATUS_SENT_TO_SUPPLIER);
268
+
269
+ foreach($otherStatus as $statusType){
270
+ $statusPercent[$statusType] = $this->calculatePer($orderId,$statusType,$timeStringOpenMonitor);
271
+ }
272
+
273
+ return array('statusPercent'=>$statusPercent,'queryInput'=>$queryInputs,'orderid'=>$orderId);
274
+ }
275
+
276
+ protected function calculatePer($orderId,$statusType,$openMonitorTime){
277
+
278
+ $open_monitor_from = Date('Y-m-d h:i:s', strtotime($openMonitorTime));
279
  $open_monitor_to = Mage::getModel('core/date')->gmtDate();
280
+ $allItemOrder = $this->getOrderItemsCollection(null,null,$orderId,null,false)->getSize();
281
+ $allItemWithtime = $this->getOrderItemsCollection($open_monitor_from,$open_monitor_to,$orderId,$statusType,true)->getSize();
282
+ return round(($allItemWithtime / $allItemOrder) * $this->_percent);
283
+ }
284
+
285
+ protected function sendStaticStatusMail($orderId,$queryInputs,$reportData)
286
+ {
287
+ $helper = Mage::helper('dropship360');
288
+ $this->generateMailData($reportData,$orderId,$this->getTimePeriod($queryInputs['transmitting_time']),$helper::LOGICBROKER_ITEM_STATUS_TRANSMITTING);
289
+ $this->generateMailData($reportData,$orderId,$this->getTimePeriod($queryInputs['sts_time']),$helper::LOGICBROKER_ITEM_STATUS_SENT_TO_SUPPLIER);
290
 
291
+ }
292
+
293
+ protected function generateMailData($reportData,$orderId,$time,$statusType)
294
+ {
295
+ $open_monitor_from = Date('Y-m-d h:i:s', strtotime($time));
296
+ $open_monitor_to = Mage::getModel('core/date')->gmtDate();
297
+ $reportData['itemOject'] = $this->prepareMailGridData($this->getOrderItemsCollection($open_monitor_from,$open_monitor_to,$orderId,$statusType,true));
298
+ $percentage = $this->calculatePer($orderId,$statusType,$time);
299
+ $reportData['filter'] = true;
300
+ $reportData['type'] = $statusType;
301
+ $reportData['canshow'] = ($statusType == 'Transmitting') ? true : false;
302
+ $this->_selectStatus($statusType,$reportData,$percentage);
303
 
304
+ }
 
 
 
 
 
 
305
 
306
+ protected function prepareMailGridData($collectionLbItem){
307
+ $entityTypeId = Mage::getModel ( 'eav/config' )->getEntityType ( 'catalog_product' )->getEntityTypeId ();
308
+ $prodNameAttrId = Mage::getModel('eav/entity_attribute')->loadByCode($entityTypeId, 'name')->getAttributeId();
309
+ $collectionLbItem->getSelect()->joinleft(array('salesOrder'=>Mage::getSingleton('core/resource')->getTableName('sales/order')),'salesOrder.entity_id = main_table.item_order_id', array('increment_id'));
310
+ $collectionLbItem->getSelect()->joinleft(array('lbRanking'=>Mage::getSingleton('core/resource')->getTableName('dropship360/ranking')),'lbRanking.lb_vendor_code = main_table.lb_vendor_code', array('lb_vendor_name'));
311
+ $collectionLbItem->getSelect()->joinLeft(array('prod' => Mage::getSingleton('core/resource')->getTableName('catalog/product')),'prod.sku = main_table.sku',array('magento_pro_id'=>'entity_id'));
312
+ $collectionLbItem->getSelect()->joinLeft(array('cpev' => Mage::getSingleton('core/resource')->getTableName('catalog/product').'_varchar'),'cpev.entity_id=prod.entity_id AND cpev.attribute_id='.$prodNameAttrId.'',array('product_name' => 'value'));
313
+ $collectionLbItem->setOrder('updated_at', 'desc');
314
+ return $collectionLbItem;
315
  }
316
  }
317
 
app/code/community/Logicbroker/Dropship360/Model/Resource/Inventory.php CHANGED
@@ -11,6 +11,6 @@ class Logicbroker_Dropship360_Model_Resource_Inventory extends Mage_Core_Model_M
11
  {
12
  protected function _construct()
13
  {
14
- $this->_init("logicbroker/inventory", "id");
15
  }
16
  }
11
  {
12
  protected function _construct()
13
  {
14
+ $this->_init("dropship360/inventory", "id");
15
  }
16
  }
app/code/community/Logicbroker/Dropship360/Model/Resource/Inventory/Collection.php CHANGED
@@ -11,7 +11,7 @@
11
  {
12
 
13
  public function _construct(){
14
- $this->_init("logicbroker/inventory");
15
  }
16
 
17
 
11
  {
12
 
13
  public function _construct(){
14
+ $this->_init("dropship360/inventory");
15
  }
16
 
17
 
app/code/community/Logicbroker/Dropship360/Model/Resource/Inventorylog.php CHANGED
@@ -11,6 +11,6 @@ class Logicbroker_Dropship360_Model_Resource_Inventorylog extends Mage_Core_Mode
11
  {
12
  protected function _construct()
13
  {
14
- $this->_init("logicbroker/inventorylog", "id");
15
  }
16
  }
11
  {
12
  protected function _construct()
13
  {
14
+ $this->_init("dropship360/inventorylog", "id");
15
  }
16
  }
app/code/community/Logicbroker/Dropship360/Model/Resource/Inventorylog/Collection.php CHANGED
@@ -11,7 +11,7 @@
11
  {
12
 
13
  public function _construct(){
14
- $this->_init("logicbroker/inventorylog");
15
  }
16
 
17
 
11
  {
12
 
13
  public function _construct(){
14
+ $this->_init("dropship360/inventorylog");
15
  }
16
 
17
 
app/code/community/Logicbroker/Dropship360/Model/Resource/Orderitems.php CHANGED
@@ -11,6 +11,48 @@ class Logicbroker_Dropship360_Model_Resource_Orderitems extends Mage_Core_Model_
11
  {
12
  protected function _construct()
13
  {
14
- $this->_init("logicbroker/orderitems", "id");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  }
16
  }
11
  {
12
  protected function _construct()
13
  {
14
+ $this->_init("dropship360/orderitems", "id");
15
+ }
16
+ public function saveOrderItems($itemData,$orderObj,$crontype)
17
+ {
18
+ try {
19
+ $adapter = $this->_getWriteAdapter();
20
+ $adapter->beginTransaction();
21
+ foreach ($itemData as $key => $item) {
22
+ $condition = array(
23
+ 'item_id = ?' => (int) $key,
24
+ );
25
+ unset($item['updateInventory']);
26
+ unset($item['qtyInvoiced']);
27
+ $adapter->update($this->getMainTable(),$item,$condition);
28
+ }
29
+ $adapter->commit();
30
+ foreach ($itemData as $key => $item) {
31
+ if($item ['updateInventory'])
32
+ Mage::getModel ( 'dropship360/orderitems' )->updateLbVendorInvenory ( $item['lb_vendor_code'],$item['sku'], $item['qtyInvoiced']);
33
+ if ($item['lb_item_status'] == Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_TRANSMITTING)
34
+ Mage::getModel('dropship360/logicbroker')->setupNotification();;
35
+ $this->saveOrderItemsComments($item,$orderObj);
36
+ }
37
+ } catch (Mage_Core_Exception $e) {
38
+ $adapter->rollBack();
39
+ throw $e;
40
+ } catch (Exception $e){
41
+ $adapter->rollBack();
42
+ Mage::logException($e);
43
+ Mage::helper('dropship360')->genrateLog(0,null,null,'Section :Error In saving order item data: '.$e->getMessage().' for orderid : '.$orderObj->getEntityId());
44
+ Mage::getModel('dropship360/ordersourcing')->sourcingCompleted($crontype);
45
+ }
46
+ }
47
+
48
+ protected function saveOrderItemsComments($itemData,$orderObj){
49
+ try {
50
+
51
+ $orderObj->addStatusHistoryComment($itemData['sku'].': Item status changed to '.$itemData['lb_item_status']);
52
+ $orderObj->save();
53
+ } catch (Exception $e) {
54
+ throw $e;
55
+ }
56
+
57
  }
58
  }
app/code/community/Logicbroker/Dropship360/Model/Resource/Orderitems/Collection.php CHANGED
@@ -11,7 +11,7 @@
11
  {
12
 
13
  public function _construct(){
14
- $this->_init("logicbroker/orderitems");
15
  }
16
 
17
 
11
  {
12
 
13
  public function _construct(){
14
+ $this->_init("dropship360/orderitems");
15
  }
16
 
17
 
app/code/community/Logicbroker/Dropship360/Model/Resource/Ordersourcing.php CHANGED
@@ -9,8 +9,44 @@
9
 
10
  class Logicbroker_Dropship360_Model_Resource_Ordersourcing extends Mage_Core_Model_Mysql4_Abstract
11
  {
 
12
  protected function _construct()
13
  {
14
- $this->_init("logicbroker/ordersourcing", "id");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  }
16
  }
9
 
10
  class Logicbroker_Dropship360_Model_Resource_Ordersourcing extends Mage_Core_Model_Mysql4_Abstract
11
  {
12
+
13
  protected function _construct()
14
  {
15
+ $this->_init("dropship360/ordersourcing", "id");
16
+ }
17
+
18
+ public function saveConfig($path, $value, $scope = 'default', $scopeId = 0)
19
+ {
20
+ try {
21
+
22
+ $writeAdapter = $this->_getWriteAdapter();
23
+ $select = $writeAdapter->select()
24
+ ->from( $this->getTable('core/config_data'))
25
+ ->where('path = ?', $path)
26
+ ->where('scope = ?', $scope)
27
+ ->where('scope_id = ?', $scopeId);
28
+ $row = $writeAdapter->fetchRow($select);
29
+
30
+ $newData = array(
31
+ 'scope' => $scope,
32
+ 'scope_id' => $scopeId,
33
+ 'path' => $path,
34
+ 'value' => $value
35
+ );
36
+ $writeAdapter->beginTransaction();
37
+ if ($row) {
38
+ $whereCondition = array('config_id =?' => $row['config_id']);
39
+ $writeAdapter->update($this->getTable('core/config_data'), $newData, $whereCondition);
40
+ } else {
41
+ $writeAdapter->insert($this->getTable('core/config_data'), $newData);
42
+ }
43
+ $writeAdapter->commit();
44
+ } catch (Mage_Core_Exception $e) {
45
+ $writeAdapter->rollBack();
46
+ throw $e;
47
+ } catch (Exception $e){
48
+ $adapter->rollBack();
49
+ Mage::logException($e);
50
+ }
51
  }
52
  }
app/code/community/Logicbroker/Dropship360/Model/Resource/Ordersourcing/Collection.php CHANGED
@@ -11,7 +11,7 @@
11
  {
12
 
13
  public function _construct(){
14
- $this->_init("logicbroker/ordersourcing");
15
  }
16
 
17
 
11
  {
12
 
13
  public function _construct(){
14
+ $this->_init("dropship360/ordersourcing");
15
  }
16
 
17
 
app/code/community/Logicbroker/Dropship360/Model/Resource/Ranking.php CHANGED
@@ -11,6 +11,6 @@ class Logicbroker_Dropship360_Model_Resource_Ranking extends Mage_Core_Model_Mys
11
  {
12
  protected function _construct()
13
  {
14
- $this->_init("logicbroker/ranking", "id");
15
  }
16
  }
11
  {
12
  protected function _construct()
13
  {
14
+ $this->_init("dropship360/ranking", "id");
15
  }
16
  }
app/code/community/Logicbroker/Dropship360/Model/Resource/Ranking/Collection.php CHANGED
@@ -11,7 +11,7 @@
11
  {
12
 
13
  public function _construct(){
14
- $this->_init("logicbroker/ranking");
15
  }
16
 
17
 
11
  {
12
 
13
  public function _construct(){
14
+ $this->_init("dropship360/ranking");
15
  }
16
 
17
 
app/code/community/Logicbroker/Dropship360/Model/Resource/Rankinglog.php CHANGED
@@ -11,6 +11,6 @@ class Logicbroker_Dropship360_Model_Resource_Rankinglog extends Mage_Core_Model_
11
  {
12
  protected function _construct()
13
  {
14
- $this->_init("logicbroker/rankinglog", "id");
15
  }
16
  }
11
  {
12
  protected function _construct()
13
  {
14
+ $this->_init("dropship360/rankinglog", "id");
15
  }
16
  }
app/code/community/Logicbroker/Dropship360/Model/Resource/Rankinglog/Collection.php CHANGED
@@ -11,7 +11,7 @@
11
  {
12
 
13
  public function _construct(){
14
- $this->_init("logicbroker/rankinglog");
15
  }
16
 
17
 
11
  {
12
 
13
  public function _construct(){
14
+ $this->_init("dropship360/rankinglog");
15
  }
16
 
17
 
app/code/community/Logicbroker/Dropship360/Model/Resource/Uploadvendor.php CHANGED
@@ -11,6 +11,6 @@ class Logicbroker_Dropship360_Model_Resource_Uploadvendor extends Mage_Core_Mode
11
  {
12
  protected function _construct()
13
  {
14
- $this->_init("logicbroker/uploadvendor", "file_id");
15
  }
16
  }
11
  {
12
  protected function _construct()
13
  {
14
+ $this->_init("dropship360/uploadvendor", "file_id");
15
  }
16
  }
app/code/community/Logicbroker/Dropship360/Model/Resource/Uploadvendor/Collection.php CHANGED
@@ -11,7 +11,7 @@
11
  {
12
 
13
  public function _construct(){
14
- $this->_init("logicbroker/uploadvendor");
15
  }
16
 
17
 
11
  {
12
 
13
  public function _construct(){
14
+ $this->_init("dropship360/uploadvendor");
15
  }
16
 
17
 
app/code/community/Logicbroker/Dropship360/Model/Resource/Vendorimportlog.php CHANGED
@@ -19,7 +19,7 @@ class Logicbroker_Dropship360_Model_Resource_Vendorimportlog
19
 
20
  public function insertLog($lb_vendor_code = null,$updated_by = null,$success = 0,$failure = 0,$ftp_error =null,$ftp_error_desc = null)
21
  {
22
- $this->_tableVendorImportLog = Mage::getSingleton ( 'core/resource' )->getTableName ( 'logicbroker/vendor_import_log' );
23
  $this->conn = $this->getDatabaseConnection();
24
  $this->conn->beginTransaction ();
25
  $created_at = now();
19
 
20
  public function insertLog($lb_vendor_code = null,$updated_by = null,$success = 0,$failure = 0,$ftp_error =null,$ftp_error_desc = null)
21
  {
22
+ $this->_tableVendorImportLog = Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship360/vendor_import_log' );
23
  $this->conn = $this->getDatabaseConnection();
24
  $this->conn->beginTransaction ();
25
  $created_at = now();
app/code/community/Logicbroker/Dropship360/Model/System/Config/Backend/Oudatedinventory/Email.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+
4
+
5
+ * Logicbroker
6
+ *
7
+ * @category Community
8
+ * @package Logicbroker_Dropship360
9
+ */
10
+ class Logicbroker_Dropship360_Model_System_Config_Backend_Oudatedinventory_Email extends Mage_Core_Model_Config_Data
11
+ {
12
+ const CRON_STRING_PATH = 'crontab/jobs/logicbroker_oudated_product_inventory_cron/schedule/cron_expr';
13
+ const CRON_MODEL_PATH = 'crontab/jobs/logicbroker_oudated_product_inventory_cron/run/model';
14
+
15
+ /**
16
+ * Cron settings after save
17
+ *
18
+ * @return Mage_Adminhtml_Model_System_Config_Backend_Log_Cron
19
+ */
20
+ protected function _afterSave()
21
+ {
22
+ $enabled = $this->getData('groups/inventory_notification/fields/enabled/value');
23
+ $time = $this->getData('groups/inventory_notification/fields/cron_setting/value');
24
+ $cronExprString = '';
25
+ if ($enabled) {
26
+ if($time[0] == -2){
27
+ $cronExprArray = array(
28
+ ($time[1] == -1) ? '*' : '*/'.intval($time[1]),
29
+ '*',
30
+ '*', # Day of the Month
31
+ '*', # Month of the Year
32
+ '*', # Day of the Week
33
+ );
34
+ }else{
35
+ $cronExprArray = array(
36
+ ($time[1] == -1) ? '*' : intval($time[1]), # Minute
37
+ ($time[0] == -1) ? '*' : intval($time[0]), # Hour
38
+ '*', # Day of the Month
39
+ '*', # Month of the Year
40
+ '*', # Day of the Week
41
+ );
42
+ }
43
+ $cronExprString = join(' ', $cronExprArray);
44
+ }
45
+ try {
46
+ Mage::getModel('core/config_data')
47
+ ->load(self::CRON_STRING_PATH, 'path')
48
+ ->setValue($cronExprString)
49
+ ->setPath(self::CRON_STRING_PATH)
50
+ ->save();
51
+
52
+ Mage::getModel('core/config_data')
53
+ ->load(self::CRON_MODEL_PATH, 'path')
54
+ ->setValue((string) Mage::getConfig()->getNode(self::CRON_MODEL_PATH))
55
+ ->setPath(self::CRON_MODEL_PATH)
56
+ ->save();
57
+ } catch (Exception $e) {
58
+ Mage::throwException(Mage::helper('adminhtml')->__('Unable to save the cron expression.'));
59
+ }
60
+ }
61
+ }
app/code/community/Logicbroker/Dropship360/Model/System/Config/Source/Attributecodes.php CHANGED
@@ -12,7 +12,7 @@ class Logicbroker_Dropship360_Model_System_Config_Source_Attributecodes extends
12
  {
13
  public function getAllOptions()
14
  {
15
- $vendorModel = Mage::getModel('logicbroker/ranking')->getCollection();
16
  $options = array();
17
  if($vendorModel->count() > 0 ){
18
  foreach ($vendorModel as $vendor) {
@@ -22,7 +22,7 @@ class Logicbroker_Dropship360_Model_System_Config_Source_Attributecodes extends
22
  );
23
  }
24
  }
25
- array_unshift($options,array('value' => '', 'label' => Mage::helper('logicbroker')->__('--Please Select--'))
26
  );
27
 
28
  if (!$this->_options) {
12
  {
13
  public function getAllOptions()
14
  {
15
+ $vendorModel = Mage::getModel('dropship360/ranking')->getCollection();
16
  $options = array();
17
  if($vendorModel->count() > 0 ){
18
  foreach ($vendorModel as $vendor) {
22
  );
23
  }
24
  }
25
+ array_unshift($options,array('value' => '', 'label' => Mage::helper('dropship360')->__('--Please Select--'))
26
  );
27
 
28
  if (!$this->_options) {
app/code/community/Logicbroker/Dropship360/Model/System/Config/Source/Category.php CHANGED
@@ -24,7 +24,7 @@ class Logicbroker_Dropship360_Model_System_Config_Source_Category
24
  );
25
  }
26
 
27
- array_unshift($options,array('value' => '', 'label' => Mage::helper('logicbroker')->__('--Please Select--'))
28
  );
29
 
30
  return $options;
24
  );
25
  }
26
 
27
+ array_unshift($options,array('value' => '', 'label' => Mage::helper('dropship360')->__('--Please Select--'))
28
  );
29
 
30
  return $options;
app/code/community/Logicbroker/Dropship360/Model/System/Config/Source/Ediqualifier.php CHANGED
@@ -13,45 +13,45 @@ class Logicbroker_Dropship360_Model_System_Config_Source_Ediqualifier {
13
  public function toOptionArray()
14
  {
15
  return array(
16
- array('value' => '', 'label' => Mage::helper('logicbroker')->__('--Please Select--')),
17
- array('value' => Mage::helper('logicbroker')->__('01 Duns (Dun & Bradstreet)'), 'label' => Mage::helper('logicbroker')->__('01 Duns (Dun & Bradstreet)')),
18
- array('value' => Mage::helper('logicbroker')->__('02 SCAC (Standard Carrier Alpha Code)'), 'label' => Mage::helper('logicbroker')->__('02 SCAC (Standard Carrier Alpha Code)')),
19
- array('value' => Mage::helper('logicbroker')->__('03 FMC (Federal Maritime Commission)'), 'label' => Mage::helper('logicbroker')->__('03 FMC (Federal Maritime Commission)')),
20
- array('value' => Mage::helper('logicbroker')->__('04 IATA (International Air Transport Association)'), 'label' => Mage::helper('logicbroker')->__('04 IATA (International Air Transport Association)')),
21
- array('value' => Mage::helper('logicbroker')->__('08 UCC EDI Communications ID (Comm ID)'), 'label' => Mage::helper('logicbroker')->__('08 UCC EDI Communications ID (Comm ID)')),
22
- array('value' => Mage::helper('logicbroker')->__('09 X.121 (CCITT)'), 'label' => Mage::helper('logicbroker')->__('09 X.121 (CCITT)')),
23
- array('value' => Mage::helper('logicbroker')->__('10 Department of Defence (DoD) Activity Address Code'), 'label' => Mage::helper('logicbroker')->__('10 Department of Defence (DoD) Activity Address Code')),
24
- array('value' => Mage::helper('logicbroker')->__('11 DEA (Drug Enforcement Administration)'), 'label' => Mage::helper('logicbroker')->__('11 DEA (Drug Enforcement Administration)')),
25
- array('value' => Mage::helper('logicbroker')->__('12 Phone (Telephone Companies)'), 'label' => Mage::helper('logicbroker')->__('12 Phone (Telephone Companies)')),
26
- array('value' => Mage::helper('logicbroker')->__('13 UCS Code (UCS Code is a Code is Used for UCS Transmissions, it includes the Area Code and Telephone Number of Modem, it Does Not Include Punctuation, Blanks or Access Code )'), 'label' => Mage::helper('logicbroker')->__('13 UCS Code (UCS Code is a Code is Used for UCS Transmissions, it includes the Area Code and Telephone Number of Modem, it Does Not Include Punctuation, Blanks or Access Code )')),
27
- array('value' => Mage::helper('logicbroker')->__('14 Duns Plus Suffix'), 'label' => Mage::helper('logicbroker')->__('14 Duns Plus Suffix')),
28
- array('value' => Mage::helper('logicbroker')->__('15 Petroleum Accountants Society Of Canada Company Code'), 'label' => Mage::helper('logicbroker')->__('15 Petroleum Accountants Society Of Canada Company Code')),
29
- array('value' => Mage::helper('logicbroker')->__('16 Duns Number With 4-Character Suffix'), 'label' => Mage::helper('logicbroker')->__('16 Duns Number With 4-Character Suffix')),
30
- array('value' => Mage::helper('logicbroker')->__('17 American Bankers Association (ABA) Transit Routing Number (Including check digit, 9-digit )'), 'label' => Mage::helper('logicbroker')->__('17 American Bankers Association (ABA) Transit Routing Number (Including check digit, 9-digit )')),
31
- array('value' => Mage::helper('logicbroker')->__('18 Association of American Railroads (AAR) Standard Distribution Code'), 'label' => Mage::helper('logicbroker')->__('18 Association of American Railroads (AAR) Standard Distribution Code')),
32
- array('value' => Mage::helper('logicbroker')->__('19 EDI Council of Australia (EDICA) Communications ID Number (COMM ID)'), 'label' => Mage::helper('logicbroker')->__('19 EDI Council of Australia (EDICA) Communications ID Number (COMM ID)')),
33
- array('value' => Mage::helper('logicbroker')->__('20 Health Industry Number (HIN)'), 'label' => Mage::helper('logicbroker')->__('20 Health Industry Number (HIN)')),
34
- array('value' => Mage::helper('logicbroker')->__('21 Integrated Postsecondary Education Data system, or (IPEDS)'), 'label' => Mage::helper('logicbroker')->__('21 Integrated Postsecondary Education Data system, or (IPEDS)')),
35
- array('value' => Mage::helper('logicbroker')->__('22 Federal Interagency Commision on Education, or FICE'), 'label' => Mage::helper('logicbroker')->__('22 Federal Interagency Commision on Education, or FICE')),
36
- array('value' => Mage::helper('logicbroker')->__('23 National Center for Education Statistics Common Core Of Data 12-Digit Number For Pre-K-Grade 12 Institutes, or NCES'), 'label' => Mage::helper('logicbroker')->__('23 National Center for Education Statistics Common Core Of Data 12-Digit Number For Pre-K-Grade 12 Institutes, or NCES')),
37
- array('value' => Mage::helper('logicbroker')->__('24 The College Board`s Admission Testing Program 4-Digit Code Of Postsecondary Institutes, or ATP'), 'label' => Mage::helper('logicbroker')->__('24 The College Board`s Admission Testing Program 4-Digit Code Of Postsecondary Institutes, or ATP')),
38
- array('value' => Mage::helper('logicbroker')->__('25 American College Testing Program 4-Digit code Of Postsecondary Institutions, or ACT'), 'label' => Mage::helper('logicbroker')->__('25 American College Testing Program 4-Digit code Of Postsecondary Institutions, or ACT')),
39
- array('value' => Mage::helper('logicbroker')->__('26 Statistics of Canada List Of Postsecondary Institutions'), 'label' => Mage::helper('logicbroker')->__('26 Statistics of Canada List Of Postsecondary Institutions')),
40
- array('value' => Mage::helper('logicbroker')->__('27 Carrier Identification Number as assigned by Health Care Financing Administration (HCFA)'), 'label' => Mage::helper('logicbroker')->__('27 Carrier Identification Number as assigned by Health Care Financing Administration (HCFA)')),
41
- array('value' => Mage::helper('logicbroker')->__('28 Fiscal Intermediary Identification Number as assigned by Health Care Financing Administration (HCFA)'), 'label' => Mage::helper('logicbroker')->__('28 Fiscal Intermediary Identification Number as assigned by Health Care Financing Administration (HCFA)')),
42
- array('value' => Mage::helper('logicbroker')->__('29 Medicare Provider and Supplier Identification Number as assigned by Health Care Financing Administration (HCFA)'), 'label' => Mage::helper('logicbroker')->__('29 Medicare Provider and Supplier Identification Number as assigned by Health Care Financing Administration (HCFA)')),
43
- array('value' => Mage::helper('logicbroker')->__('30 U.S. Federal Tax Identification Number'), 'label' => Mage::helper('logicbroker')->__('30 U.S. Federal Tax Identification Number')),
44
- array('value' => Mage::helper('logicbroker')->__('31 Jurisdiction Identification Number Plus 4 as assigned by the International Association Of Industrial Accident Boards and Commissions (IAIABC)'), 'label' => Mage::helper('logicbroker')->__('31 Jurisdiction Identification Number Plus 4 as assigned by the International Association Of Industrial Accident Boards and Commissions (IAIABC)')),
45
- array('value' => Mage::helper('logicbroker')->__('32 U.S. Federal Employer Identification Number (FEIN)'), 'label' => Mage::helper('logicbroker')->__('32 U.S. Federal Employer Identification Number (FEIN)')),
46
- array('value' => Mage::helper('logicbroker')->__('33 National Association Of Insurance Commissioners Company Code (NAIC)'), 'label' => Mage::helper('logicbroker')->__('33 National Association Of Insurance Commissioners Company Code (NAIC)')),
47
- array('value' => Mage::helper('logicbroker')->__('34 Medicaid Provider and Supplier Identification Number as assigned by individual State Medicaid Agencies in conjunction with Health Care Financing Administration (HCFA)'), 'label' => Mage::helper('logicbroker')->__('34 Medicaid Provider and Supplier Identification Number as assigned by individual State Medicaid Agencies in Conjunction with Health Care Financing Administration (HCFA)')),
48
- array('value' => Mage::helper('logicbroker')->__('35 Statistics Canada Canadian College Student Information System Institution Codes'), 'label' => Mage::helper('logicbroker')->__('35 Statistics Canada Canadian College Student Information System Institution Codes')),
49
- array('value' => Mage::helper('logicbroker')->__('36 Statistics Canada University Student Information System Institution codes'), 'label' => Mage::helper('logicbroker')->__('36 Statistics Canada University Student Information System Institution codes')),
50
- array('value' => Mage::helper('logicbroker')->__('37 Society of Property Information Compilers and Analysts'), 'label' => Mage::helper('logicbroker')->__('37 Society of Property Information Compilers and Analysts')),
51
- array('value' => Mage::helper('logicbroker')->__('AM Association Mexicana del Codigo de Producto (AMECOP) Communication ID'), 'label' => Mage::helper('logicbroker')->__('AM Association Mexicana del Codigo de Producto (AMECOP) Communication ID')),
52
- array('value' => Mage::helper('logicbroker')->__('NR National Retail Merchants Association (NRMA) - Assigned'), 'label' => Mage::helper('logicbroker')->__('NR National Retail Merchants Association (NRMA) - Assigned')),
53
- array('value' => Mage::helper('logicbroker')->__('SN Standard Address Number'), 'label' => Mage::helper('logicbroker')->__('SN Standard Address Number')),
54
- array('value' => Mage::helper('logicbroker')->__('ZZ Mutually Defined'), 'label' => Mage::helper('logicbroker')->__('ZZ Mutually Defined')),
55
  );
56
  }
57
 
13
  public function toOptionArray()
14
  {
15
  return array(
16
+ array('value' => '', 'label' => Mage::helper('dropship360')->__('--Please Select--')),
17
+ array('value' => Mage::helper('dropship360')->__('01 Duns (Dun & Bradstreet)'), 'label' => Mage::helper('dropship360')->__('01 Duns (Dun & Bradstreet)')),
18
+ array('value' => Mage::helper('dropship360')->__('02 SCAC (Standard Carrier Alpha Code)'), 'label' => Mage::helper('dropship360')->__('02 SCAC (Standard Carrier Alpha Code)')),
19
+ array('value' => Mage::helper('dropship360')->__('03 FMC (Federal Maritime Commission)'), 'label' => Mage::helper('dropship360')->__('03 FMC (Federal Maritime Commission)')),
20
+ array('value' => Mage::helper('dropship360')->__('04 IATA (International Air Transport Association)'), 'label' => Mage::helper('dropship360')->__('04 IATA (International Air Transport Association)')),
21
+ array('value' => Mage::helper('dropship360')->__('08 UCC EDI Communications ID (Comm ID)'), 'label' => Mage::helper('dropship360')->__('08 UCC EDI Communications ID (Comm ID)')),
22
+ array('value' => Mage::helper('dropship360')->__('09 X.121 (CCITT)'), 'label' => Mage::helper('dropship360')->__('09 X.121 (CCITT)')),
23
+ array('value' => Mage::helper('dropship360')->__('10 Department of Defence (DoD) Activity Address Code'), 'label' => Mage::helper('dropship360')->__('10 Department of Defence (DoD) Activity Address Code')),
24
+ array('value' => Mage::helper('dropship360')->__('11 DEA (Drug Enforcement Administration)'), 'label' => Mage::helper('dropship360')->__('11 DEA (Drug Enforcement Administration)')),
25
+ array('value' => Mage::helper('dropship360')->__('12 Phone (Telephone Companies)'), 'label' => Mage::helper('dropship360')->__('12 Phone (Telephone Companies)')),
26
+ array('value' => Mage::helper('dropship360')->__('13 UCS Code (UCS Code is a Code is Used for UCS Transmissions, it includes the Area Code and Telephone Number of Modem, it Does Not Include Punctuation, Blanks or Access Code )'), 'label' => Mage::helper('dropship360')->__('13 UCS Code (UCS Code is a Code is Used for UCS Transmissions, it includes the Area Code and Telephone Number of Modem, it Does Not Include Punctuation, Blanks or Access Code )')),
27
+ array('value' => Mage::helper('dropship360')->__('14 Duns Plus Suffix'), 'label' => Mage::helper('dropship360')->__('14 Duns Plus Suffix')),
28
+ array('value' => Mage::helper('dropship360')->__('15 Petroleum Accountants Society Of Canada Company Code'), 'label' => Mage::helper('dropship360')->__('15 Petroleum Accountants Society Of Canada Company Code')),
29
+ array('value' => Mage::helper('dropship360')->__('16 Duns Number With 4-Character Suffix'), 'label' => Mage::helper('dropship360')->__('16 Duns Number With 4-Character Suffix')),
30
+ array('value' => Mage::helper('dropship360')->__('17 American Bankers Association (ABA) Transit Routing Number (Including check digit, 9-digit )'), 'label' => Mage::helper('dropship360')->__('17 American Bankers Association (ABA) Transit Routing Number (Including check digit, 9-digit )')),
31
+ array('value' => Mage::helper('dropship360')->__('18 Association of American Railroads (AAR) Standard Distribution Code'), 'label' => Mage::helper('dropship360')->__('18 Association of American Railroads (AAR) Standard Distribution Code')),
32
+ array('value' => Mage::helper('dropship360')->__('19 EDI Council of Australia (EDICA) Communications ID Number (COMM ID)'), 'label' => Mage::helper('dropship360')->__('19 EDI Council of Australia (EDICA) Communications ID Number (COMM ID)')),
33
+ array('value' => Mage::helper('dropship360')->__('20 Health Industry Number (HIN)'), 'label' => Mage::helper('dropship360')->__('20 Health Industry Number (HIN)')),
34
+ array('value' => Mage::helper('dropship360')->__('21 Integrated Postsecondary Education Data system, or (IPEDS)'), 'label' => Mage::helper('dropship360')->__('21 Integrated Postsecondary Education Data system, or (IPEDS)')),
35
+ array('value' => Mage::helper('dropship360')->__('22 Federal Interagency Commision on Education, or FICE'), 'label' => Mage::helper('dropship360')->__('22 Federal Interagency Commision on Education, or FICE')),
36
+ array('value' => Mage::helper('dropship360')->__('23 National Center for Education Statistics Common Core Of Data 12-Digit Number For Pre-K-Grade 12 Institutes, or NCES'), 'label' => Mage::helper('dropship360')->__('23 National Center for Education Statistics Common Core Of Data 12-Digit Number For Pre-K-Grade 12 Institutes, or NCES')),
37
+ array('value' => Mage::helper('dropship360')->__('24 The College Board`s Admission Testing Program 4-Digit Code Of Postsecondary Institutes, or ATP'), 'label' => Mage::helper('dropship360')->__('24 The College Board`s Admission Testing Program 4-Digit Code Of Postsecondary Institutes, or ATP')),
38
+ array('value' => Mage::helper('dropship360')->__('25 American College Testing Program 4-Digit code Of Postsecondary Institutions, or ACT'), 'label' => Mage::helper('dropship360')->__('25 American College Testing Program 4-Digit code Of Postsecondary Institutions, or ACT')),
39
+ array('value' => Mage::helper('dropship360')->__('26 Statistics of Canada List Of Postsecondary Institutions'), 'label' => Mage::helper('dropship360')->__('26 Statistics of Canada List Of Postsecondary Institutions')),
40
+ array('value' => Mage::helper('dropship360')->__('27 Carrier Identification Number as assigned by Health Care Financing Administration (HCFA)'), 'label' => Mage::helper('dropship360')->__('27 Carrier Identification Number as assigned by Health Care Financing Administration (HCFA)')),
41
+ array('value' => Mage::helper('dropship360')->__('28 Fiscal Intermediary Identification Number as assigned by Health Care Financing Administration (HCFA)'), 'label' => Mage::helper('dropship360')->__('28 Fiscal Intermediary Identification Number as assigned by Health Care Financing Administration (HCFA)')),
42
+ array('value' => Mage::helper('dropship360')->__('29 Medicare Provider and Supplier Identification Number as assigned by Health Care Financing Administration (HCFA)'), 'label' => Mage::helper('dropship360')->__('29 Medicare Provider and Supplier Identification Number as assigned by Health Care Financing Administration (HCFA)')),
43
+ array('value' => Mage::helper('dropship360')->__('30 U.S. Federal Tax Identification Number'), 'label' => Mage::helper('dropship360')->__('30 U.S. Federal Tax Identification Number')),
44
+ array('value' => Mage::helper('dropship360')->__('31 Jurisdiction Identification Number Plus 4 as assigned by the International Association Of Industrial Accident Boards and Commissions (IAIABC)'), 'label' => Mage::helper('dropship360')->__('31 Jurisdiction Identification Number Plus 4 as assigned by the International Association Of Industrial Accident Boards and Commissions (IAIABC)')),
45
+ array('value' => Mage::helper('dropship360')->__('32 U.S. Federal Employer Identification Number (FEIN)'), 'label' => Mage::helper('dropship360')->__('32 U.S. Federal Employer Identification Number (FEIN)')),
46
+ array('value' => Mage::helper('dropship360')->__('33 National Association Of Insurance Commissioners Company Code (NAIC)'), 'label' => Mage::helper('dropship360')->__('33 National Association Of Insurance Commissioners Company Code (NAIC)')),
47
+ array('value' => Mage::helper('dropship360')->__('34 Medicaid Provider and Supplier Identification Number as assigned by individual State Medicaid Agencies in conjunction with Health Care Financing Administration (HCFA)'), 'label' => Mage::helper('dropship360')->__('34 Medicaid Provider and Supplier Identification Number as assigned by individual State Medicaid Agencies in Conjunction with Health Care Financing Administration (HCFA)')),
48
+ array('value' => Mage::helper('dropship360')->__('35 Statistics Canada Canadian College Student Information System Institution Codes'), 'label' => Mage::helper('dropship360')->__('35 Statistics Canada Canadian College Student Information System Institution Codes')),
49
+ array('value' => Mage::helper('dropship360')->__('36 Statistics Canada University Student Information System Institution codes'), 'label' => Mage::helper('dropship360')->__('36 Statistics Canada University Student Information System Institution codes')),
50
+ array('value' => Mage::helper('dropship360')->__('37 Society of Property Information Compilers and Analysts'), 'label' => Mage::helper('dropship360')->__('37 Society of Property Information Compilers and Analysts')),
51
+ array('value' => Mage::helper('dropship360')->__('AM Association Mexicana del Codigo de Producto (AMECOP) Communication ID'), 'label' => Mage::helper('dropship360')->__('AM Association Mexicana del Codigo de Producto (AMECOP) Communication ID')),
52
+ array('value' => Mage::helper('dropship360')->__('NR National Retail Merchants Association (NRMA) - Assigned'), 'label' => Mage::helper('dropship360')->__('NR National Retail Merchants Association (NRMA) - Assigned')),
53
+ array('value' => Mage::helper('dropship360')->__('SN Standard Address Number'), 'label' => Mage::helper('dropship360')->__('SN Standard Address Number')),
54
+ array('value' => Mage::helper('dropship360')->__('ZZ Mutually Defined'), 'label' => Mage::helper('dropship360')->__('ZZ Mutually Defined')),
55
  );
56
  }
57
 
app/code/community/Logicbroker/Dropship360/Model/System/Config/Source/Ftptype.php CHANGED
@@ -12,8 +12,8 @@ class Logicbroker_Dropship360_Model_System_Config_Source_Ftptype
12
  {
13
 
14
  return array(
15
- array('value' => '', 'label' => Mage::helper('logicbroker')->__('--Please Select--')),
16
- array('value' => 'ftp', 'label' => Mage::helper('logicbroker')->__('FTP'))
17
  );
18
  }
19
  }
12
  {
13
 
14
  return array(
15
+ array('value' => '', 'label' => Mage::helper('dropship360')->__('--Please Select--')),
16
+ array('value' => 'ftp', 'label' => Mage::helper('dropship360')->__('FTP'))
17
  );
18
  }
19
  }
app/code/community/Logicbroker/Dropship360/Model/System/Config/Source/Optionvalues.php CHANGED
@@ -15,13 +15,13 @@ class Logicbroker_Dropship360_Model_System_Config_Source_Optionvalues {
15
 
16
  $optionsArray = $this->getOptionValue();
17
  if(is_array($optionsArray)){
18
- array_unshift($optionsArray,array('value' => '', 'label' => Mage::helper('logicbroker')->__('--Please Select--')));
19
- array_push($optionsArray,array('value' => 'addnew', 'label' => Mage::helper('logicbroker')->__('Add new code')));
20
  }
21
  else
22
  {
23
- $optionsArray = array(array('value' => '', 'label' => Mage::helper('logicbroker')->__('--Please Select--')),
24
- array('value' => 'addnew', 'label' => Mage::helper('logicbroker')->__('Add new code')));
25
  }
26
  // echo '<pre>';
27
  // print_r($optionsArray);
@@ -33,7 +33,7 @@ class Logicbroker_Dropship360_Model_System_Config_Source_Optionvalues {
33
  public function getOptionValue()
34
  {
35
  $integration = Mage::getStoreConfig('logicbroker_integration/integration/supplier_attribute');
36
- $logicbrokerCollection = Mage::getModel('logicbroker/supplier')->getCollection();
37
  $attributeArray = array();
38
  if($integration != null && $integration)
39
  {
@@ -41,7 +41,7 @@ class Logicbroker_Dropship360_Model_System_Config_Source_Optionvalues {
41
  $options = $attributeDetails->getSource()->getAllOptions(false);
42
  foreach ($options as $option) {
43
 
44
- $attributeArray[] = array('value'=>$option["label"],'label' => Mage::helper('logicbroker')->__(strtolower($option["label"])));
45
  }
46
  }else
47
  {
@@ -50,7 +50,7 @@ class Logicbroker_Dropship360_Model_System_Config_Source_Optionvalues {
50
  $comapnyIds = $logicbrokerCollection->getData();
51
  if (count($comapnyIds) > 0) {
52
  foreach ($comapnyIds as $key=>$value) {
53
- $attributeArray[] = array('value'=>$value['magento_vendor_code'],'label' => Mage::helper('logicbroker')->__(strtolower($value['magento_vendor_code'])));
54
  }
55
  }
56
  }
15
 
16
  $optionsArray = $this->getOptionValue();
17
  if(is_array($optionsArray)){
18
+ array_unshift($optionsArray,array('value' => '', 'label' => Mage::helper('dropship360')->__('--Please Select--')));
19
+ array_push($optionsArray,array('value' => 'addnew', 'label' => Mage::helper('dropship360')->__('Add new code')));
20
  }
21
  else
22
  {
23
+ $optionsArray = array(array('value' => '', 'label' => Mage::helper('dropship360')->__('--Please Select--')),
24
+ array('value' => 'addnew', 'label' => Mage::helper('dropship360')->__('Add new code')));
25
  }
26
  // echo '<pre>';
27
  // print_r($optionsArray);
33
  public function getOptionValue()
34
  {
35
  $integration = Mage::getStoreConfig('logicbroker_integration/integration/supplier_attribute');
36
+ $logicbrokerCollection = Mage::getModel('dropship360/supplier')->getCollection();
37
  $attributeArray = array();
38
  if($integration != null && $integration)
39
  {
41
  $options = $attributeDetails->getSource()->getAllOptions(false);
42
  foreach ($options as $option) {
43
 
44
+ $attributeArray[] = array('value'=>$option["label"],'label' => Mage::helper('dropship360')->__(strtolower($option["label"])));
45
  }
46
  }else
47
  {
50
  $comapnyIds = $logicbrokerCollection->getData();
51
  if (count($comapnyIds) > 0) {
52
  foreach ($comapnyIds as $key=>$value) {
53
+ $attributeArray[] = array('value'=>$value['magento_vendor_code'],'label' => Mage::helper('dropship360')->__(strtolower($value['magento_vendor_code'])));
54
  }
55
  }
56
  }
app/code/community/Logicbroker/Dropship360/Model/System/Config/Source/Ranktype.php CHANGED
@@ -12,9 +12,9 @@ class Logicbroker_Dropship360_Model_System_Config_Source_Ranktype
12
  {
13
 
14
  return array(
15
- array('value' => '', 'label' => Mage::helper('logicbroker')->__('--Please Select--')),
16
- array('value' => 'default', 'label' => Mage::helper('logicbroker')->__('Ranked Based')),
17
- array('value' => 'cost', 'label' => Mage::helper('logicbroker')->__('Cost Based'))
18
 
19
  );
20
  }
12
  {
13
 
14
  return array(
15
+ array('value' => '', 'label' => Mage::helper('dropship360')->__('--Please Select--')),
16
+ array('value' => 'default', 'label' => Mage::helper('dropship360')->__('Ranked Based')),
17
+ array('value' => 'cost', 'label' => Mage::helper('dropship360')->__('Cost Based'))
18
 
19
  );
20
  }
app/code/community/Logicbroker/Dropship360/Model/System/Config/Source/Vendorlist.php CHANGED
@@ -11,11 +11,11 @@ class Logicbroker_Dropship360_Model_System_Config_Source_Vendorlist
11
  public function toOptionArray($addEmpty = true)
12
  {
13
  $options =array();
14
- $collectionVendor = Mage::getModel ( 'logicbroker/inventory' )->getCollection ();
15
 
16
 
17
  $collectionVendor->getSelect ()->joinleft ( array (
18
- 'lbRanking' => Mage::getSingleton ( 'core/resource' )->getTableName ( 'logicbroker/ranking' )
19
  ), 'lbRanking.lb_vendor_code = main_table.lb_vendor_code', array (
20
  '*'
21
  ) )->where('lbRanking.is_dropship = ?','yes');
@@ -29,14 +29,14 @@ class Logicbroker_Dropship360_Model_System_Config_Source_Vendorlist
29
  );
30
  }
31
  }
32
- array_unshift($options,array('value' => '', 'label' => Mage::helper('logicbroker')->__('--Please Select--')),array('value' => 'none', 'label' => Mage::helper('logicbroker')->__('None')));
33
  return $options;
34
  }
35
 
36
  public function vendorList($addEmpty = true,$sku)
37
  {
38
- $vendorModel = Mage::getModel('logicbroker/ranking')->getCollection();
39
- $vendorModel->getSelect ()->where('main_table.lb_vendor_code not in (select lb_vendor_code from '.Mage::getSingleton ( 'core/resource' )->getTableName ( 'logicbroker/inventory' ).' where product_sku = ?)',$sku);
40
  $options = array();
41
  if($vendorModel->count() > 0 ){
42
  foreach ($vendorModel as $vendor) {
@@ -46,7 +46,7 @@ class Logicbroker_Dropship360_Model_System_Config_Source_Vendorlist
46
  );
47
  }
48
  }
49
- array_unshift($options,array('value' => '', 'label' => Mage::helper('logicbroker')->__('--Please Select--'))
50
  );
51
  return $options;
52
  }
@@ -54,9 +54,9 @@ class Logicbroker_Dropship360_Model_System_Config_Source_Vendorlist
54
  public function vendorListSourcing($addEmpty = true,$sku)
55
  {
56
  $options =array();
57
- $collectionVendor = Mage::getModel ( 'logicbroker/inventory' )->getCollection ()->addFieldToFilter('product_sku',$sku);
58
  $collectionVendor->getSelect ()->joinleft ( array (
59
- 'lbRanking' => Mage::getSingleton ( 'core/resource' )->getTableName ( 'logicbroker/ranking' )
60
  ), 'lbRanking.lb_vendor_code = main_table.lb_vendor_code', array (
61
  '*'
62
  ) )->where('lbRanking.is_dropship = ?','yes');
@@ -71,14 +71,14 @@ class Logicbroker_Dropship360_Model_System_Config_Source_Vendorlist
71
  );
72
  }
73
  }
74
- array_unshift($options,array('value' => '', 'label' => Mage::helper('logicbroker')->__('--Please Select--')));
75
  return $options;
76
  }
77
 
78
  public function getAllVendor($addEmpty = true)
79
  {
80
  $options =array();
81
- $collectionVendor = Mage::getModel ( 'logicbroker/ranking' )->getCollection ();
82
 
83
  if($collectionVendor->count() > 0){
84
  foreach ($collectionVendor as $vendor) {
@@ -88,7 +88,7 @@ class Logicbroker_Dropship360_Model_System_Config_Source_Vendorlist
88
  );
89
  }
90
  }
91
- array_unshift($options,array('value' => '', 'label' => Mage::helper('logicbroker')->__('--Please Select--')));
92
  return $options;
93
  }
94
  }
11
  public function toOptionArray($addEmpty = true)
12
  {
13
  $options =array();
14
+ $collectionVendor = Mage::getModel ( 'dropship360/inventory' )->getCollection ();
15
 
16
 
17
  $collectionVendor->getSelect ()->joinleft ( array (
18
+ 'lbRanking' => Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship360/ranking' )
19
  ), 'lbRanking.lb_vendor_code = main_table.lb_vendor_code', array (
20
  '*'
21
  ) )->where('lbRanking.is_dropship = ?','yes');
29
  );
30
  }
31
  }
32
+ array_unshift($options,array('value' => '', 'label' => Mage::helper('dropship360')->__('--Please Select--')),array('value' => 'none', 'label' => Mage::helper('dropship360')->__('None')));
33
  return $options;
34
  }
35
 
36
  public function vendorList($addEmpty = true,$sku)
37
  {
38
+ $vendorModel = Mage::getModel('dropship360/ranking')->getCollection();
39
+ $vendorModel->getSelect ()->where('main_table.lb_vendor_code not in (select lb_vendor_code from '.Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship360/inventory' ).' where product_sku = ?)',$sku);
40
  $options = array();
41
  if($vendorModel->count() > 0 ){
42
  foreach ($vendorModel as $vendor) {
46
  );
47
  }
48
  }
49
+ array_unshift($options,array('value' => '', 'label' => Mage::helper('dropship360')->__('--Please Select--'))
50
  );
51
  return $options;
52
  }
54
  public function vendorListSourcing($addEmpty = true,$sku)
55
  {
56
  $options =array();
57
+ $collectionVendor = Mage::getModel ( 'dropship360/inventory' )->getCollection ()->addFieldToFilter('product_sku',$sku);
58
  $collectionVendor->getSelect ()->joinleft ( array (
59
+ 'lbRanking' => Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship360/ranking' )
60
  ), 'lbRanking.lb_vendor_code = main_table.lb_vendor_code', array (
61
  '*'
62
  ) )->where('lbRanking.is_dropship = ?','yes');
71
  );
72
  }
73
  }
74
+ array_unshift($options,array('value' => '', 'label' => Mage::helper('dropship360')->__('--Please Select--')));
75
  return $options;
76
  }
77
 
78
  public function getAllVendor($addEmpty = true)
79
  {
80
  $options =array();
81
+ $collectionVendor = Mage::getModel ( 'dropship360/ranking' )->getCollection ();
82
 
83
  if($collectionVendor->count() > 0){
84
  foreach ($collectionVendor as $vendor) {
88
  );
89
  }
90
  }
91
+ array_unshift($options,array('value' => '', 'label' => Mage::helper('dropship360')->__('--Please Select--')));
92
  return $options;
93
  }
94
  }
app/code/community/Logicbroker/Dropship360/Model/Uploadvendor.php CHANGED
@@ -12,12 +12,14 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
12
 
13
  const FIELD_NAME_SOURCE_FILE = 'import_file';
14
  protected $_isProductSetupMode = false;
 
15
  protected $_haderError = array();
16
  protected $_FtpErrors = array();
17
  protected $_UploadCsvErrors = array();
18
  protected $_inventoryModel;
19
  protected $_vendorSkuFlag = array();
20
  protected $conn;
 
21
  protected $_errors = array();
22
  const XML_PATH_UPLOAD_ENABLED = 'logicbroker_sourcing/cron_settings_upload/enabled';
23
  const XML_PATH_UPLOAD_FTP_SITE = 'logicbroker_sourcing/cron_settings_upload/ftp_site';
@@ -25,13 +27,24 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
25
  const XML_PATH_UPLOAD_FTP_PASSWORD = 'logicbroker_sourcing/cron_settings_upload/ftp_password';
26
  const XML_PATH_UPLOAD_FTP_TYPE = 'logicbroker_sourcing/cron_settings_upload/ftp_type';
27
  const XML_PATH_UPLOAD_FTP_ACCNUMBER = 'logicbroker_sourcing/cron_settings_upload/ftp_accnumber';
28
-
 
 
 
 
 
 
 
 
 
 
29
 
30
  protected function _construct()
31
  {
32
- $this->_inventoryModel = Mage::getModel('logicbroker/inventory');
33
  $this->conn = $this->getDatabaseConnection ();
34
- $this->_init("logicbroker/uploadvendor");
 
35
 
36
  }
37
 
@@ -45,11 +58,22 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
45
  return Mage::getSingleton('adminhtml/session');
46
  }
47
 
48
- protected function _getCsvData($fileName)
49
  {
50
  $csvObject = new Varien_File_Csv();
51
- $csvData = $csvObject->getData($fileName);
52
- return $csvData;
 
 
 
 
 
 
 
 
 
 
 
53
  }
54
 
55
 
@@ -74,13 +98,14 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
74
  try{
75
  $this->save();
76
  }catch(Exception $e){
77
- $this->_getSession()->addError(Mage::helper('logicbroker')->__($e->getMessage()));
78
  }
79
  }
80
 
81
  public function uploadSource()
82
  {
83
  $error = false;
 
84
  $this->_isProductSetupMode = $this->getProductsetupmode();
85
  $entity = 'vendor_product_'.date('ymdHis');
86
  $uploader = Mage::getModel('core/file_uploader', self::FIELD_NAME_SOURCE_FILE);
@@ -88,28 +113,17 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
88
  $result = $uploader->save(self::getWorkingDir());
89
  $extension = pathinfo($result['file'], PATHINFO_EXTENSION);
90
  $uploadedFile = $result['path'] . $result['file'];
91
- if (!$extension) {
92
- $this->fileObj()->rm($uploadedFile);
93
- throw new Exception(Mage::helper('importexport')->__('Uploaded file has no extension'));
94
- return $error = true;
95
-
96
- }
97
- if (strtolower($extension) != 'csv') {
98
- $this->fileObj()->rm($uploadedFile);
99
- throw new Exception(Mage::helper('importexport')->__('Incorrect file type uploaded. Please upload your Inventory feed in .csv format.'));
100
- return $error = true;
101
- }
102
-
103
  $error = $this->validateCsv($uploadedFile);
104
  if($error){
105
  $this->fileObj()->rm($uploadedFile);
106
- $this->_getSession()->addNotice(Mage::helper('logicbroker')->__('Please fix errors and re-upload file'));
107
  return $error;
108
  }
109
 
110
  $sourceFile = self::getWorkingDir() . $entity;
111
 
112
  $sourceFile .= '.' . strtolower($extension);
 
113
 
114
  if(strtolower($uploadedFile) != strtolower($sourceFile)) {
115
  if (file_exists($sourceFile)) {
@@ -120,9 +134,9 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
120
  Mage::throwException(Mage::helper('importexport')->__('Source file moving failed'));
121
  }
122
  }
123
- Mage::register('file_name',$entity);
124
  if(!$error)
125
- $this->insertCronEntry($entity);
126
 
127
  return $error;
128
  }
@@ -132,46 +146,56 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
132
  {
133
  //$fileName
134
  $isError = false;
135
- $csvData = $this->_getCsvData($fileName);
136
 
137
  /** checks columns */
138
 
139
  if($this->validateCsvHeader($csvData)){
140
- $dataValidation = false;
141
- if($dataValidation){
142
- $isError = true;
143
- }
144
  }else{
145
- $this->_getSession()->addError(Mage::helper('logicbroker')->__('CSV header %s is invalid ',implode(',',$this->_haderError)));
146
  $isError = true;
 
147
  }
148
  return $isError;
149
  }
150
 
151
  protected function validateCsvHeader($csvData,$isFtp = false)
152
  {
 
 
 
 
 
153
  if ($this->_isProductSetupMode && !$isFtp ){
154
- $csvFields = array(
155
- 0 => Mage::helper('logicbroker')->__('magento_sku'),
156
- 1 => Mage::helper('logicbroker')->__('vendor_sku'),
157
- 2 => Mage::helper('logicbroker')->__(''),
158
- 3 => Mage::helper('logicbroker')->__('')
159
- );
160
  }else{
161
- $csvFields = (!$isFtp) ? array(
162
- 0 => Mage::helper('logicbroker')->__('vendor_sku'),
163
- 1 => Mage::helper('logicbroker')->__('qty'),
164
- 2 => Mage::helper('logicbroker')->__('cost'),
165
- ) : array(
166
- 0 => Mage::helper('logicbroker')->__('vendor_code'),
167
- 1 => Mage::helper('logicbroker')->__('vendor_sku'),
168
- 2 => Mage::helper('logicbroker')->__('qty'),
169
- 3 => Mage::helper('logicbroker')->__('cost')
170
- );
171
  }
172
-
173
  $cvsDataNum = count($csvData[0]);
174
- $result = true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
  if(!$isFtp && !$this->_isProductSetupMode ){
176
  if($cvsDataNum != 3){
177
  foreach ($csvData[0] as $val){
@@ -180,10 +204,28 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
180
  $this->_haderError[] = $val;
181
  }
182
  }
183
- return false;
184
  }
185
-
186
- }else if($this->_isProductSetupMode ){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
187
  if($cvsDataNum != 2){
188
  foreach ($csvData[0] as $val){
189
  if(!in_array($val,array('vendor_sku','magento_sku')))
@@ -191,48 +233,17 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
191
  $this->_haderError[] = $val;
192
  }
193
  }
194
- return false;
195
- }
196
-
197
- }else{
198
- if($cvsDataNum == 3 || $cvsDataNum == 4){
199
- foreach ($csvData[0] as $val){
200
- if(!in_array($val,($cvsDataNum == 3) ? array('vendor_sku','qty', 'cost') : array('vendor_code','vendor_sku','qty', 'cost'))){
201
- $this->_haderError[] = $val;
202
- }
203
- }
204
- if(!empty($this->_haderError))
205
- return false;
206
- else
207
- return true;
208
- }else
209
- {
210
- $this->_haderError[] = 'csv not supported';
211
- return false;
212
- }
213
-
214
- }
215
- for ($i = 0; $i < $cvsDataNum; $i++) {
216
- if( $isFtp && ($csvData[0][0] == 'vendor_code' || $csvData[0][0] == 'vendor_sku')){
217
- continue;
218
- }
219
- if($csvData[0][$i] == $csvFields[$i]){
220
- continue;
221
- }else{
222
- (!$isFtp) ? $this->_haderError[] = $csvData[0][$i] : '';
223
- $result = false;
224
  }
225
  }
226
- return $result;
227
  }
228
-
229
  protected function checkDataIntigrity($csvData,$isFtp = false){
230
- $emptyRecords = array();
231
  //patch for FTP backward compatibility header
232
  (count($csvData[0]) <= 3) ? array_unshift($csvData[0], "") : $csvData[0];
233
  foreach($csvData as $row => $csvRowData)
234
  {
235
- $error = true;
236
  if($row == 0)
237
  continue;
238
  if(!$this->_isProductSetupMode && !$isFtp){
@@ -241,107 +252,110 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
241
  //patch for FTP backward compatibility data
242
  if($isFtp)
243
  (count($csvRowData) <= 3) ? array_unshift($csvRowData, "") : $csvRowData;
244
-
245
-
 
 
 
 
 
 
246
  foreach($csvRowData as $key => $data){
247
  $data = trim($data);
248
  switch($key){
249
- case 0:
250
  if($this->_isProductSetupMode){
251
  if(empty($data)){
252
- $emptyRecords['magento_sku'][] = $row;
253
- $result[] = true;
254
  } else {
255
- $error = false; $result[] = false;
256
  }
257
  }else{
258
  continue;
259
  }
260
  break;
261
- case 1:
262
  if(empty($data)){
263
- $emptyRecords['vendor_sku'][] = $row;
264
- $result[] = true;
265
  }
266
  else
267
- $error = false; $result[] = false;
268
  break;
269
- case 2:
270
  if(!is_numeric($data) || $data < 0 )
271
  {
272
  if($data!=""){
273
- $emptyRecords['qty'][] = $row;
274
- $result[] = true;
275
  }
276
  }
277
  else
278
- $error = false; $result[] = false;
279
  break;
280
- case 3:
281
  if(!is_numeric($data) || $data < 0 ){
282
  if($data!=""){
283
- $emptyRecords['cost'][] = $row;
284
- $result[] = true;
285
  }
286
  }
287
  else
288
- $error = false; $result[] = false;
289
  break;
 
290
  }
 
291
  }
 
292
 
293
- if (!$isFtp) {
294
  $error = in_array(true,$result) ? true : false;
295
  if($error){
296
  foreach($emptyRecords as $key=>$value){
297
  if($this->_isProductSetupMode){
298
  if($key == 'magento_sku'){
299
- $string = implode(',',$value);
300
- $this->_UploadCsvErrors['magento_sku'] = 'Missing Data at Row(s) ' .$string.' are missing data in magento_sku';
301
  }
302
  }
303
  if($key == 'vendor_sku'){
304
- $string = implode(',',$value);
305
- $this->_UploadCsvErrors['vendor_sku'] = 'Missing Data at Row(s) ' .$string.' are missing data in vendor_sku';
 
 
 
 
306
  }
 
307
  if($key == 'qty'){
308
- $string = implode(',',$value);
309
- $this->_UploadCsvErrors['qty'] = 'Bad Data at Row(s) '.$string.' contain bad data in qty';
 
 
 
 
310
  }
 
311
  if($key == 'cost'){
312
- $string = implode(',',$value);
313
- $this->_UploadCsvErrors['cost'] = 'Bad Data at Row(s) '.$string.' contain bad data in cost';
314
- }
315
- }
316
- }
317
- } else {
318
- $error = in_array(true,$result) ? true : false;
319
- if ($error){
320
- foreach($emptyRecords as $key=>$value){
321
- if($key == 'vendor_sku')
322
- { $string = implode(',',$value);
323
- $this->_FtpErrors['vendor_sku'] = 'Missing Data at Row(s) ' .$string.' are missing data in vendor_sku';
324
  }
325
- if($key == 'qty')
326
- { $string = implode(',',$value);
327
- $this->_FtpErrors['qty'] = 'Bad Data at Row(s) '.$string.' contain bad data in qty';
328
  }
329
- if($key == 'cost')
330
- { $string = implode(',',$value);
331
- $this->_FtpErrors['cost'] = 'Bad Data at Row(s) '.$string.' contain bad data in cost';
332
  }
333
- }
334
- }
335
- }
336
- }
337
- return in_array(true,$result) ? true : false;
338
  }
339
 
340
  protected function getConfigValue($path)
341
  {
342
  return Mage::getStoreConfig($path);
343
  }
344
- protected function getMagentoSku($vendorCode,$vendorSku){
345
  $sku = '';
346
  $vendorCollection = $this->_inventoryModel->getCollection()->addFieldTofilter('lb_vendor_code',$vendorCode)->addFieldTofilter('lb_vendor_sku',$vendorSku);
347
  if($vendorCollection->count() > 0)
@@ -357,41 +371,23 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
357
  $records = array();
358
  $success = array();
359
  $failure = array();
 
360
  $foramterroroutput = array();
361
- $tableVendorImportLog = Mage::getSingleton ( 'core/resource' )->getTableName ( 'logicbroker/vendor_import_log' );
362
- $csvData = $this->_getCsvData(self::getWorkingDir().$fileName.'.csv');
 
 
363
 
364
- if(count($csvData) <= 1 )
365
  {
366
- $failure[$fileName.'.csv'] = 'File is empty';
367
- $this->_UploadCsvErrors['empty_file'] = 'File is empty';
368
  }
369
 
370
- foreach($csvData as $row => $csvRowData)
371
- {
372
- if($row == 0)
373
- continue;
374
-
375
- if(!$this->_isProductSetupMode)
376
- {
377
- (count($csvRowData) <= 3) ? array_unshift($csvRowData, "") : $csvRowData;
378
- if(is_numeric($csvRowData[2])){
379
- /* LBN - 935 change */
380
- $magento_sku = $this->getMagentoSku($lb_vendor_code, trim($csvRowData[1]));
381
- $csvqty = (!empty($magento_sku)) ? Mage::helper('logicbroker')->getIsQtyDecimal($magento_sku,$csvRowData[2]) : $csvRowData[2];;
382
- }
383
- else
384
- {
385
- $csvqty = $csvRowData[2];
386
- }
387
- }
388
- if(!$this->_isProductSetupMode)
389
- $records[$row] = array('vendor_sku'=>trim($csvRowData[1]),'qty'=>$csvqty ,'cost'=>$csvRowData[3],'lb_vendor_code'=>$lb_vendor_code);
390
- else
391
- $records[$row] = array('magento_sku'=>trim($csvRowData[0]),'vendor_sku'=>trim($csvRowData[1]),'qty'=>0 ,'cost'=>0,'lb_vendor_code'=>$lb_vendor_code);
392
- }
393
 
394
- $this->conn->beginTransaction ();
 
395
  if(is_array($records) && !empty($records)){
396
  $requestData = array_chunk($records, 1, true);
397
 
@@ -410,10 +406,9 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
410
  if($successOrfail['failure']!="")
411
  $failure[] = $successOrfail['failure'];
412
  }
413
- $updateFileStatus = $this->load($fileName,'file_name');
414
- $updateFileStatus->setImportStatus('done');
415
-
416
- try{
417
  $updateFileStatus->save();
418
  }catch(Exception $e){
419
  echo $e->getMessage();
@@ -424,31 +419,27 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
424
  }
425
  $this->checkDataIntigrity($csvData);
426
  }
427
- if(isset($this->_UploadCsvErrors['general_error'])){
428
- $this->_UploadCsvErrors['other'] = implode(' , ', $this->_UploadCsvErrors['general_error']);
429
- unset($this->_UploadCsvErrors['general_error']);
 
 
 
 
 
 
 
430
  }
431
- foreach($this->_UploadCsvErrors as $k=>$output){
432
- if($k =='combination_error' && is_array($output)){
433
- foreach($output as $oput){
434
- $foramterroroutput[] = '<li>'.$oput.'</li>';
435
- }
436
- }else{
437
- $foramterroroutput[] = '<li>'.$output.'</li>';
438
- }
439
- }
440
- array_unshift($foramterroroutput,'<ul>');
441
- array_push($foramterroroutput,'</ul>');
442
- $errorDiscription = implode('',$foramterroroutput);
443
- unset($foramterroroutput);
444
- $ftp_err = (count($failure) > 0) ? 'Missing/Bad Data' : '';
445
- $insert = 'INSERT INTO '.$tableVendorImportLog.'(lb_vendor_code,updated_by,success,failure,ftp_error,ftp_error_desc,created_at) VALUES ("'.$lb_vendor_code.'","'.Mage::getSingleton('admin/session')->getUser()->getUsername().'",'.count($success).','.count($failure).',"'.$ftp_err.'","'.$errorDiscription.'","'.now().'")';
446
-
447
  $this->conn->query($insert);
448
-
449
  try {
450
  $this->conn->commit ();
451
- $file = self::getWorkingDir() . $fileName.'.csv';
 
452
  $this->fileObj()->rm($file);
453
  } catch ( Exception $e ) {
454
  $this->conn->rollBack ();
@@ -459,7 +450,10 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
459
  echo $e->getMessage();
460
 
461
  }
462
- unset($this->_vendorSkuFlag);
 
 
 
463
  return $this;
464
  }
465
 
@@ -467,21 +461,21 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
467
  protected function chekDuplicateCombination($data)
468
  {
469
  $result = true;
470
- $collection = $this->_inventoryModel->getCollection()->addFieldTofilter('lb_vendor_code',$data['lb_vendor_code'])->addFieldTofilter('lb_vendor_sku',trim($data['vendor_sku']));
471
  if($collection->count() > 0){
472
  $existing_product_sku = $collection->getFirstItem()->getProductSku();
473
  if(!empty($existing_product_sku)){
474
- if(trim($data['magento_sku']) != trim($existing_product_sku)){
475
  $result = false;
476
  }
477
  }
478
  }
479
- $inventoryCollection = $this->_inventoryModel->getCollection()->addFieldTofilter('lb_vendor_code',$data['lb_vendor_code'])->addFieldTofilter('product_sku',trim($data['magento_sku']));
480
  if($inventoryCollection->getSize() > 0){
481
  $inventoryCollection = $inventoryCollection->getData();
482
  $inventoryCollection = $inventoryCollection[0];
483
  $existing_vendor_sku = $inventoryCollection['lb_vendor_sku'];
484
- if(trim($existing_vendor_sku) != trim($data['vendor_sku']))
485
  {
486
  $result = false;
487
  }
@@ -530,7 +524,7 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
530
  }
531
  protected function vendorProductInsert($data)
532
  {
533
- $tableVendorInventory = Mage::getSingleton ( 'core/resource' )->getTableName ( 'logicbroker/inventory' );
534
  $inventoryCollectionResult = $this->getInventoryCollection($data);
535
  $qtyArray = $this->calculateProductQty($data);
536
 
@@ -539,39 +533,23 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
539
  case 'update':
540
  $productId = Mage::getModel('catalog/product')->getIdBySku(trim($data['magento_sku']));
541
  if($productId){
542
- if(!is_numeric($data['cost']) || $data['cost'] < 0 || trim($data['cost']) =="")
543
- {
544
- $costUpdate = '';
545
- }else
546
- {
547
- $costUpdate = 'cost ='. $data['cost'] . ',';
548
- }
549
 
550
- if($qtyArray['upload_qty'] == .999999999 || trim($data['qty']) =="" )
551
- {
552
- $qtyUpdate = '';
553
- }else
554
- {
555
- $qtyUpdate = ' stock = '.$qtyArray['upload_qty']. ',';
556
- }
557
- if($costUpdate=='' && $qtyUpdate =='' && !$this->_isProductSetupMode){
558
- $timeUpdate = "";
559
- }else{
560
- $timeUpdate = ' updated_at = "'.now(). '",';
561
- }
562
- $vSkuUpdate = ' lb_vendor_sku = "'.$data['vendor_sku']. '"';
563
- $update = 'update '.$tableVendorInventory.' set '.$costUpdate.$qtyUpdate.$timeUpdate.$vSkuUpdate.' where id = '.$inventoryCollectionResult['vendor_id'];
564
 
565
  try {
566
  if(!$this->updateProductInventory(trim($data['magento_sku']),$qtyArray['final_qty']))
567
  {
568
- $this->_UploadCsvErrors['general_error'][] = 'Update error: Error in updating magento product inventory';
569
  return false;
570
  }
571
- if($update)
572
- $this->conn->query($update);
 
 
 
573
  return true;
574
  } catch ( Exception $e ) {
 
575
  $this->_errors[] = $e->getMessage();
576
  $this->_errors[] = $e->getTrace();
577
  Mage::log($e->getMessage(), Zend_Log::ERR);
@@ -581,7 +559,7 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
581
 
582
  }else
583
  {
584
- $this->_UploadCsvErrors['general_error'][] = 'Update error: magento product sku ' .$data['magento_sku'].' not exist';
585
  return false;
586
  }
587
  break;
@@ -594,12 +572,15 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
594
  try {
595
  if(!$this->updateProductInventory($data['magento_sku'],$qtyArray['final_qty']))
596
  {
597
- $this->_UploadCsvErrors['general_error'][] = 'Add error: Error in updating magento product inventory';
598
  return false;
599
  }
 
600
  $this->conn->query($insert);
 
601
  return true;
602
  } catch ( Exception $e ) {
 
603
  $this->_errors[] = $e->getMessage();
604
  $this->_errors[] = $e->getTrace();
605
  Mage::log($e->getMessage(), Zend_Log::ERR);
@@ -618,19 +599,31 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
618
 
619
  }
620
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
621
  protected function getInventoryLogQuery($data,$type,$qty,$updateBy=null,$ignoreData)
622
  {
623
  if(count($ignoreData)>0){
624
  if($type=='update'){
625
- if(in_array('qty', $ignoreData))
626
- $type = 'Cost Updated, Qty Ignored';
627
- if(in_array('cost', $ignoreData))
628
- $type = 'Qty Updated, Cost Ignored';
629
  }else{
630
- if(in_array('qty', $ignoreData))
631
- $type = 'Cost Added, Qty Ignored';
632
- if(in_array('cost', $ignoreData))
633
- $type = 'Qty Added, Cost Ignored';
634
  }
635
  if(count($ignoreData)==2){
636
  $type = 'ignore';
@@ -638,10 +631,10 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
638
  }
639
  if($qty==0.999999999)
640
  $qty = 0;
641
- $vendorRankModel = Mage::getModel('logicbroker/ranking')->load($data['lb_vendor_code'],'lb_vendor_code');
642
  $vendorName = $vendorRankModel->getLbVendorName();
643
 
644
- $tableName = Mage::getSingleton("core/resource")->getTableName('logicbroker/inventorylog');
645
  if(!$updateBy){
646
  $updateBy = Mage::getSingleton('admin/session')->getUser()->getUsername();
647
  }
@@ -732,7 +725,7 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
732
  $io = new Varien_Io_File();
733
  $path = Mage::getBaseDir('var') . DS . 'export' . DS;
734
  $name = md5(microtime());
735
- $file = $path . DS . $name . '.csv';
736
 
737
  $io->setAllowCreateFolders(true);
738
  $io->open(array('path' => $path));
@@ -750,7 +743,7 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
750
 
751
  protected function getVendorName($vendorCode)
752
  {
753
- return Mage::getModel('logicbroker/ranking')->load($vendorCode,'lb_vendor_code')->getLbVendorName();
754
  }
755
 
756
 
@@ -779,7 +772,7 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
779
 
780
  return array('error'=>true,'message' => 'Unable to connect');
781
  }
782
- $loggedIn = ftp_login($ftpcon, $ftpUserName['value'], $ftpPassword['value']);
783
  ftp_pasv($ftpcon, true);
784
  if (false === $loggedIn) {
785
  return array('error'=>true,'message' => 'Unable to log in');
@@ -803,42 +796,52 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
803
  */
804
  public function ftpParseCsv()
805
  {
806
- if(Mage::helper('logicbroker')->isProcessRunning('bulk_assign')){
807
  $message = 'Bulk product setup is currently running hence cannot run ftp import';
808
  Mage::log($message, null, 'logicbroker_log_report.log');
809
  return;
810
  }
811
  $ftpfileName = array();
812
- $ftpRequestPram = array('ftp_site'=>array('value'=> $this->getConfigValue(self::XML_PATH_UPLOAD_FTP_SITE)),'ftp_username'=>array('value'=> $this->getConfigValue(self::XML_PATH_UPLOAD_FTP_USERNAME)),'ftp_password'=>array('value'=> Mage::helper('core')->decrypt($this->getConfigValue(self::XML_PATH_UPLOAD_FTP_PASSWORD))),'ftp_type'=>array('value'=> $this->getConfigValue(self::XML_PATH_UPLOAD_FTP_TYPE)));
813
 
814
  if (! Mage::getStoreConfigFlag ( self::XML_PATH_UPLOAD_ENABLED )) {
815
  return $this;
816
  }
817
-
818
- $connectionResult = $this->testFtpConnection($ftpRequestPram,true);
819
  if($connectionResult['error']){
 
820
  $this->genrateLogEntry(array('ftp_error'=>'Connection error','ftp_error_desc'=>$connectionResult['message'],'error'=> 1));
821
  Mage::log($connectionResult['message'], null, 'logicbroker_ftp_vendor_inventory_import.log');
822
  ftp_close($connectionResult['object']);
823
  return $this;
824
  }
825
 
826
- $rankCollection = Mage::getModel('logicbroker/ranking')->getCollection()->addFieldToFilter('is_dropship','yes');
827
  /* file path format <ftp site>/<Logicbroker Account Number>_MagVendID<number>/Inventory/ */
828
 
829
  if($rankCollection->getSize() > 0){
830
  foreach($rankCollection as $ranks){
831
  $path = $this->getConfigValue(self::XML_PATH_UPLOAD_FTP_ACCNUMBER).'_'.$ranks->getLbVendorCode().'/'.'Inventory';
832
-
833
- $ftpFiles = ftp_nlist($connectionResult['object'],$path);
834
-
835
- if(is_array($ftpFiles)){
 
 
 
 
 
 
 
 
 
 
 
 
836
  foreach($ftpFiles as $file){
837
- if(!preg_match("/\bArchive\b/i", $file, $match)){
838
  if($this->downloadFtpFile($connectionResult['object'],$file,$path, $ranks->getLbVendorCode()))
839
  $ftpfileName[$ranks->getLbVendorCode()][] = self::getWorkingDir().str_replace("\\","/",$path).DS.$this->downloadFtpFile($connectionResult['object'],$file,$path);
840
  }
841
- }
842
  }
843
  ftp_chdir($connectionResult['object'],'/');
844
  }
@@ -847,33 +850,26 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
847
  Mage::log('No dropship supplier found', null, 'logicbroker_ftp_vendor_inventory_import.log');
848
  ftp_close($connectionResult['object']);
849
  return $this;
850
- }
851
- $nondropshipCollection = Mage::getModel('logicbroker/ranking')->getCollection()->addFieldToFilter('is_dropship','no');
852
- if($nondropshipCollection->getSize() > 0){
853
- foreach($nondropshipCollection as $nondropship){
854
- $path = $this->getConfigValue(self::XML_PATH_UPLOAD_FTP_ACCNUMBER).'_'.$nondropship->getLbVendorCode().'/'.'Inventory';
855
- $ftpFiles = ftp_nlist($connectionResult['object'],$path);
856
- if(is_array($ftpFiles)){
857
- foreach($ftpFiles as $file){
858
- if(!preg_match("/\bArchive\b/i", $file, $match)){
859
- $this->archiveFtpFile(array('object'=>$connectionResult['object'],'path'=>self::getWorkingDir().str_replace("\\","/",$path).DS.$this->downloadFtpFile($connectionResult['object'],$file,$path)));
860
- $this->genrateLogEntry(array('lb_vendor_code'=>$nondropship->getLbVendorCode(),'ftp_error'=>'Import Error','ftp_error_desc'=>$nondropship->getLbVendorCode().' is not a dropship supplier','error'=> 1));
861
- }
862
- }
863
- }
864
- ftp_chdir($connectionResult['object'],'/');
865
- }
866
  }
867
  if(!empty($ftpfileName)){
868
  $this->initialize();
 
 
 
869
  foreach($ftpfileName as $vendorCode=>$fileinfo)
870
  {
 
871
  foreach($fileinfo as $path){
872
- if($this->validateCsvHeader($this->_getCsvData($path),true)){
 
873
  $this->ftpUpdateVendorProduct($this->_getCsvData($path),$path,$vendorCode);
 
 
874
 
875
  }else{
 
876
  $logPath = explode('logicbrokervendorproduct',str_replace("\\","/",$path));
 
877
  $this->genrateLogEntry(array('lb_vendor_code'=>$vendorCode,'ftp_error'=>'Bad File header','ftp_error_desc'=>'Check header format at following FTP path '.$logPath[1],'error'=> 1));
878
  Mage::log('Please check header format', null, 'logicbroker_ftp_vendor_inventory_import.log');
879
  }
@@ -881,7 +877,6 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
881
  $this->archiveFtpFile(array('object'=>$connectionResult['object'],'path'=>$path));
882
  }
883
  }
884
-
885
  $this->finalize();
886
  }else{
887
  Mage::log('No files found on ftp server', null, 'logicbroker_ftp_vendor_inventory_import.log');
@@ -889,17 +884,19 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
889
  return $this;
890
  }
891
  ftp_close($connectionResult['object']);
 
 
 
892
  return $this;
893
-
894
  }
895
 
896
  protected function initialize(){
897
- Mage::helper('logicbroker')->startProcess('manual_upload');
898
  Mage::log('Ftp upload started', null, 'logicbroker_ftp_vendor_inventory_import.log');
899
  }
900
 
901
  protected function finalize(){
902
- Mage::helper('logicbroker')->finishProcess('manual_upload');
903
  Mage::log('Ftp upload finished', null, 'logicbroker_ftp_vendor_inventory_import.log');
904
  }
905
 
@@ -909,7 +906,17 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
909
  $patharr = explode('logicbrokervendorproduct',$path);
910
  $dirname = pathinfo($patharr[1],PATHINFO_DIRNAME);
911
  $basename = pathinfo($patharr[1],PATHINFO_BASENAME );
912
- $newname = Mage::getModel('core/date')->date('Y-m-d h:i:s').'_'.$basename;
 
 
 
 
 
 
 
 
 
 
913
  ftp_chdir($object['object'],$dirname);
914
  ftp_mkdir($object['object'], 'Archive');
915
  ftp_chdir($object['object'],'Archive');
@@ -918,6 +925,7 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
918
  ftp_chdir($object['object'],'/');
919
  $this->fileObj()->rm($object['path']);
920
  ftp_delete($object['object'], $dirname.'/'.$basename);
 
921
  return;
922
 
923
  }
@@ -925,14 +933,6 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
925
  {
926
  $file = str_replace("/","\\",$file);
927
  $extension = pathinfo($file, PATHINFO_EXTENSION);
928
- if (strtolower($extension) != 'csv') {
929
- $this->fileObj()->rm($file);
930
- $logPath = explode('logicbrokervendorproduct',str_replace("\\","/",$file));
931
- $this->genrateLogEntry(array('lb_vendor_code'=>$vendorCode, 'ftp_error'=>'Bad File', 'ftp_error_desc'=>'Disallowed file type '.$logPath[1], 'error'=> 1));
932
- Mage::log('Disallowed file type.', null, 'logicbroker_ftp_vendor_inventory_import.log');
933
-
934
- return false;
935
- }
936
  return true;
937
  }
938
 
@@ -950,10 +950,6 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
950
  ftp_chdir($ftpRequest,'/'.$fileName[0].'/'.$fileName[1]);
951
  $server_file = $fileName[2];
952
  $local_file = self::getWorkingDir().$path.DS.$fileName[2];
953
-
954
- if(!$this->validateFtpFile(self::getWorkingDir().$path.DS.$fileName[2], $vendorCode)){
955
- return false;
956
- }
957
  // download server file
958
  if (ftp_get($ftpRequest, $local_file, $server_file, FTP_ASCII)){
959
 
@@ -963,48 +959,45 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
963
  }
964
  }
965
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
966
  protected function ftpUpdateVendorProduct($csvData,$path,$vendorCode = null)
967
  {
968
  $records = array();
969
  $success = array();
970
  $failure = array();
971
  $itemerroroutput = array();
 
972
  //$vendorCode = '';
973
- $tableVendorImportLog = Mage::getSingleton ( 'core/resource' )->getTableName ( 'logicbroker/vendor_import_log' );
974
- if(count($csvData) <= 1 )
975
  {
976
- $failure[] = 'File is empty';
977
- $this->_FtpErrors['empty_file'] = 'File is empty';
978
  }
979
- foreach($csvData as $row => $csvRowData)
980
- {
981
- if($row == 0)
982
- continue;
983
- $data = trim($data);
984
- //patch for backwards compatible for ftp change lbn-1070
985
- (count($csvRowData) <= 3) ? array_unshift($csvRowData, "") : $csvRowData;
986
- if(is_numeric($csvRowData[2]) || $csvRowData[2] > 0){
987
- //$qty = floor($csvRowData[2]);
988
- /* LBN - 935 change */
989
- $magento_sku = $this->getMagentoSku($vendorCode, trim($csvRowData[1]));
990
-
991
- if(!empty($magento_sku))
992
- {
993
- $qty = Mage::helper('logicbroker')->getIsQtyDecimal($magento_sku,$csvRowData[2]);
994
- }
995
- else
996
- {
997
- $qty = $csvRowData[2];
998
- }
999
- /* End of LBN - 935 change */
1000
- }else{
1001
- $qty = $csvRowData[2];
1002
- }
1003
- $records[$row] = array('lb_vendor_code'=>$vendorCode,'vendor_sku'=>trim($csvRowData[1]),'qty'=>$qty ,'cost'=>$csvRowData[3]);
1004
- //$vendorCode = $csvRowData[0];
1005
- }
1006
-
1007
- $this->conn->beginTransaction ();
1008
  if(is_array($records) && !empty($records)){
1009
  $requestData = array_chunk($records, 1, true);
1010
 
@@ -1014,7 +1007,6 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
1014
  $result[] = $this->validateCsvData($data, true);
1015
  }
1016
  }
1017
-
1018
  foreach($result as $successOrfail){
1019
  if($successOrfail['success']!="")
1020
  $success[] = $successOrfail['success'];
@@ -1024,28 +1016,36 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
1024
  }
1025
  $this->checkDataIntigrity($this->_getCsvData($path),true);
1026
  }
1027
- if(isset($this->_FtpErrors['general_error'])){
1028
- $this->_FtpErrors['other'] = implode(' , ', $this->_FtpErrors['general_error']);
1029
- unset($this->_FtpErrors['general_error']);
 
 
 
 
 
 
1030
  }
1031
- foreach($this->_FtpErrors as $k=>$output){
1032
- if($k =='combination_error' && is_array($output)){
1033
- foreach($output as $oput){
1034
- $itemerroroutput[] = '<li>'.$oput.'</li>';
1035
- }
1036
- }else{
1037
- $itemerroroutput[] = '<li>'.$output.'</li>';
1038
- }
1039
- }
1040
- array_unshift($itemerroroutput,'<ul>');
1041
- array_push($itemerroroutput,'</ul>');
1042
-
1043
- $ftp_err = (count($failure) > 0) ? 'Missing/Bad Data' : '';
1044
- $insert = 'INSERT INTO '.$tableVendorImportLog.'(lb_vendor_code,updated_by,success,failure,ftp_error,ftp_error_desc,created_at) VALUES ("'.$vendorCode.'","FTP",'.count($success).','.count($failure).',"'.$ftp_err.'","'.implode('',$itemerroroutput).'","'.now().'")';
1045
- unset($itemerroroutput);
1046
  $this->conn->query($insert);
 
1047
  try {
1048
  $this->conn->commit ();
 
 
 
 
 
 
 
 
 
 
 
1049
  } catch ( Exception $e ) {
1050
  $this->conn->rollBack ();
1051
  Mage::log($e->getMessage(), null, 'logicbroker_ftp_vendor_inventory_import.log');
@@ -1056,7 +1056,7 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
1056
 
1057
  protected function ftpVendorProductUpdate($data)
1058
  {
1059
- $tableVendorInventory = Mage::getSingleton ( 'core/resource' )->getTableName ( 'logicbroker/inventory' );
1060
  $inventoryCollectionResult = $this->getInventoryCollection($data,true);
1061
  $qtyArray = $this->calculateProductQty(array('magento_sku'=>$inventoryCollectionResult['magento_sku'],'qty'=>$data['qty'],'lb_vendor_code'=>$data['lb_vendor_code']));
1062
  switch($inventoryCollectionResult['operationType'])
@@ -1064,50 +1064,36 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
1064
  case 'update':
1065
  $productId = Mage::getModel('catalog/product')->getIdBySku($inventoryCollectionResult['magento_sku']);
1066
  if($productId){
1067
- if(!is_numeric($data['cost']) || $data['cost'] < 0 || trim($data['cost']) =="")
1068
- {
1069
- $costUpdate = '';
1070
- }else
1071
- {
1072
- $costUpdate = ' cost ='. $data['cost'] . ',';
1073
- }
1074
-
1075
- if($qtyArray['upload_qty'] == .999999999 || trim($data['qty']) =="" )
1076
- {
1077
- $qtyUpdate = '';
1078
- }else
1079
- {
1080
- $qtyUpdate = ' stock = '.$qtyArray['upload_qty']. ',';
1081
- }
1082
- if($costUpdate=='' && $qtyUpdate ==''){
1083
- $timeUpdate = "";
1084
- }else{
1085
- $timeUpdate = ' updated_at = "'.now(). '"';
1086
- }
1087
- $update = 'update '.$tableVendorInventory.' set '.$costUpdate. $qtyUpdate.$timeUpdate.' where id = '.$inventoryCollectionResult['vendor_id'];
1088
-
1089
  try {
1090
  if(!$this->updateProductInventory($inventoryCollectionResult['magento_sku'],$qtyArray['final_qty']))
1091
  {
1092
- $this->_FtpErrors['general_error'][] = 'Update error: Error in updating magento product inventory';
 
1093
  return false;
1094
  }
1095
- if($update)
 
1096
  $this->conn->query($update);
 
 
1097
  return true;
1098
  } catch ( Exception $e ) {
 
1099
  Mage::log($e->getMessage(), null, 'logicbroker_ftp_vendor_inventory_import.log');
1100
  echo $e->getMessage();
1101
  }
1102
 
1103
  }else{
1104
- $this->_FtpErrors['general_error'][] = 'Update error: '.$data['lb_vendor_code'].' and '.$data['vendor_sku'] .' combination does not exist';
 
1105
  return false;
1106
  }
1107
  break;
1108
  default :
1109
  /*fix for ticket lbn-710 vendor_sku not visible*/
1110
- $this->_FtpErrors['general_error'][] = $data['lb_vendor_code'].' and '.$data['vendor_sku'] .' combination does not exist';
 
1111
  return false;
1112
  }
1113
  return true;
@@ -1116,9 +1102,9 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
1116
  protected function genrateLogEntry($message)
1117
  {
1118
  $vendorCode = (!empty($message['lb_vendor_code'])) ? $message['lb_vendor_code'] : '';
1119
- $ftp_error = (!empty($message['ftp_error'])) ? $message['ftp_error'] : '';;
1120
- $ftp_error_desc = (!empty($message['ftp_error_desc'])) ? $message['ftp_error_desc'] : '';;
1121
- $tableVendorImportLog = Mage::getSingleton ( 'core/resource' )->getTableName ( 'logicbroker/vendor_import_log' );
1122
  $this->conn->beginTransaction ();
1123
  $now = now();
1124
  $insert = 'INSERT INTO '.$tableVendorImportLog.'(lb_vendor_code,updated_by,success,failure,created_at,ftp_error,ftp_error_desc) VALUES ("'.$vendorCode.'","FTP",'.count($success).','.$message['error'].',"'.$now.'","'.$ftp_error.'","'.$ftp_error_desc.'")';
@@ -1162,9 +1148,10 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
1162
  if(!$duplicateCombination = $this->chekDuplicateCombination($data)){
1163
  $invalidData = true;
1164
  if(!$isFtp){
1165
- $this->_UploadCsvErrors['combination_error'][] = 'Supplier code'. $data['lb_vendor_code'] .' and vendor sku '.$data['vendor_sku'].' combination not matching' ;
1166
  }else{
1167
- $this->_FtpErrors['combination_error'][] = 'Supplier code'. $data['lb_vendor_code'] .' and vendor sku '.$data['vendor_sku'].' combination not matching' ;
 
1168
  }
1169
  }
1170
  $vendorCollection = $this->_inventoryModel->getCollection()->addFieldTofilter('lb_vendor_code',$data['lb_vendor_code'])->addFieldTofilter('lb_vendor_sku',trim($data['vendor_sku']));
@@ -1178,7 +1165,7 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
1178
  if($vendorCollection->getSize() > 0){
1179
  if($data['magento_sku']!=$vendorCollection->getFirstItem ()->getProductSku()){
1180
  $invalidData = true;
1181
- $this->_UploadCsvErrors['combination_error'][] = 'Vendor sku '.$data['vendor_sku'].' is already been assigned for this vendor';
1182
  }
1183
  }
1184
  if($invalidData){
@@ -1195,10 +1182,11 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
1195
  $failure+=1;
1196
  if(!$isFtp){
1197
  if(trim($data['vendor_sku']))
1198
- $this->_UploadCsvErrors['general_error'][] = 'Vendor Sku '. $data['vendor_sku'] .' & Supplier code '.$data['lb_vendor_code'].' combination does not exist';
1199
  }else{
1200
  if(trim($data['vendor_sku']))
1201
- $this->_FtpErrors['general_error'][] = 'Vendor Sku '. $data['vendor_sku'] .' & Supplier code '.$data['lb_vendor_code'].' combination does not exist';
 
1202
  }
1203
  }
1204
  if($data['magento_sku']){
@@ -1208,7 +1196,15 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
1208
  $insertInventoryLog = $this->getInventoryLogQuery($data, $inventoryCollectionResult['operationType'], $data['qty'], null,$ignoreData);
1209
  }
1210
  if($insertInventoryLog)
1211
- $this->conn->query($insertInventoryLog);
 
 
 
 
 
 
 
 
1212
  }
1213
  return array('success'=>$success, 'failure'=>$failure);
1214
  }
@@ -1234,11 +1230,11 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
1234
  if(!empty($existing_product_sku)){
1235
  if($data['magento_sku'] != $existing_product_sku){
1236
  $invalidData = true;
1237
- $this->_UploadCsvErrors['combination_error'][] = 'Vendor sku '.$data['vendor_sku'].' is duplicate in Magento Sku '. $data['magento_sku'] .' for this supplier';
1238
 
1239
  }else{
1240
  $invalidData = true;
1241
- $this->_UploadCsvErrors['combination_error'][] = 'Vendor sku '.$data['vendor_sku'].' & Magento Sku '. $data['magento_sku'] .' combination already present';
1242
  }
1243
  }
1244
  }
@@ -1266,13 +1262,20 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
1266
  ($this->vendorProductInsert($data)) ? $success += 1 : $failure+=1;
1267
  if($this->vendorProductInsert($data)){
1268
  $insertInventoryLog = $this->getInventoryLogQuery($data, $type, 0, null, null);
1269
- if($insertInventoryLog)
1270
- $this->conn->query($insertInventoryLog);
 
 
 
 
 
 
 
1271
  }
1272
  }
1273
  }else{
1274
  $failure+=1;
1275
- $this->_UploadCsvErrors['general_error'][] = 'Magento Sku '.$data['magento_sku'].' does not exist';
1276
  }
1277
  return array('success'=>$success, 'failure'=>$failure);
1278
  }
@@ -1331,5 +1334,208 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
1331
  }
1332
  return $trimmedSkus;
1333
  }
1334
- }
1335
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
 
13
  const FIELD_NAME_SOURCE_FILE = 'import_file';
14
  protected $_isProductSetupMode = false;
15
+ protected $sendBadFileAlert = false;
16
  protected $_haderError = array();
17
  protected $_FtpErrors = array();
18
  protected $_UploadCsvErrors = array();
19
  protected $_inventoryModel;
20
  protected $_vendorSkuFlag = array();
21
  protected $conn;
22
+ protected $ftpRequestPram = array();
23
  protected $_errors = array();
24
  const XML_PATH_UPLOAD_ENABLED = 'logicbroker_sourcing/cron_settings_upload/enabled';
25
  const XML_PATH_UPLOAD_FTP_SITE = 'logicbroker_sourcing/cron_settings_upload/ftp_site';
27
  const XML_PATH_UPLOAD_FTP_PASSWORD = 'logicbroker_sourcing/cron_settings_upload/ftp_password';
28
  const XML_PATH_UPLOAD_FTP_TYPE = 'logicbroker_sourcing/cron_settings_upload/ftp_type';
29
  const XML_PATH_UPLOAD_FTP_ACCNUMBER = 'logicbroker_sourcing/cron_settings_upload/ftp_accnumber';
30
+ const XML_PATH_INVENTORY_NOTIFICATION_EMAIL = 'logicbroker_sourcing/inventory_notification/email';
31
+ const XML_PATH_INVENTORY_NOTIFICATION_EMAIL_ENABLED = 'logicbroker_sourcing/inventory_notification/enabled';
32
+ protected $ftpCSVFormat = array('vendor_code','vendor_sku','qty','cost');
33
+ protected $manualCSVFormat = array('vendor_sku','qty','cost');
34
+ protected $productSetupCSVFormat = array('magento_sku','vendor_sku','','');
35
+ protected $_csvDataCache;
36
+ protected $_vendorCode;
37
+ protected $_csvParserObj;
38
+ protected $emptyRecords = array(); //checkDataIntigrity fnction store empty records from CSV
39
+ protected $result = array(); //checkDataIntigrity fnction store final result for error
40
+ protected $supplierName = '';
41
 
42
  protected function _construct()
43
  {
44
+ $this->_inventoryModel = Mage::getModel('dropship360/inventory');
45
  $this->conn = $this->getDatabaseConnection ();
46
+ $this->_init("dropship360/uploadvendor");
47
+ $this->_csvParserObj = Mage::getModel('dropship360/csvparser');
48
 
49
  }
50
 
58
  return Mage::getSingleton('adminhtml/session');
59
  }
60
 
61
+ protected function _getCsvData($fileName,$header = false)
62
  {
63
  $csvObject = new Varien_File_Csv();
64
+
65
+ if(!$this->_csvDataCache){
66
+ $this->_csvDataCache = $this->_csvParserObj->getChangedValue($csvObject->getData($fileName),$this->_vendorCode);
67
+ }else
68
+ {
69
+ if($header){
70
+ return array($this->_csvDataCache[0]);
71
+ }else
72
+ {
73
+ $this->_csvDataCache;
74
+ }
75
+ }
76
+ return $this->_csvDataCache;
77
  }
78
 
79
 
98
  try{
99
  $this->save();
100
  }catch(Exception $e){
101
+ $this->_getSession()->addError(Mage::helper('dropship360')->__($e->getMessage()));
102
  }
103
  }
104
 
105
  public function uploadSource()
106
  {
107
  $error = false;
108
+ $this->_vendorCode = $this->getVendor();
109
  $this->_isProductSetupMode = $this->getProductsetupmode();
110
  $entity = 'vendor_product_'.date('ymdHis');
111
  $uploader = Mage::getModel('core/file_uploader', self::FIELD_NAME_SOURCE_FILE);
113
  $result = $uploader->save(self::getWorkingDir());
114
  $extension = pathinfo($result['file'], PATHINFO_EXTENSION);
115
  $uploadedFile = $result['path'] . $result['file'];
 
 
 
 
 
 
 
 
 
 
 
 
116
  $error = $this->validateCsv($uploadedFile);
117
  if($error){
118
  $this->fileObj()->rm($uploadedFile);
119
+ $this->_getSession()->addNotice(Mage::helper('dropship360')->__('Please fix errors and re-upload file'));
120
  return $error;
121
  }
122
 
123
  $sourceFile = self::getWorkingDir() . $entity;
124
 
125
  $sourceFile .= '.' . strtolower($extension);
126
+ $fileName = $entity.'.'.strtolower($extension);
127
 
128
  if(strtolower($uploadedFile) != strtolower($sourceFile)) {
129
  if (file_exists($sourceFile)) {
134
  Mage::throwException(Mage::helper('importexport')->__('Source file moving failed'));
135
  }
136
  }
137
+ Mage::register('file_name',$fileName);
138
  if(!$error)
139
+ $this->insertCronEntry($fileName);
140
 
141
  return $error;
142
  }
146
  {
147
  //$fileName
148
  $isError = false;
149
+ $csvData = $this->_getCsvData($fileName,true);
150
 
151
  /** checks columns */
152
 
153
  if($this->validateCsvHeader($csvData)){
154
+ $isError = false;
 
 
 
155
  }else{
156
+ $this->_getSession()->addError(Mage::helper('dropship360')->__('CSV header %s is invalid ',implode(',',$this->_haderError)));
157
  $isError = true;
158
+ $this->_csvDataCache = array();
159
  }
160
  return $isError;
161
  }
162
 
163
  protected function validateCsvHeader($csvData,$isFtp = false)
164
  {
165
+ $result = true;
166
+ if(empty($csvData))
167
+ {
168
+ return false;
169
+ }
170
  if ($this->_isProductSetupMode && !$isFtp ){
171
+ $csvFields = $this->productSetupCSVFormat;
 
 
 
 
 
172
  }else{
173
+ $csvFields = (!$isFtp) ? $this->manualCSVFormat : $this->ftpCSVFormat;
 
 
 
 
 
 
 
 
 
174
  }
 
175
  $cvsDataNum = count($csvData[0]);
176
+
177
+ if(!$this->validateManualCsvHeader($cvsDataNum,$csvData,$isFtp))
178
+ return false;
179
+ if(!$this->validateFtpCsvHeader($cvsDataNum,$csvData))
180
+ return false;
181
+ if(!$this->validateProductSetupCsvHeader($cvsDataNum,$csvData))
182
+ return false;
183
+ for ($i = 0; $i < $cvsDataNum; $i++) {
184
+ if( $isFtp && ($csvData[0][0] == 'vendor_code' || $csvData[0][0] == 'vendor_sku')){
185
+ continue;
186
+ }
187
+ if($csvData[0][$i] == $csvFields[$i]){
188
+ continue;
189
+ }else{
190
+ (!$isFtp) ? $this->_haderError[] = $csvData[0][$i] : '';
191
+ $result = false;
192
+ }
193
+ }
194
+ return $result;
195
+ }
196
+
197
+ protected function validateManualCsvHeader($cvsDataNum,$csvData,$isFtp)
198
+ {
199
  if(!$isFtp && !$this->_isProductSetupMode ){
200
  if($cvsDataNum != 3){
201
  foreach ($csvData[0] as $val){
204
  $this->_haderError[] = $val;
205
  }
206
  }
207
+ return false;
208
  }
209
+ }
210
+ return true;
211
+ }
212
+ protected function validateFtpCsvHeader($cvsDataNum,$csvData)
213
+ {
214
+ $validation = true;
215
+ if($cvsDataNum == 3 || $cvsDataNum == 4){
216
+ foreach ($csvData[0] as $val){
217
+ if(!in_array($val,($cvsDataNum == 3) ? array('vendor_sku','qty', 'cost') : array('vendor_code','vendor_sku','qty', 'cost'))){
218
+ $this->_haderError[] = $val;
219
+ $validation = false;
220
+ }
221
+ }
222
+ return $validation;
223
+ }
224
+ return true;
225
+ }
226
+ protected function validateProductSetupCsvHeader($cvsDataNum,$csvData)
227
+ {
228
+ if($this->_isProductSetupMode ){
229
  if($cvsDataNum != 2){
230
  foreach ($csvData[0] as $val){
231
  if(!in_array($val,array('vendor_sku','magento_sku')))
233
  $this->_haderError[] = $val;
234
  }
235
  }
236
+ return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
237
  }
238
  }
239
+ return true;
240
  }
 
241
  protected function checkDataIntigrity($csvData,$isFtp = false){
242
+
243
  //patch for FTP backward compatibility header
244
  (count($csvData[0]) <= 3) ? array_unshift($csvData[0], "") : $csvData[0];
245
  foreach($csvData as $row => $csvRowData)
246
  {
 
247
  if($row == 0)
248
  continue;
249
  if(!$this->_isProductSetupMode && !$isFtp){
252
  //patch for FTP backward compatibility data
253
  if($isFtp)
254
  (count($csvRowData) <= 3) ? array_unshift($csvRowData, "") : $csvRowData;
255
+ $this->getErrorRowNumber($csvRowData,$row);
256
+ }
257
+ $this->generateMsg($isFtp,$this->result,$this->emptyRecords);
258
+ return in_array(true,$this->result) ? true : false;
259
+ }
260
+ protected function getErrorRowNumber($csvRowData,$row)
261
+ {
262
+
263
  foreach($csvRowData as $key => $data){
264
  $data = trim($data);
265
  switch($key){
266
+ case is_numeric($key) ? 0 : 'magento_sku' :
267
  if($this->_isProductSetupMode){
268
  if(empty($data)){
269
+ $this->emptyRecords['magento_sku'][] = $row;
270
+ $this->result[] = true;
271
  } else {
272
+ $this->result[] = false;
273
  }
274
  }else{
275
  continue;
276
  }
277
  break;
278
+ case is_numeric($key) ? 1 : 'vendor_sku':
279
  if(empty($data)){
280
+ $this->emptyRecords['vendor_sku'][] = $row;
281
+ $this->result[] = true;
282
  }
283
  else
284
+ $this->result[] = false;
285
  break;
286
+ case is_numeric($key) ? 2 : 'qty':
287
  if(!is_numeric($data) || $data < 0 )
288
  {
289
  if($data!=""){
290
+ $this->emptyRecords['qty'][] = $row;
291
+ $this->result[] = true;
292
  }
293
  }
294
  else
295
+ $this->result[] = false;
296
  break;
297
+ case is_numeric($key) ? 3 : 'cost':
298
  if(!is_numeric($data) || $data < 0 ){
299
  if($data!=""){
300
+ $this->emptyRecords['cost'][] = $row;
301
+ $this->result[] = true;
302
  }
303
  }
304
  else
305
+ $this->result[] = false;
306
  break;
307
+ }
308
  }
309
+ return;
310
  }
311
+ protected function generateMsg($isFtp,$result,$emptyRecords){
312
 
 
313
  $error = in_array(true,$result) ? true : false;
314
  if($error){
315
  foreach($emptyRecords as $key=>$value){
316
  if($this->_isProductSetupMode){
317
  if($key == 'magento_sku'){
318
+ $string = implode(';',$value);
319
+ $this->_UploadCsvErrors[] = array('error_type'=>'row_magento_sku','value'=>$string);
320
  }
321
  }
322
  if($key == 'vendor_sku'){
323
+ $string = implode(';',$value);
324
+ if($isFtp){
325
+ $this->_FtpErrors[] = array('error_type'=>'row_vendor_sku','value'=>$string);
326
+ $this->sendBadFileAlert = true;
327
+ }else{
328
+ $this->_UploadCsvErrors[] = array('error_type'=>'row_vendor_sku','value'=>$string);
329
  }
330
+ }
331
  if($key == 'qty'){
332
+ $string = implode(';',$value);
333
+ if($isFtp){
334
+ $this->_FtpErrors[] = array('error_type'=>'row_qty','value'=>$string);
335
+ $this->sendBadFileAlert = true;
336
+ }else{
337
+ $this->_UploadCsvErrors[] = array('error_type'=>'row_qty','value'=>$string);
338
  }
339
+ }
340
  if($key == 'cost'){
341
+ $string = implode(';',$value);
342
+ if($isFtp){
343
+ $this->_FtpErrors[] = array('error_type'=>'row_cost','value'=>$string);
344
+ $this->sendBadFileAlert = true;
345
+ }else{
346
+ $this->_UploadCsvErrors[] = array('error_type'=>'row_cost','value'=>$string);
347
+ }
 
 
 
 
 
348
  }
 
 
 
349
  }
 
 
 
350
  }
351
+ return ;
 
 
 
 
352
  }
353
 
354
  protected function getConfigValue($path)
355
  {
356
  return Mage::getStoreConfig($path);
357
  }
358
+ public function getMagentoSku($vendorCode,$vendorSku){
359
  $sku = '';
360
  $vendorCollection = $this->_inventoryModel->getCollection()->addFieldTofilter('lb_vendor_code',$vendorCode)->addFieldTofilter('lb_vendor_sku',$vendorSku);
361
  if($vendorCollection->count() > 0)
371
  $records = array();
372
  $success = array();
373
  $failure = array();
374
+ $counter = 0;
375
  $foramterroroutput = array();
376
+ $this->_csvDataCache = array();
377
+ $this->_vendorCode = $lb_vendor_code;
378
+ $tableVendorImportLog = Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship360/vendor_import_log' );
379
+ $csvData = $this->_getCsvData(self::getWorkingDir().$fileName);
380
 
381
+ if(count($csvData) <= 1 && Mage::getModel('dropship360/csvparser')->isCsvFileEmpty())
382
  {
383
+ $failure[$fileName] = 'Sorry,we cant find the record to update inventory';
384
+ $this->_UploadCsvErrors[] = array('error_type'=>'empty_file','value'=>'Sorry,we cant find the record to update inventory');
385
  }
386
 
387
+ $records = Mage::getModel('dropship360/csvparser')->generateManualCsvRow($csvData,$this->_isProductSetupMode,$lb_vendor_code);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
388
 
389
+ Mage::helper('dropship360')->turnOnReadUncommittedMode(); // dirty read patch
390
+ //$this->conn->beginTransaction ();
391
  if(is_array($records) && !empty($records)){
392
  $requestData = array_chunk($records, 1, true);
393
 
406
  if($successOrfail['failure']!="")
407
  $failure[] = $successOrfail['failure'];
408
  }
409
+ try{
410
+ $updateFileStatus = Mage::getModel('dropship360/uploadvendor')->load($fileName,'file_name');
411
+ $updateFileStatus->setImportStatus('done');
 
412
  $updateFileStatus->save();
413
  }catch(Exception $e){
414
  echo $e->getMessage();
419
  }
420
  $this->checkDataIntigrity($csvData);
421
  }
422
+ $finalResultCounter = (!$this->_isProductSetupMode) ? $this->logForUnprocessedRows($lb_vendor_code) : 0;
423
+
424
+ if(is_array($finalResultCounter))
425
+ {
426
+ $failed = count($failure)+$finalResultCounter['failure'];
427
+ $success = count($success)+$finalResultCounter['success'];
428
+ }else
429
+ {
430
+ $failed = count($failure)+$finalResultCounter;
431
+ $success = count($success)+$finalResultCounter;
432
  }
433
+
434
+ $ftp_err = ($failed > 0) ? 'Missing/Bad Data' : '';
435
+ $insert = 'INSERT INTO '.$tableVendorImportLog.'(lb_vendor_code,updated_by,success,failure,ftp_error,created_at) VALUES ("'.$lb_vendor_code.'","'.Mage::getSingleton('admin/session')->getUser()->getUsername().'",'.$success.','.$failed.',"'.$ftp_err.'","'.now().'")';
436
+ $this->conn->beginTransaction ();
 
 
 
 
 
 
 
 
 
 
 
 
437
  $this->conn->query($insert);
438
+ $entityId = $this->conn->lastInsertId($tableVendorImportLog);
439
  try {
440
  $this->conn->commit ();
441
+ $this->prepareInsertAndExeQuery($this->_UploadCsvErrors,$entityId);
442
+ $file = self::getWorkingDir() . $fileName;
443
  $this->fileObj()->rm($file);
444
  } catch ( Exception $e ) {
445
  $this->conn->rollBack ();
450
  echo $e->getMessage();
451
 
452
  }
453
+ $this->_csvParserObj->emptyTable();
454
+ $this->_csvDataCache = array();
455
+ $this->_vendorSkuFlag = array();
456
+ Mage::helper('dropship360')->turnOnReadCommittedMode(); //restore to orignal trasectional level
457
  return $this;
458
  }
459
 
461
  protected function chekDuplicateCombination($data)
462
  {
463
  $result = true;
464
+ $collection = $this->_inventoryModel->getCollection()->addFieldTofilter('lb_vendor_code',$data['lb_vendor_code'])->addFieldTofilter('lb_vendor_sku',$data['vendor_sku']);
465
  if($collection->count() > 0){
466
  $existing_product_sku = $collection->getFirstItem()->getProductSku();
467
  if(!empty($existing_product_sku)){
468
+ if($data['magento_sku'] != $existing_product_sku){
469
  $result = false;
470
  }
471
  }
472
  }
473
+ $inventoryCollection = $this->_inventoryModel->getCollection()->addFieldTofilter('lb_vendor_code',$data['lb_vendor_code'])->addFieldTofilter('product_sku',$data['magento_sku']);
474
  if($inventoryCollection->getSize() > 0){
475
  $inventoryCollection = $inventoryCollection->getData();
476
  $inventoryCollection = $inventoryCollection[0];
477
  $existing_vendor_sku = $inventoryCollection['lb_vendor_sku'];
478
+ if($existing_vendor_sku != trim($data['vendor_sku']))
479
  {
480
  $result = false;
481
  }
524
  }
525
  protected function vendorProductInsert($data)
526
  {
527
+ $tableVendorInventory = Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship360/inventory' );
528
  $inventoryCollectionResult = $this->getInventoryCollection($data);
529
  $qtyArray = $this->calculateProductQty($data);
530
 
533
  case 'update':
534
  $productId = Mage::getModel('catalog/product')->getIdBySku(trim($data['magento_sku']));
535
  if($productId){
 
 
 
 
 
 
 
536
 
537
+ $update = $this->_prepareUpdateQuery($data,$qtyArray,$inventoryCollectionResult,$tableVendorInventory,false);
 
 
 
 
 
 
 
 
 
 
 
 
 
538
 
539
  try {
540
  if(!$this->updateProductInventory(trim($data['magento_sku']),$qtyArray['final_qty']))
541
  {
542
+ $this->_UploadCsvErrors[] = array('error_type'=>'inventory_update_error','value'=>array('magento_sku'=>$data['magento_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
543
  return false;
544
  }
545
+ if($update){
546
+ $this->conn->beginTransaction ();
547
+ $this->conn->query($update);
548
+ $this->conn->commit ();
549
+ }
550
  return true;
551
  } catch ( Exception $e ) {
552
+ $this->conn->rollBack ();
553
  $this->_errors[] = $e->getMessage();
554
  $this->_errors[] = $e->getTrace();
555
  Mage::log($e->getMessage(), Zend_Log::ERR);
559
 
560
  }else
561
  {
562
+ $this->_UploadCsvErrors[] = array('error_type'=>'magento_sku_exists','value'=>array('magento_sku'=>$data['magento_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
563
  return false;
564
  }
565
  break;
572
  try {
573
  if(!$this->updateProductInventory($data['magento_sku'],$qtyArray['final_qty']))
574
  {
575
+ $this->_UploadCsvErrors[] = array('error_type'=>'inventory_add_error','value'=>array('magento_sku'=>$data['magento_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
576
  return false;
577
  }
578
+ $this->conn->beginTransaction ();
579
  $this->conn->query($insert);
580
+ $this->conn->commit ();
581
  return true;
582
  } catch ( Exception $e ) {
583
+ $this->conn->rollBack ();
584
  $this->_errors[] = $e->getMessage();
585
  $this->_errors[] = $e->getTrace();
586
  Mage::log($e->getMessage(), Zend_Log::ERR);
599
 
600
  }
601
 
602
+ protected function _prepareUpdateQuery($data,$qtyArray,$inventoryCollectionResult,$tableVendorInventory,$isFtp)
603
+ {
604
+ $update;
605
+ (!is_numeric($data['cost']) || $data['cost'] < 0 || trim($data['cost']) =="") ? $costUpdate = '' : $costUpdate = 'cost ='. $data['cost'] . ',';
606
+ ($qtyArray['upload_qty'] == .999999999 || trim($data['qty']) =="" ) ? $qtyUpdate = '' : $qtyUpdate = ' stock = '.$qtyArray['upload_qty']. ',';
607
+ if(!$isFtp){
608
+ ($costUpdate=='' && $qtyUpdate =='' && !$this->_isProductSetupMode) ? $timeUpdate = "" : $timeUpdate = ' updated_at = "'.now(). '",';
609
+ $vSkuUpdate = ' lb_vendor_sku = "'.$data['vendor_sku']. '"';
610
+ $update = 'update '.$tableVendorInventory.' set '.$costUpdate.$qtyUpdate.$timeUpdate.$vSkuUpdate.' where id = '.$inventoryCollectionResult['vendor_id'];
611
+ }else
612
+ {
613
+ if(trim($data['qty'])!='' || trim($data['cost']) !='')
614
+ $update = 'update '.$tableVendorInventory.' set '.$costUpdate. $qtyUpdate.' updated_at = "'.now().'" where id = '.$inventoryCollectionResult['vendor_id'];
615
+ }
616
+ return $update;
617
+ }
618
  protected function getInventoryLogQuery($data,$type,$qty,$updateBy=null,$ignoreData)
619
  {
620
  if(count($ignoreData)>0){
621
  if($type=='update'){
622
+ (in_array('qty', $ignoreData)) ? $type = 'Cost Updated, Qty Ignored' : '';
623
+ (in_array('cost', $ignoreData)) ? $type = 'Qty Updated, Cost Ignored' : '';
 
 
624
  }else{
625
+ (in_array('qty', $ignoreData)) ? $type = 'Cost Added, Qty Ignored' : '';
626
+ (in_array('cost', $ignoreData)) ? $type = 'Qty Added, Cost Ignored' : '';
 
 
627
  }
628
  if(count($ignoreData)==2){
629
  $type = 'ignore';
631
  }
632
  if($qty==0.999999999)
633
  $qty = 0;
634
+ $vendorRankModel = Mage::getModel('dropship360/ranking')->load($data['lb_vendor_code'],'lb_vendor_code');
635
  $vendorName = $vendorRankModel->getLbVendorName();
636
 
637
+ $tableName = Mage::getSingleton("core/resource")->getTableName('dropship360/inventorylog');
638
  if(!$updateBy){
639
  $updateBy = Mage::getSingleton('admin/session')->getUser()->getUsername();
640
  }
725
  $io = new Varien_Io_File();
726
  $path = Mage::getBaseDir('var') . DS . 'export' . DS;
727
  $name = md5(microtime());
728
+ $file = $path . DS . $name;
729
 
730
  $io->setAllowCreateFolders(true);
731
  $io->open(array('path' => $path));
743
 
744
  protected function getVendorName($vendorCode)
745
  {
746
+ return Mage::getModel('dropship360/ranking')->load($vendorCode,'lb_vendor_code')->getLbVendorName();
747
  }
748
 
749
 
772
 
773
  return array('error'=>true,'message' => 'Unable to connect');
774
  }
775
+ $loggedIn = @ftp_login($ftpcon, $ftpUserName['value'], $ftpPassword['value']);
776
  ftp_pasv($ftpcon, true);
777
  if (false === $loggedIn) {
778
  return array('error'=>true,'message' => 'Unable to log in');
796
  */
797
  public function ftpParseCsv()
798
  {
799
+ if(Mage::helper('dropship360')->isProcessRunning('bulk_assign')){
800
  $message = 'Bulk product setup is currently running hence cannot run ftp import';
801
  Mage::log($message, null, 'logicbroker_log_report.log');
802
  return;
803
  }
804
  $ftpfileName = array();
805
+ $this->ftpRequestPram = array('ftp_site'=>array('value'=> $this->getConfigValue(self::XML_PATH_UPLOAD_FTP_SITE)),'ftp_username'=>array('value'=> $this->getConfigValue(self::XML_PATH_UPLOAD_FTP_USERNAME)),'ftp_password'=>array('value'=> Mage::helper('core')->decrypt($this->getConfigValue(self::XML_PATH_UPLOAD_FTP_PASSWORD))),'ftp_type'=>array('value'=> $this->getConfigValue(self::XML_PATH_UPLOAD_FTP_TYPE)));
806
 
807
  if (! Mage::getStoreConfigFlag ( self::XML_PATH_UPLOAD_ENABLED )) {
808
  return $this;
809
  }
810
+ $connectionResult = $this->testFtpConnection($this->ftpRequestPram,true);
 
811
  if($connectionResult['error']){
812
+ $this->sendMail(array('subject'=>'Your magento site has failed to connect FTP site','message' => 'Connection Failure','bcc'=>trim(Mage::helper('dropship360')->getConfigObject('apiconfig/email/bcc'))));
813
  $this->genrateLogEntry(array('ftp_error'=>'Connection error','ftp_error_desc'=>$connectionResult['message'],'error'=> 1));
814
  Mage::log($connectionResult['message'], null, 'logicbroker_ftp_vendor_inventory_import.log');
815
  ftp_close($connectionResult['object']);
816
  return $this;
817
  }
818
 
819
+ $rankCollection = Mage::getModel('dropship360/ranking')->getCollection()->addFieldToFilter('is_dropship','yes');
820
  /* file path format <ftp site>/<Logicbroker Account Number>_MagVendID<number>/Inventory/ */
821
 
822
  if($rankCollection->getSize() > 0){
823
  foreach($rankCollection as $ranks){
824
  $path = $this->getConfigValue(self::XML_PATH_UPLOAD_FTP_ACCNUMBER).'_'.$ranks->getLbVendorCode().'/'.'Inventory';
825
+ $ftpFiles = array();
826
+ $ftpFilesList = ftp_nlist($connectionResult['object'],$path);
827
+ //patch for sort ftp files by time
828
+ if($ftpFilesList){
829
+ foreach ($ftpFilesList as $value) {
830
+ if(preg_match("/.csv$/i", $value, $match)){
831
+ $fileTime = ftp_mdtm($connectionResult['object'], $value);
832
+ if(array_key_exists($fileTime,$ftpFiles))
833
+ $ftpFiles[$fileTime+20] = $value; // if timestamp same for files
834
+ else
835
+ $ftpFiles[$fileTime] = $value;
836
+ }
837
+ }
838
+ ksort($ftpFiles); // sort associative arrays in acending order, according to the key(time)
839
+ }
840
+ if($ftpFiles){
841
  foreach($ftpFiles as $file){
 
842
  if($this->downloadFtpFile($connectionResult['object'],$file,$path, $ranks->getLbVendorCode()))
843
  $ftpfileName[$ranks->getLbVendorCode()][] = self::getWorkingDir().str_replace("\\","/",$path).DS.$this->downloadFtpFile($connectionResult['object'],$file,$path);
844
  }
 
845
  }
846
  ftp_chdir($connectionResult['object'],'/');
847
  }
850
  Mage::log('No dropship supplier found', null, 'logicbroker_ftp_vendor_inventory_import.log');
851
  ftp_close($connectionResult['object']);
852
  return $this;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
853
  }
854
  if(!empty($ftpfileName)){
855
  $this->initialize();
856
+ $this->_csvParserObj->emptyTable();
857
+ $this->_csvDataCache = array();
858
+ Mage::helper('dropship360')->turnOnReadUncommittedMode(); //dirty read patch
859
  foreach($ftpfileName as $vendorCode=>$fileinfo)
860
  {
861
+ $this->_vendorCode = $vendorCode;
862
  foreach($fileinfo as $path){
863
+ if($this->validateCsvHeader($this->_getCsvData($path,true),true)){
864
+ Mage::helper('dropship360')->turnOnReadUncommittedMode(); // dirty read patch
865
  $this->ftpUpdateVendorProduct($this->_getCsvData($path),$path,$vendorCode);
866
+ Mage::helper('dropship360')->turnOnReadCommittedMode(); //restore to orignal trasectional level
867
+ $this->_csvDataCache = array();//for more than one csv file on FTP server
868
 
869
  }else{
870
+ $this->_csvDataCache = array();
871
  $logPath = explode('logicbrokervendorproduct',str_replace("\\","/",$path));
872
+ $this->sendMail(array('isfailed'=>true,'vendor_code'=>$vendorCode,'subject'=>'dropship360 failed to update inventory','message' => 'Bad File header,Check header format at following FTP path '.$logPath[1]));
873
  $this->genrateLogEntry(array('lb_vendor_code'=>$vendorCode,'ftp_error'=>'Bad File header','ftp_error_desc'=>'Check header format at following FTP path '.$logPath[1],'error'=> 1));
874
  Mage::log('Please check header format', null, 'logicbroker_ftp_vendor_inventory_import.log');
875
  }
877
  $this->archiveFtpFile(array('object'=>$connectionResult['object'],'path'=>$path));
878
  }
879
  }
 
880
  $this->finalize();
881
  }else{
882
  Mage::log('No files found on ftp server', null, 'logicbroker_ftp_vendor_inventory_import.log');
884
  return $this;
885
  }
886
  ftp_close($connectionResult['object']);
887
+ $this->_csvParserObj->emptyTable();
888
+ $this->_csvDataCache = array();
889
+ Mage::helper('dropship360')->turnOnReadCommittedMode(); //restore to orignal transection level
890
  return $this;
 
891
  }
892
 
893
  protected function initialize(){
894
+ Mage::helper('dropship360')->startProcess('manual_upload');
895
  Mage::log('Ftp upload started', null, 'logicbroker_ftp_vendor_inventory_import.log');
896
  }
897
 
898
  protected function finalize(){
899
+ Mage::helper('dropship360')->finishProcess('manual_upload');
900
  Mage::log('Ftp upload finished', null, 'logicbroker_ftp_vendor_inventory_import.log');
901
  }
902
 
906
  $patharr = explode('logicbrokervendorproduct',$path);
907
  $dirname = pathinfo($patharr[1],PATHINFO_DIRNAME);
908
  $basename = pathinfo($patharr[1],PATHINFO_BASENAME );
909
+ $newname = Mage::getModel('core/date')->date('Ymd-his').'_'.$basename;
910
+ $connection = $this->testFtpConnection($this->ftpRequestPram,true);
911
+ if($connection['error'])
912
+ {
913
+ $this->sendMail(array('subject'=>'Your magento site has failed to connect FTP site','message' => "Connection Failure--Can not archive file -".$basename,'bcc'=>trim(Mage::helper('dropship360')->getConfigObject('apiconfig/email/bcc'))));
914
+ Mage::log($connection['message'] ."--Can not archive file -".$basename, null, 'logicbroker_ftp_vendor_inventory_import.log');
915
+ }
916
+ else
917
+ {
918
+ $object['object'] = $connection['object'];
919
+ }
920
  ftp_chdir($object['object'],$dirname);
921
  ftp_mkdir($object['object'], 'Archive');
922
  ftp_chdir($object['object'],'Archive');
925
  ftp_chdir($object['object'],'/');
926
  $this->fileObj()->rm($object['path']);
927
  ftp_delete($object['object'], $dirname.'/'.$basename);
928
+ ftp_close($connection['object']);
929
  return;
930
 
931
  }
933
  {
934
  $file = str_replace("/","\\",$file);
935
  $extension = pathinfo($file, PATHINFO_EXTENSION);
 
 
 
 
 
 
 
 
936
  return true;
937
  }
938
 
950
  ftp_chdir($ftpRequest,'/'.$fileName[0].'/'.$fileName[1]);
951
  $server_file = $fileName[2];
952
  $local_file = self::getWorkingDir().$path.DS.$fileName[2];
 
 
 
 
953
  // download server file
954
  if (ftp_get($ftpRequest, $local_file, $server_file, FTP_ASCII)){
955
 
959
  }
960
  }
961
 
962
+ protected function uploadReport($file,$vendorCode){
963
+ $path = $this->getConfigValue(self::XML_PATH_UPLOAD_FTP_ACCNUMBER).'_'.$vendorCode.'/'.'Inventory';
964
+ $reprotPath = 'report'.Mage::getModel('core/date')->date('Ymd-his').'.csv';
965
+ $connection = $this->testFtpConnection($this->ftpRequestPram,true);
966
+ if($connection['error'])
967
+ {
968
+ $this->sendMail(array('subject'=>'Your magento site has failed to connect FTP site','message' => "Connection Failure--Can not upload report file -".$basename,'bcc'=>trim(Mage::helper('dropship360')->getConfigObject('apiconfig/email/bcc'))));
969
+ Mage::log($connection['message'] ."--Can not archive file -".$basename, null, 'logicbroker_ftp_vendor_inventory_import.log');
970
+ }
971
+ else
972
+ {
973
+ $object = $connection['object'];
974
+ }
975
+ ftp_chdir($object,'/');
976
+ ftp_chdir($object,$path);
977
+ ftp_mkdir($object,'Reports');
978
+ ftp_chdir($object,'Reports');
979
+ ftp_put($object, $reprotPath,$file['value'], FTP_ASCII);
980
+ ftp_chdir($object,'/');
981
+ $this->fileObj()->rm( $file['value']);
982
+ ftp_close($connection['object']);
983
+ return;
984
+ }
985
  protected function ftpUpdateVendorProduct($csvData,$path,$vendorCode = null)
986
  {
987
  $records = array();
988
  $success = array();
989
  $failure = array();
990
  $itemerroroutput = array();
991
+ $counter = 0;
992
  //$vendorCode = '';
993
+ $tableVendorImportLog = Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship360/vendor_import_log' );
994
+ if(count($csvData) <= 1 && Mage::getModel('dropship360/csvparser')->isCsvFileEmpty())
995
  {
996
+ $failure[] = 'Sorry,we cant find the record to update inventory';
997
+ $this->_FtpErrors[] = array('error_type'=>'empty_file','value'=>'Sorry,we cant find the record to update inventory');
998
  }
999
+ $records = Mage::getModel('dropship360/csvparser')->generateFtpCsvRow($csvData,$vendorCode);
1000
+ //$this->conn->beginTransaction ();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1001
  if(is_array($records) && !empty($records)){
1002
  $requestData = array_chunk($records, 1, true);
1003
 
1007
  $result[] = $this->validateCsvData($data, true);
1008
  }
1009
  }
 
1010
  foreach($result as $successOrfail){
1011
  if($successOrfail['success']!="")
1012
  $success[] = $successOrfail['success'];
1016
  }
1017
  $this->checkDataIntigrity($this->_getCsvData($path),true);
1018
  }
1019
+ $finalResultCounter = (!$this->_isProductSetupMode) ? $this->logForUnprocessedRows($vendorCode,true) : 0;
1020
+ if(is_array($finalResultCounter))
1021
+ {
1022
+ $failed = count($failure)+$finalResultCounter['failure'];
1023
+ $success = count($success)+$finalResultCounter['success'];
1024
+ }else
1025
+ {
1026
+ $failed = count($failure)+$finalResultCounter;
1027
+ $success = count($success)+$finalResultCounter;
1028
  }
1029
+ $itemerroroutput = Mage::helper('core')->jsonEncode($this->_FtpErrors);
1030
+ //$failed = count($failure)+$counter;
1031
+ $ftp_err = ($failed > 0) ? 'Missing/Bad Data' : '';
1032
+ $insert = 'INSERT INTO '.$tableVendorImportLog.'(lb_vendor_code,updated_by,success,failure,ftp_error,created_at) VALUES ("'.$vendorCode.'","FTP",'.$success.','.$failed.',"'.$ftp_err.'","'.now().'")';
1033
+ $this->conn->beginTransaction ();
 
 
 
 
 
 
 
 
 
 
1034
  $this->conn->query($insert);
1035
+ $entityId = $this->conn->lastInsertId($tableVendorImportLog);
1036
  try {
1037
  $this->conn->commit ();
1038
+ if(count($this->_FtpErrors) > 0){
1039
+ $csvFile = Mage::helper('dropship360')->generateErrorList(array('ftp_error_desc'=>$itemerroroutput,'lb_vendor_code'=>$vendorCode),true);
1040
+ $this->uploadReport($csvFile,$vendorCode);
1041
+ }
1042
+ if($this->sendBadFileAlert){
1043
+ $logPath = explode('logicbrokervendorproduct',str_replace("\\","/",$path));
1044
+ $this->sendMail(array('isfailed'=>true,'vendor_code'=>$vendorCode,'subject'=>'dropship360 failed to update inventory','message' => 'Missing/Bad data, check CSV data at following FTP path <br>'.$logPath[1]));
1045
+ }
1046
+ $this->prepareInsertAndExeQuery($this->_FtpErrors,$entityId);
1047
+ $itemerroroutput = array();
1048
+ $this->_FtpErrors = array();
1049
  } catch ( Exception $e ) {
1050
  $this->conn->rollBack ();
1051
  Mage::log($e->getMessage(), null, 'logicbroker_ftp_vendor_inventory_import.log');
1056
 
1057
  protected function ftpVendorProductUpdate($data)
1058
  {
1059
+ $tableVendorInventory = Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship360/inventory' );
1060
  $inventoryCollectionResult = $this->getInventoryCollection($data,true);
1061
  $qtyArray = $this->calculateProductQty(array('magento_sku'=>$inventoryCollectionResult['magento_sku'],'qty'=>$data['qty'],'lb_vendor_code'=>$data['lb_vendor_code']));
1062
  switch($inventoryCollectionResult['operationType'])
1064
  case 'update':
1065
  $productId = Mage::getModel('catalog/product')->getIdBySku($inventoryCollectionResult['magento_sku']);
1066
  if($productId){
1067
+ $update = $this->_prepareUpdateQuery($data,$qtyArray,$inventoryCollectionResult,$tableVendorInventory,true);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1068
  try {
1069
  if(!$this->updateProductInventory($inventoryCollectionResult['magento_sku'],$qtyArray['final_qty']))
1070
  {
1071
+ $this->_FtpErrors[] = array('error_type'=>'inventory_update_error','value'=>array('magento_sku'=>$inventoryCollectionResult['magento_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));;
1072
+ $this->sendBadFileAlert = true;
1073
  return false;
1074
  }
1075
+ if($update){
1076
+ $this->conn->beginTransaction ();
1077
  $this->conn->query($update);
1078
+ $this->conn->commit ();
1079
+ }
1080
  return true;
1081
  } catch ( Exception $e ) {
1082
+ $this->conn->rollBack ();
1083
  Mage::log($e->getMessage(), null, 'logicbroker_ftp_vendor_inventory_import.log');
1084
  echo $e->getMessage();
1085
  }
1086
 
1087
  }else{
1088
+ $this->_FtpErrors[] = array('error_type'=>'combination_notexist','value'=>array('magento_sku'=>'','qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1089
+ $this->sendBadFileAlert = true;
1090
  return false;
1091
  }
1092
  break;
1093
  default :
1094
  /*fix for ticket lbn-710 vendor_sku not visible*/
1095
+ $this->_FtpErrors[] = array('error_type'=>'combination_notexist','value'=>array('magento_sku'=>'','qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));;
1096
+ $this->sendBadFileAlert = true;
1097
  return false;
1098
  }
1099
  return true;
1102
  protected function genrateLogEntry($message)
1103
  {
1104
  $vendorCode = (!empty($message['lb_vendor_code'])) ? $message['lb_vendor_code'] : '';
1105
+ $ftp_error = (!empty($message['ftp_error'])) ? $message['ftp_error'] : '';
1106
+ $ftp_error_desc = (!empty($message['ftp_error_desc'])) ? $message['ftp_error_desc'] : '';
1107
+ $tableVendorImportLog = Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship360/vendor_import_log' );
1108
  $this->conn->beginTransaction ();
1109
  $now = now();
1110
  $insert = 'INSERT INTO '.$tableVendorImportLog.'(lb_vendor_code,updated_by,success,failure,created_at,ftp_error,ftp_error_desc) VALUES ("'.$vendorCode.'","FTP",'.count($success).','.$message['error'].',"'.$now.'","'.$ftp_error.'","'.$ftp_error_desc.'")';
1148
  if(!$duplicateCombination = $this->chekDuplicateCombination($data)){
1149
  $invalidData = true;
1150
  if(!$isFtp){
1151
+ $this->_UploadCsvErrors[] = array('error_type'=>'combination_exist','value'=>array('magento_sku'=>$data['magento_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1152
  }else{
1153
+ $this->_FtpErrors[] = array('error_type'=>'combination_exist','value'=>array('magento_sku'=>$data['magento_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1154
+ $this->sendBadFileAlert = true;
1155
  }
1156
  }
1157
  $vendorCollection = $this->_inventoryModel->getCollection()->addFieldTofilter('lb_vendor_code',$data['lb_vendor_code'])->addFieldTofilter('lb_vendor_sku',trim($data['vendor_sku']));
1165
  if($vendorCollection->getSize() > 0){
1166
  if($data['magento_sku']!=$vendorCollection->getFirstItem ()->getProductSku()){
1167
  $invalidData = true;
1168
+ $this->_UploadCsvErrors[] = array('error_type'=>'already_assigned','value'=>array('magento_sku'=>$data['magento_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1169
  }
1170
  }
1171
  if($invalidData){
1182
  $failure+=1;
1183
  if(!$isFtp){
1184
  if(trim($data['vendor_sku']))
1185
+ $this->_UploadCsvErrors[] = array('error_type'=>'combination_notexist','value'=>array('magento_sku'=>'','qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1186
  }else{
1187
  if(trim($data['vendor_sku']))
1188
+ $this->_FtpErrors[] = array('error_type'=>'combination_notexist','value'=>array('magento_sku'=>'','qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1189
+ $this->sendBadFileAlert = true;
1190
  }
1191
  }
1192
  if($data['magento_sku']){
1196
  $insertInventoryLog = $this->getInventoryLogQuery($data, $inventoryCollectionResult['operationType'], $data['qty'], null,$ignoreData);
1197
  }
1198
  if($insertInventoryLog)
1199
+ {
1200
+ $this->conn->beginTransaction ();
1201
+ $this->conn->query($insertInventoryLog);
1202
+ try{
1203
+ $this->conn->commit ();
1204
+ }catch(Exception $e){
1205
+ $this->conn->rollBack ();
1206
+ }
1207
+ }
1208
  }
1209
  return array('success'=>$success, 'failure'=>$failure);
1210
  }
1230
  if(!empty($existing_product_sku)){
1231
  if($data['magento_sku'] != $existing_product_sku){
1232
  $invalidData = true;
1233
+ $this->_UploadCsvErrors[] = array('error_type'=>'duplicate_vendor_sku','value'=>array('magento_sku'=>$data['magento_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1234
 
1235
  }else{
1236
  $invalidData = true;
1237
+ $this->_UploadCsvErrors[] = array('error_type'=>'combination_exist','value'=>array('magento_sku'=>$data['magento_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1238
  }
1239
  }
1240
  }
1262
  ($this->vendorProductInsert($data)) ? $success += 1 : $failure+=1;
1263
  if($this->vendorProductInsert($data)){
1264
  $insertInventoryLog = $this->getInventoryLogQuery($data, $type, 0, null, null);
1265
+ if($insertInventoryLog){
1266
+ $this->conn->beginTransaction ();
1267
+ $this->conn->query($insertInventoryLog);
1268
+ try{
1269
+ $this->conn->commit ();
1270
+ }catch(Exception $e){
1271
+ $this->conn->rollBack ();
1272
+ }
1273
+ }
1274
  }
1275
  }
1276
  }else{
1277
  $failure+=1;
1278
+ $this->_UploadCsvErrors[] = array('error_type'=>'magento_sku_exists','value'=>array('magento_sku'=>$data['magento_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1279
  }
1280
  return array('success'=>$success, 'failure'=>$failure);
1281
  }
1334
  }
1335
  return $trimmedSkus;
1336
  }
1337
+
1338
+ protected function sendMail($mailData = array()){
1339
+ if (!Mage::getStoreConfigFlag (self::XML_PATH_INVENTORY_NOTIFICATION_EMAIL_ENABLED)) {
1340
+ return $this;
1341
+ }
1342
+ $mailData['datetime'] = Mage::getModel('core/date')->date();
1343
+ $postObject = new Varien_Object();
1344
+ $postObject->setData($mailData);
1345
+ $email = trim(Mage::getStoreConfig(self::XML_PATH_INVENTORY_NOTIFICATION_EMAIL));
1346
+ $templateId = 'logicbroker_ftp_con_fail';
1347
+ $isMailSent = Mage::helper('dropship360')->sendMail($postObject,$email,$templateId);
1348
+ if(!$isMailSent)
1349
+ Mage::log('Notification email not sent :'.$email, null, 'logicbroker_debug.log');
1350
+ }
1351
+ protected function logForUnprocessedRows($vendorCode,$isFtp = false){
1352
+ $msg = '';
1353
+ $error = 0;
1354
+ $success = 0;
1355
+ $proObj = Mage::getModel('dropship360/ranking')->load($vendorCode,'lb_vendor_code');
1356
+ $proLinkAttr = $proObj->getLinkingAttribute();
1357
+ $proLinkAttr = empty($proLinkAttr) ? 'none' : $proLinkAttr;
1358
+ $this->supplierName = $proObj->getLbVendorName();
1359
+ $helper = Mage::helper('dropship360');
1360
+ $csvData = Mage::getModel('dropship360/csvparser')->getUnprocessedCsvRows($vendorCode,$isFtp);
1361
+ if(count($csvData) > 0 ){
1362
+ foreach($csvData as $data){
1363
+ $collection = $this->_inventoryModel->getCollection()->addFieldTofilter('lb_vendor_code',$vendorCode)->addFieldTofilter('lb_vendor_sku',$data['vendor_sku']);
1364
+ if($collection->getSize() > 0)
1365
+ {
1366
+ $msg = array('error_type'=>'data_notchnage','value'=>array('magento_sku'=> $collection->getFirstItem()->getProductSku(),'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1367
+ (!$isFtp) ? $this->_UploadCsvErrors[] = $msg : $this->_FtpErrors[] = $msg;
1368
+ $error++;
1369
+ }else
1370
+ {
1371
+ switch ($proLinkAttr) {
1372
+ case 'none':
1373
+ $msg = array('error_type'=>'combination_notexist','value'=>array('magento_sku'=>'','qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1374
+ (!$isFtp) ? $this->_UploadCsvErrors[] = $msg : $this->_FtpErrors[] = $msg;
1375
+ $error++;
1376
+ break;
1377
+ default:
1378
+ $proCol = Mage::getModel('catalog/product')->getCollection();
1379
+ if(!$this->checkAttributeAval($proLinkAttr,$proCol)){
1380
+ $msg = array('error_type'=>'attribute_notexist','value'=>array('magento_sku'=>'','qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1381
+ (!$isFtp) ? $this->_UploadCsvErrors[] = $msg : $this->_FtpErrors[] = $msg;
1382
+ $error++;
1383
+ }else{
1384
+ $product = $proCol->addAttributeToFilter($proLinkAttr,$data['vendor_sku']);
1385
+ if($this->validateGenerateProduct($product,$data,$proLinkAttr,$isFtp)){
1386
+ $tempArray = $this->genNonExistPro($product,$data,$isFtp);
1387
+ !empty($tempArray['success']) ? $success++ : '';
1388
+ !empty($tempArray['failure']) ? $error++ : '';
1389
+ }else
1390
+ {
1391
+ $error++;
1392
+ }
1393
+ }
1394
+ break;
1395
+ }
1396
+ }
1397
+ }
1398
+ $csvData[0] = $this->_csvDataCache[0];
1399
+ $this->emptyRecords = array();
1400
+ $this->result = array();
1401
+ $this->checkDataIntigrity($csvData,$isFtp);
1402
+ }
1403
+ return array('success'=>$success,'failure'=>$error);
1404
+ }
1405
+ protected function prepareInsertAndExeQuery($csvData,$entityId){
1406
+ if(count($csvData) <= 0 || empty($entityId))
1407
+ return ;
1408
+ $tableName = Mage::getSingleton ( 'core/resource' )->getTableName ('dropship360/vendor_import_log_desc');
1409
+
1410
+ foreach($csvData as $data)
1411
+ {
1412
+ try {
1413
+ $this->conn->insertArray($tableName,array('error_id','description'),array(array($entityId,Mage::helper('core')->jsonEncode($data))));
1414
+ } catch ( Exception $e ) {
1415
+ Mage::logException($e);
1416
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
1417
+ }
1418
+
1419
+ }
1420
+ return ;
1421
+ }
1422
+ protected function validateGenerateProduct($product,$data,$attr,$isFtp){
1423
+ $isValid = true;
1424
+ $helper = Mage::helper('dropship360');
1425
+ if($product->getSize() == 0)
1426
+ {
1427
+ $errorType = ($attr == $helper::LOGICBROKER_PRODUCT_LINK_CODE_SKU) ? 'magento_sku_exists' : $attr.'_notexist';
1428
+ $msg = array('error_type'=>$errorType,'value'=>array('magento_sku'=>$data['vendor_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1429
+ (!$isFtp) ? $this->_UploadCsvErrors[] = $msg : $this->_FtpErrors[] = $msg;
1430
+ $isValid = false;
1431
+ }elseif($product->getSize() > 1)
1432
+ {
1433
+ $msg = array('error_type'=>$attr.'_multiple','value'=>array('magento_sku'=>'','qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1434
+ (!$isFtp) ? $this->_UploadCsvErrors[] = $msg : $this->_FtpErrors[] = $msg;
1435
+ $isValid = false;
1436
+ }else{
1437
+ $data['magento_sku'] = $product->getFirstItem()->getSku();
1438
+ if(!$this->chekDuplicateCombination($data))
1439
+ {
1440
+ $msg = array('error_type'=>'combination_exist','value'=>array('magento_sku'=>$data['magento_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1441
+ (!$isFtp) ? $this->_UploadCsvErrors[] = $msg : $this->_FtpErrors[] = $msg;
1442
+ $isValid = false;
1443
+ }
1444
+ }
1445
+
1446
+ return $isValid;
1447
+ }
1448
+
1449
+ protected function genNonExistPro($proObj,$data,$isFtp){
1450
+ $invalidData = false;
1451
+ $failure = 0;
1452
+ $success = 0;
1453
+ $ignoreData = array();
1454
+ $data['magento_sku'] = $proObj->getFirstItem()->getSku();
1455
+ /* LBN - 935 change */
1456
+ $data['qty'] = (is_numeric($data['qty'])) ? Mage::helper('dropship360')->getIsQtyDecimal($data['magento_sku'],$data['qty']) : $data['qty'];
1457
+ if(!is_numeric($data['qty']) || $data['qty'] < 0){
1458
+ $ignoreData[]= 'qty';
1459
+ }
1460
+ if(!is_numeric($data['cost']) || $data['cost'] < 0){
1461
+ $ignoreData[]= 'cost';
1462
+ }
1463
+ if((!is_numeric($data['cost']) || $data['cost'] < 0) && (!is_numeric($data['qty']) || $data['qty'] < 0)){
1464
+ if($data['cost']!="" && $data['qty']!="")
1465
+ $invalidData = true;
1466
+ }
1467
+
1468
+ if($invalidData){
1469
+ $failure+=1;
1470
+ }else{
1471
+ ($this->insertNonExistPro($proObj,$data,$isFtp)) ? $success += 1 : $failure += 1;
1472
+ }
1473
+
1474
+ $this->insertInventoryLog($ignoreData,$data,$isFtp);
1475
+
1476
+ return array('success'=>$success,'failure'=>$failure);
1477
+ }
1478
+
1479
+ protected function insertNonExistPro($proObj,$data,$isFtp = false){
1480
+
1481
+ $vendorCode = ($isFtp) ? $data['lb_vendor_code'] : $this->_vendorCode;
1482
+ $tableVendorInventory = Mage::getSingleton ('core/resource')->getTableName('dropship360/inventory');
1483
+ $qtyArray = $this->calculateProductQty($data);
1484
+ $costInsert = (!is_numeric($data['cost']) || $data['cost'] < 0 || trim($data['cost']) =="") ? 0 : $data['cost'] ;
1485
+ $qtyInsert = ($qtyArray['upload_qty'] == .999999999 || trim($data['qty']) =="" ) ? 0 : $qtyArray['upload_qty'];
1486
+ $dbFields = array('lb_vendor_code','lb_vendor_name','product_sku','lb_vendor_sku','stock','cost','created_at','updated_at');
1487
+ $dbFieldVal = array(
1488
+ array($vendorCode,$this->supplierName,$data['magento_sku'],$data['vendor_sku'],$qtyInsert,$costInsert,now(),now())
1489
+ );
1490
+ try {
1491
+ if(!$this->updateProductInventory(trim($data['magento_sku']),$qtyArray['final_qty']))
1492
+ {
1493
+ $this->_UploadCsvErrors[] = array('error_type'=>'inventory_update_error','value'=>array('magento_sku'=>$data['magento_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1494
+ return false;
1495
+ }
1496
+ $this->conn->insertArray($tableVendorInventory,$dbFields,$dbFieldVal);
1497
+ return true;
1498
+ } catch ( Exception $e ) {
1499
+ Mage::logException($e);
1500
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
1501
+ }
1502
+
1503
+
1504
+ }
1505
+ protected function insertInventoryLog($ignoreData,$data,$isFtp)
1506
+ {
1507
+ $type = 'add';
1508
+ $vendorCode = ($isFtp) ? $data['lb_vendor_code'] : $this->_vendorCode;
1509
+ if(count($ignoreData)>0){
1510
+ (in_array('qty', $ignoreData)) ? $type = 'Cost Added, Qty Ignored' : '';
1511
+ (in_array('cost', $ignoreData)) ? $type = 'Qty Added, Cost Ignored' : '';
1512
+
1513
+ if(count($ignoreData)==2){
1514
+ $type = 'ignore';
1515
+ }
1516
+ }
1517
+ if($data['qty']==0.999999999)
1518
+ $data['qty'] = 0;
1519
+ $tableName = Mage::getSingleton("core/resource")->getTableName('dropship360/inventorylog');
1520
+ $updatedBy = (!$isFtp) ? Mage::getSingleton('admin/session')->getUser()->getUsername() : 'FTP';
1521
+ $dbFields = array('lb_vendor_code','lb_vendor_name','product_sku','cost','stock','updated_by','activity','updated_at','created_at');
1522
+ $dbFieldVal = array(
1523
+ array($vendorCode,$this->supplierName,$data['magento_sku'],$data['cost'],$data['qty'],$updatedBy,$type,now(),now())
1524
+ );
1525
+ try {
1526
+ $this->conn->insertArray($tableName,$dbFields,$dbFieldVal);
1527
+ return true;
1528
+ } catch ( Exception $e ) {
1529
+ Mage::logException($e);
1530
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
1531
+ }
1532
+
1533
+ }
1534
+ protected function checkAttributeAval($attr,$object){
1535
+ $isExist = false;
1536
+ $attrEav = Mage::getResourceModel('catalog/eav_attribute')->loadByCode('catalog_product',$attr);
1537
+ if ($attrEav->getId())
1538
+ $isExist = true;
1539
+ return $isExist;
1540
+ }
1541
+ }
app/code/community/Logicbroker/Dropship360/controllers/Adminhtml/InventoryController.php CHANGED
@@ -13,14 +13,14 @@ class Logicbroker_Dropship360_Adminhtml_InventoryController extends Mage_Adminht
13
  protected function _initAction()
14
  {
15
  $this->loadLayout()
16
- ->_setActiveMenu('logicbroker/inventory')
17
  ->_addBreadcrumb(Mage::helper('adminhtml')->__('Inventory Manager'), Mage::helper('adminhtml')->__('Inventory Manager'));
18
  return $this;
19
  }
20
 
21
  public function indexAction()
22
  {
23
- $this->_redirect('logicbroker/adminhtml_upload/index');
24
  $this->_initAction()->renderLayout();
25
  }
26
 
@@ -44,7 +44,7 @@ class Logicbroker_Dropship360_Adminhtml_InventoryController extends Mage_Adminht
44
  public function gridAction()
45
  {
46
  $this->getResponse()->setBody(
47
- $this->getLayout()->createBlock('logicbroker/adminhtml_inventory_grid')->toHtml()
48
  );
49
  }
50
 
@@ -54,7 +54,7 @@ class Logicbroker_Dropship360_Adminhtml_InventoryController extends Mage_Adminht
54
  public function exportCsvAction()
55
  {
56
  $fileName = 'vendor_inventory.csv';
57
- $content = $this->getLayout()->createBlock('logicbroker/adminhtml_inventory_grid')->getCsvFile();
58
  $this->_prepareDownloadResponse($fileName, $content);
59
  }
60
 
@@ -64,8 +64,18 @@ class Logicbroker_Dropship360_Adminhtml_InventoryController extends Mage_Adminht
64
  public function exportXmlAction()
65
  {
66
  $fileName = 'vendor_inventory.xml';
67
- $content = $this->getLayout()->createBlock('logicbroker/adminhtml_inventory_grid')->getExcelFile($fileName);
68
  $this->_prepareDownloadResponse($fileName, $content);
69
  }
 
 
 
 
 
 
 
 
 
 
70
 
71
  }
13
  protected function _initAction()
14
  {
15
  $this->loadLayout()
16
+ ->_setActiveMenu('dropship360/inventory')
17
  ->_addBreadcrumb(Mage::helper('adminhtml')->__('Inventory Manager'), Mage::helper('adminhtml')->__('Inventory Manager'));
18
  return $this;
19
  }
20
 
21
  public function indexAction()
22
  {
23
+ $this->_redirect('dropship360/adminhtml_upload/index');
24
  $this->_initAction()->renderLayout();
25
  }
26
 
44
  public function gridAction()
45
  {
46
  $this->getResponse()->setBody(
47
+ $this->getLayout()->createBlock('dropship360/adminhtml_inventory_grid')->toHtml()
48
  );
49
  }
50
 
54
  public function exportCsvAction()
55
  {
56
  $fileName = 'vendor_inventory.csv';
57
+ $content = $this->getLayout()->createBlock('dropship360/adminhtml_inventory_grid')->getCsvFile();
58
  $this->_prepareDownloadResponse($fileName, $content);
59
  }
60
 
64
  public function exportXmlAction()
65
  {
66
  $fileName = 'vendor_inventory.xml';
67
+ $content = $this->getLayout()->createBlock('dropship360/adminhtml_inventory_grid')->getExcelFile($fileName);
68
  $this->_prepareDownloadResponse($fileName, $content);
69
  }
70
+
71
+ /**
72
+ * Acl check for admin
73
+ *
74
+ * @return bool
75
+ */
76
+ protected function _isAllowed()
77
+ {
78
+ return Mage::getSingleton('admin/session')->isAllowed('dropship360/inventory');
79
+ }
80
 
81
  }
app/code/community/Logicbroker/Dropship360/controllers/Adminhtml/LogicbrokerController.php CHANGED
@@ -12,7 +12,7 @@ class Logicbroker_Dropship360_Adminhtml_LogicbrokerController extends Mage_Admin
12
 
13
  protected function _initAction() {
14
  $this->loadLayout()
15
- ->_setActiveMenu('logicbroker/suppliers')
16
  ->_addBreadcrumb(Mage::helper('adminhtml')->__('Supplier Manager'), Mage::helper('adminhtml')->__('Supplier Manager'));
17
 
18
  return $this;
@@ -31,6 +31,7 @@ class Logicbroker_Dropship360_Adminhtml_LogicbrokerController extends Mage_Admin
31
  'value' => '0',
32
  ));
33
  Mage::app()->getCacheInstance()->cleanType('config');
 
34
  $this->_redirectReferer();
35
  }
36
  /**
@@ -39,18 +40,18 @@ class Logicbroker_Dropship360_Adminhtml_LogicbrokerController extends Mage_Admin
39
 
40
  public function sourcinggridAction() {
41
 
42
- $this->getLayout()->createBlock('logicbroker/adminhtml_sourcing_grid')->toHtml();
43
  $this->loadLayout()->renderLayout();
44
 
45
  }
46
 
47
  public function gridAction() {
48
  $this->getResponse()->setBody(
49
- $this->getLayout()->createBlock('logicbroker/adminhtml_logicbroker_grid')->toHtml());
50
  }
51
  public function editAction() {
52
  $id = $this->getRequest()->getParam('vendor_id');
53
- $model = Mage::getModel('logicbroker/supplier')->load($id);
54
 
55
  if ($model->getVendorId() || $id == 0) {
56
  $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
@@ -61,17 +62,17 @@ class Logicbroker_Dropship360_Adminhtml_LogicbrokerController extends Mage_Admin
61
  Mage::register('logicbroker_data', $model);
62
 
63
  $this->loadLayout();
64
- $this->_setActiveMenu('logicbroker/suppliers');
65
 
66
  $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Supplier Manager'), Mage::helper('adminhtml')->__('Supplier Manager'));
67
  $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
68
 
69
- $this->_addContent($this->getLayout()->createBlock('logicbroker/adminhtml_logicbroker_edit'))
70
- ->_addLeft($this->getLayout()->createBlock('logicbroker/adminhtml_logicbroker_edit_tabs'));
71
 
72
  $this->renderLayout();
73
  } else {
74
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('logicbroker')->__('Supplier does not exist'));
75
  $this->_redirect('*/*/');
76
  }
77
  }
@@ -79,9 +80,9 @@ class Logicbroker_Dropship360_Adminhtml_LogicbrokerController extends Mage_Admin
79
  public function newAction()
80
  {
81
  $this->loadLayout();
82
- $this->_setActiveMenu('logicbroker/suppliers');
83
- $this->_addContent($this->getLayout()->createBlock('logicbroker/adminhtml_logicbroker_edit'))
84
- ->_addLeft($this->getLayout()->createBlock('logicbroker/adminhtml_logicbroker_edit_tabs'));
85
  $this->renderLayout();
86
 
87
  }
@@ -89,7 +90,7 @@ class Logicbroker_Dropship360_Adminhtml_LogicbrokerController extends Mage_Admin
89
  public function saveAction()
90
  {
91
  if ($data = $this->getRequest()->getPost()) {
92
- $model = Mage::getModel('logicbroker/supplier');
93
  if ($id = $this->getRequest()->getParam('vendor_id')) {//the parameter name may be different
94
  $model->load($id);
95
  }
@@ -114,7 +115,7 @@ class Logicbroker_Dropship360_Adminhtml_LogicbrokerController extends Mage_Admin
114
  }
115
  //validate compny id as unique
116
  if($validate == 1){
117
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('logicbroker')->__('Duplicate Company ID'));
118
  Mage::getSingleton('adminhtml/session')->setFormData($data);
119
  $this->_redirect('*/*/edit', array('vendor_id' => $model->getVendorId()));
120
  return;
@@ -122,10 +123,10 @@ class Logicbroker_Dropship360_Adminhtml_LogicbrokerController extends Mage_Admin
122
  $model->save();
123
 
124
  if(!empty($data['addnewoption'])){
125
- Mage::getModel('logicbroker/logicbroker')->createOptionValueOnSave($model->getMagentoVendorCode());
126
  }
127
  Mage::getSingleton('adminhtml/session')->setFormData(false);
128
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('logicbroker')->__($message));
129
 
130
  if ($this->getRequest()->getParam('back')) {
131
  $this->_redirect('*/*/edit', array('vendor_id' => $model->getVendorId()));
@@ -140,7 +141,7 @@ class Logicbroker_Dropship360_Adminhtml_LogicbrokerController extends Mage_Admin
140
  return;
141
  }
142
  }
143
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('logicbroker')->__('Unable to find Supplier to save'));
144
  $this->_redirect('*/*/');
145
  }
146
 
@@ -148,18 +149,18 @@ class Logicbroker_Dropship360_Adminhtml_LogicbrokerController extends Mage_Admin
148
  {
149
  if ($id = $this->getRequest()->getParam('vendor_id')) {
150
  try {
151
- $model = Mage::getModel('logicbroker/supplier');
152
  $model->load($id);
153
  $model->setData('status','deleted');
154
  $model->save();
155
- $collection = Mage::getModel('logicbroker/ranking')->getCollection()->addFieldToFilter('is_dropship','yes');
156
  $collection->getSelect()->order('ranking asc');
157
- $rank = Mage::getModel('logicbroker/ranking')->load($id)->getRanking();
158
  foreach($collection as $value){
159
- Mage::getModel('logicbroker/ranking')->rearrangeRank($value, $rank);
160
  }
161
- Mage::getModel('logicbroker/ranking')->load($id,'lb_vendor_id')->setRanking('')->setIsDropship('no')->setIsActive('no')->save();
162
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('logicbroker')->__('The Supplier has been deleted.'));
163
  $this->_redirect('*/*/');
164
  return;
165
 
@@ -172,7 +173,7 @@ class Logicbroker_Dropship360_Adminhtml_LogicbrokerController extends Mage_Admin
172
  }
173
  }
174
 
175
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('logicbroker')->__('Unable to find a Supplier to delete.'));
176
 
177
  $this->_redirect('*/*/');
178
  }
@@ -184,7 +185,7 @@ class Logicbroker_Dropship360_Adminhtml_LogicbrokerController extends Mage_Admin
184
  public function exportCsvAction()
185
  {
186
  $fileName = 'supplier.csv';
187
- $content = $this->getLayout()->createBlock('logicbroker/adminhtml_logicbroker_grid')->getCsvFile();
188
  $this->_prepareDownloadResponse($fileName, $content);
189
  }
190
 
@@ -194,14 +195,14 @@ class Logicbroker_Dropship360_Adminhtml_LogicbrokerController extends Mage_Admin
194
  public function exportXmlAction()
195
  {
196
  $fileName = 'supplier.xml';
197
- $content = $this->getLayout()->createBlock('logicbroker/adminhtml_logicbroker_grid')->getExcelFile($fileName);
198
  $this->_prepareDownloadResponse($fileName, $content);
199
  }
200
 
201
  public function validateajaxrequestAction()
202
  {
203
  $paramsArray = $this->getRequest()->getParams();
204
- $validation = Mage::getModel('logicbroker/logicbroker');
205
  $result = $validation->validation($paramsArray['groups']['integration']['fields']);
206
  $result = Mage::helper('core')->jsonEncode($result);
207
  Mage::app()->getResponse()->setBody($result);
@@ -217,11 +218,11 @@ class Logicbroker_Dropship360_Adminhtml_LogicbrokerController extends Mage_Admin
217
  if($data['lb_item_status']!=""){
218
  $order = Mage::getModel('sales/order')->load($data['order_id']);
219
  $orderStatus = $order->getStatus();
220
- $lbOrderItemInstance = Mage::getModel('logicbroker/orderitems')->getCollection()->addFieldToFilter('item_id', $data['lb_item_id']);
221
  try{
222
  if($lbOrderItemInstance->count() > 0){
223
  foreach($lbOrderItemInstance as $item){
224
- $itemStatusHistory = Mage::helper('logicbroker')->getSerialisedData($item, $data['lb_item_status'], $orderStatus);
225
  $item->setLbItemStatus($data['lb_item_status']);
226
  $item->setItemStatusHistory($itemStatusHistory);
227
  $item->setUpdatedBy('User');
@@ -229,13 +230,16 @@ class Logicbroker_Dropship360_Adminhtml_LogicbrokerController extends Mage_Admin
229
  $item->save();
230
  if($data['lb_item_status']==$item->getLbItemStatus()){
231
  $data['msg'] = $item->getSku().' status successfully changed to '.$data['lb_item_status'];
232
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('logicbroker')->__($data['msg']));
233
  }else{
234
  $data['msg'] = $item->getSku().' status unable to change to '.$data['lb_item_status'];
235
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('logicbroker')->__($data['msg']));
236
  }
237
  }
238
  }
 
 
 
239
  $result = Mage::helper('core')->jsonEncode($data);
240
  Mage::app()->getResponse()->setBody($result);
241
  }catch(Exception $e){
@@ -247,4 +251,14 @@ class Logicbroker_Dropship360_Adminhtml_LogicbrokerController extends Mage_Admin
247
  }
248
  }
249
 
 
 
 
 
 
 
 
 
 
 
250
  }
12
 
13
  protected function _initAction() {
14
  $this->loadLayout()
15
+ ->_setActiveMenu('dropship360/suppliers')
16
  ->_addBreadcrumb(Mage::helper('adminhtml')->__('Supplier Manager'), Mage::helper('adminhtml')->__('Supplier Manager'));
17
 
18
  return $this;
31
  'value' => '0',
32
  ));
33
  Mage::app()->getCacheInstance()->cleanType('config');
34
+ Mage::getSingleton('adminhtml/session')->setNotification(false);
35
  $this->_redirectReferer();
36
  }
37
  /**
40
 
41
  public function sourcinggridAction() {
42
 
43
+ $this->getLayout()->createBlock('dropship360/adminhtml_sourcing_grid')->toHtml();
44
  $this->loadLayout()->renderLayout();
45
 
46
  }
47
 
48
  public function gridAction() {
49
  $this->getResponse()->setBody(
50
+ $this->getLayout()->createBlock('dropship360/adminhtml_logicbroker_grid')->toHtml());
51
  }
52
  public function editAction() {
53
  $id = $this->getRequest()->getParam('vendor_id');
54
+ $model = Mage::getModel('dropship360/supplier')->load($id);
55
 
56
  if ($model->getVendorId() || $id == 0) {
57
  $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
62
  Mage::register('logicbroker_data', $model);
63
 
64
  $this->loadLayout();
65
+ $this->_setActiveMenu('dropship360/suppliers');
66
 
67
  $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Supplier Manager'), Mage::helper('adminhtml')->__('Supplier Manager'));
68
  $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
69
 
70
+ $this->_addContent($this->getLayout()->createBlock('dropship360/adminhtml_logicbroker_edit'))
71
+ ->_addLeft($this->getLayout()->createBlock('dropship360/adminhtml_logicbroker_edit_tabs'));
72
 
73
  $this->renderLayout();
74
  } else {
75
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship360')->__('Supplier does not exist'));
76
  $this->_redirect('*/*/');
77
  }
78
  }
80
  public function newAction()
81
  {
82
  $this->loadLayout();
83
+ $this->_setActiveMenu('dropship360/suppliers');
84
+ $this->_addContent($this->getLayout()->createBlock('dropship360/adminhtml_logicbroker_edit'))
85
+ ->_addLeft($this->getLayout()->createBlock('dropship360/adminhtml_logicbroker_edit_tabs'));
86
  $this->renderLayout();
87
 
88
  }
90
  public function saveAction()
91
  {
92
  if ($data = $this->getRequest()->getPost()) {
93
+ $model = Mage::getModel('dropship360/supplier');
94
  if ($id = $this->getRequest()->getParam('vendor_id')) {//the parameter name may be different
95
  $model->load($id);
96
  }
115
  }
116
  //validate compny id as unique
117
  if($validate == 1){
118
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship360')->__('Duplicate Company ID'));
119
  Mage::getSingleton('adminhtml/session')->setFormData($data);
120
  $this->_redirect('*/*/edit', array('vendor_id' => $model->getVendorId()));
121
  return;
123
  $model->save();
124
 
125
  if(!empty($data['addnewoption'])){
126
+ Mage::getModel('dropship360/logicbroker')->createOptionValueOnSave($model->getMagentoVendorCode());
127
  }
128
  Mage::getSingleton('adminhtml/session')->setFormData(false);
129
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('dropship360')->__($message));
130
 
131
  if ($this->getRequest()->getParam('back')) {
132
  $this->_redirect('*/*/edit', array('vendor_id' => $model->getVendorId()));
141
  return;
142
  }
143
  }
144
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship360')->__('Unable to find Supplier to save'));
145
  $this->_redirect('*/*/');
146
  }
147
 
149
  {
150
  if ($id = $this->getRequest()->getParam('vendor_id')) {
151
  try {
152
+ $model = Mage::getModel('dropship360/supplier');
153
  $model->load($id);
154
  $model->setData('status','deleted');
155
  $model->save();
156
+ $collection = Mage::getModel('dropship360/ranking')->getCollection()->addFieldToFilter('is_dropship','yes');
157
  $collection->getSelect()->order('ranking asc');
158
+ $rank = Mage::getModel('dropship360/ranking')->load($id)->getRanking();
159
  foreach($collection as $value){
160
+ Mage::getModel('dropship360/ranking')->rearrangeRank($value, $rank);
161
  }
162
+ Mage::getModel('dropship360/ranking')->load($id,'lb_vendor_id')->setRanking('')->setIsDropship('no')->setIsActive('no')->save();
163
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('dropship360')->__('The Supplier has been deleted.'));
164
  $this->_redirect('*/*/');
165
  return;
166
 
173
  }
174
  }
175
 
176
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship360')->__('Unable to find a Supplier to delete.'));
177
 
178
  $this->_redirect('*/*/');
179
  }
185
  public function exportCsvAction()
186
  {
187
  $fileName = 'supplier.csv';
188
+ $content = $this->getLayout()->createBlock('dropship360/adminhtml_logicbroker_grid')->getCsvFile();
189
  $this->_prepareDownloadResponse($fileName, $content);
190
  }
191
 
195
  public function exportXmlAction()
196
  {
197
  $fileName = 'supplier.xml';
198
+ $content = $this->getLayout()->createBlock('dropship360/adminhtml_logicbroker_grid')->getExcelFile($fileName);
199
  $this->_prepareDownloadResponse($fileName, $content);
200
  }
201
 
202
  public function validateajaxrequestAction()
203
  {
204
  $paramsArray = $this->getRequest()->getParams();
205
+ $validation = Mage::getModel('dropship360/logicbroker');
206
  $result = $validation->validation($paramsArray['groups']['integration']['fields']);
207
  $result = Mage::helper('core')->jsonEncode($result);
208
  Mage::app()->getResponse()->setBody($result);
218
  if($data['lb_item_status']!=""){
219
  $order = Mage::getModel('sales/order')->load($data['order_id']);
220
  $orderStatus = $order->getStatus();
221
+ $lbOrderItemInstance = Mage::getModel('dropship360/orderitems')->getCollection()->addFieldToFilter('item_id', $data['lb_item_id']);
222
  try{
223
  if($lbOrderItemInstance->count() > 0){
224
  foreach($lbOrderItemInstance as $item){
225
+ $itemStatusHistory = Mage::helper('dropship360')->getSerialisedData($item, $data['lb_item_status'], $orderStatus);
226
  $item->setLbItemStatus($data['lb_item_status']);
227
  $item->setItemStatusHistory($itemStatusHistory);
228
  $item->setUpdatedBy('User');
230
  $item->save();
231
  if($data['lb_item_status']==$item->getLbItemStatus()){
232
  $data['msg'] = $item->getSku().' status successfully changed to '.$data['lb_item_status'];
233
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('dropship360')->__($data['msg']));
234
  }else{
235
  $data['msg'] = $item->getSku().' status unable to change to '.$data['lb_item_status'];
236
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship360')->__($data['msg']));
237
  }
238
  }
239
  }
240
+ if($data['lb_item_status'] == 'Transmitting'){
241
+ Mage::getModel('dropship360/logicbroker')->setupNotification();
242
+ }
243
  $result = Mage::helper('core')->jsonEncode($data);
244
  Mage::app()->getResponse()->setBody($result);
245
  }catch(Exception $e){
251
  }
252
  }
253
 
254
+ /**
255
+ * Acl check for admin
256
+ *
257
+ * @return bool
258
+ */
259
+ protected function _isAllowed()
260
+ {
261
+ return Mage::getSingleton('admin/session')->isAllowed('dropship360/inventory');
262
+ }
263
+
264
  }
app/code/community/Logicbroker/Dropship360/controllers/Adminhtml/RankingController.php CHANGED
@@ -9,7 +9,7 @@
9
  class Logicbroker_Dropship360_Adminhtml_RankingController extends Mage_Adminhtml_Controller_Action {
10
 
11
  protected function _initAction() {
12
- $this->loadLayout ()->_setActiveMenu ( 'logicbroker/vendor_ranking' )->_addBreadcrumb ( Mage::helper ( 'adminhtml' )->__ ( 'Supplier Management' ), Mage::helper ( 'adminhtml' )->__ ( 'Supplier Management' ) );
13
  return $this;
14
  }
15
 
@@ -29,7 +29,7 @@ class Logicbroker_Dropship360_Adminhtml_RankingController extends Mage_Adminhtml
29
  * Ranking grid
30
  */
31
  public function gridAction() {
32
- $this->getResponse ()->setBody ( $this->getLayout ()->createBlock ( 'logicbroker/adminhtml_ranking_grid' )->toHtml () );
33
  }
34
 
35
  public function showhistoryAction() {
@@ -41,7 +41,7 @@ class Logicbroker_Dropship360_Adminhtml_RankingController extends Mage_Adminhtml
41
  $isSuccess = false;
42
  $data = $this->getRequest ()->getPost ();
43
  $arrVendor = array();
44
- $vendorRankCollection = Mage::getModel ( 'logicbroker/ranking' );
45
  $genrateVendorCode = $vendorRankCollection->getCollection()->addFieldToFilter('lb_vendor_code',array('like'=>'%MagVendID%'));
46
 
47
  foreach($genrateVendorCode as $vendorCode)
@@ -81,9 +81,10 @@ class Logicbroker_Dropship360_Adminhtml_RankingController extends Mage_Adminhtml
81
  $dropShip = json_decode((urldecode($data['dropship_data'])),true);
82
  $nonDropShip = json_decode((urldecode($data['nondropship_data'])),true);
83
  $vendorName = json_decode((urldecode($data['vendorname_data'])),true);
84
- $modelRanking = Mage::getModel ( 'logicbroker/rankinglog' )->load($tableName,'label');
 
85
  if (!$tableName || $modelRanking->getId()) {
86
- Mage::getSingleton ( 'adminhtml/session' )->addError ( Mage::helper ( 'logicbroker' )->__ ( 'Ranking Table Name Is Empty Or Already Exists' ) );
87
  $this->_redirect ( '*/*/' );
88
  return;
89
  }
@@ -103,15 +104,18 @@ class Logicbroker_Dropship360_Adminhtml_RankingController extends Mage_Adminhtml
103
  $this->_updateVendorName($val);
104
  }
105
  }
 
 
 
106
  $result = $this->_saveTableRanking(trim($tableName));
107
 
108
- Mage::getSingleton ( 'adminhtml/session' )->addSuccess ( Mage::helper ( 'logicbroker' )->__ ( 'Supplier ranking saved successfully' ) );
109
  $this->_redirect ( '*/*/' );
110
  return;
111
  }
112
  protected function _saveVendorRanking($key, $val, $rank = false) {
113
  try {
114
- $model = Mage::getModel ( 'logicbroker/ranking' )->load ( $val['code'], 'lb_vendor_code' );
115
  $model->setUpdatedAt(now());
116
 
117
  if($rank)
@@ -128,15 +132,10 @@ class Logicbroker_Dropship360_Adminhtml_RankingController extends Mage_Adminhtml
128
 
129
  protected function _updateVendorName($val) {
130
  try {
131
- $model = Mage::getModel ( 'logicbroker/ranking' )->load ( $val['code'], 'lb_vendor_code' );
132
  if($model->getLbVendorCode())
133
  $model->setLbVendorName ($val['name'])->save();
134
- $modelInventoryCollection = Mage::getModel ( 'logicbroker/inventory' )->getCollection();
135
- $modelInventoryCollection->addFieldToFilter('lb_vendor_code',$val['code']);
136
- foreach($modelInventoryCollection as $modelInventory){
137
- $inventoryModel = Mage::getModel ( 'logicbroker/inventory' )->load($modelInventory->getId());
138
- $inventoryModel->setLbVendorName($val['name'])->save();
139
- }
140
  } catch ( Exception $e ) {
141
  Mage::getSingleton ( 'adminhtml/session' )->addError ( $e->getMessage () );
142
  }
@@ -144,8 +143,8 @@ class Logicbroker_Dropship360_Adminhtml_RankingController extends Mage_Adminhtml
144
 
145
  protected function _saveTableRanking($tableName) {
146
  $serializedArray = array ();
147
- $model = Mage::getModel ( 'logicbroker/ranking' );
148
- $modelRanking = Mage::getModel ( 'logicbroker/rankinglog' );
149
  $collection = $model->getCollection ();
150
  $collection->getSelect()->order('ranking asc');
151
  if($collection->count() > 0){
@@ -153,9 +152,9 @@ class Logicbroker_Dropship360_Adminhtml_RankingController extends Mage_Adminhtml
153
  $serializedArray [] = array (
154
  $value->getLbVendorName (),
155
  $value->getLbVendorCode (),
 
156
  $value->getRanking (),
157
  $value->getIsDropship()
158
-
159
  );
160
  }
161
  $modelRanking->setRankingData ( serialize ( $serializedArray ) );
@@ -169,4 +168,44 @@ class Logicbroker_Dropship360_Adminhtml_RankingController extends Mage_Adminhtml
169
  }
170
  return;
171
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
172
  }
9
  class Logicbroker_Dropship360_Adminhtml_RankingController extends Mage_Adminhtml_Controller_Action {
10
 
11
  protected function _initAction() {
12
+ $this->loadLayout ()->_setActiveMenu ( 'dropship360/vendor_ranking' )->_addBreadcrumb ( Mage::helper ( 'adminhtml' )->__ ( 'Supplier Management' ), Mage::helper ( 'adminhtml' )->__ ( 'Supplier Management' ) );
13
  return $this;
14
  }
15
 
29
  * Ranking grid
30
  */
31
  public function gridAction() {
32
+ $this->getResponse ()->setBody ( $this->getLayout ()->createBlock ( 'dropship360/adminhtml_ranking_grid' )->toHtml () );
33
  }
34
 
35
  public function showhistoryAction() {
41
  $isSuccess = false;
42
  $data = $this->getRequest ()->getPost ();
43
  $arrVendor = array();
44
+ $vendorRankCollection = Mage::getModel ( 'dropship360/ranking' );
45
  $genrateVendorCode = $vendorRankCollection->getCollection()->addFieldToFilter('lb_vendor_code',array('like'=>'%MagVendID%'));
46
 
47
  foreach($genrateVendorCode as $vendorCode)
81
  $dropShip = json_decode((urldecode($data['dropship_data'])),true);
82
  $nonDropShip = json_decode((urldecode($data['nondropship_data'])),true);
83
  $vendorName = json_decode((urldecode($data['vendorname_data'])),true);
84
+ $vendorProductLink = json_decode((urldecode($data['vendorproductlink_data'])),true);
85
+ $modelRanking = Mage::getModel ( 'dropship360/rankinglog' )->load($tableName,'label');
86
  if (!$tableName || $modelRanking->getId()) {
87
+ Mage::getSingleton ( 'adminhtml/session' )->addError ( Mage::helper ( 'dropship360' )->__ ( 'Ranking Table Name Is Empty Or Already Exists' ) );
88
  $this->_redirect ( '*/*/' );
89
  return;
90
  }
104
  $this->_updateVendorName($val);
105
  }
106
  }
107
+ foreach ($vendorProductLink as $value) {
108
+ $this->saveProductLinking($value);
109
+ }
110
  $result = $this->_saveTableRanking(trim($tableName));
111
 
112
+ Mage::getSingleton ( 'adminhtml/session' )->addSuccess ( Mage::helper ( 'dropship360' )->__ ( 'Supplier ranking saved successfully' ) );
113
  $this->_redirect ( '*/*/' );
114
  return;
115
  }
116
  protected function _saveVendorRanking($key, $val, $rank = false) {
117
  try {
118
+ $model = Mage::getModel ( 'dropship360/ranking' )->load ( $val['code'], 'lb_vendor_code' );
119
  $model->setUpdatedAt(now());
120
 
121
  if($rank)
132
 
133
  protected function _updateVendorName($val) {
134
  try {
135
+ $model = Mage::getModel ( 'dropship360/ranking' )->load ( $val['code'], 'lb_vendor_code' );
136
  if($model->getLbVendorCode())
137
  $model->setLbVendorName ($val['name'])->save();
138
+ Mage::getModel ( 'dropship360/inventory' )->upDateVendorName($val);
 
 
 
 
 
139
  } catch ( Exception $e ) {
140
  Mage::getSingleton ( 'adminhtml/session' )->addError ( $e->getMessage () );
141
  }
143
 
144
  protected function _saveTableRanking($tableName) {
145
  $serializedArray = array ();
146
+ $model = Mage::getModel ( 'dropship360/ranking' );
147
+ $modelRanking = Mage::getModel ( 'dropship360/rankinglog' );
148
  $collection = $model->getCollection ();
149
  $collection->getSelect()->order('ranking asc');
150
  if($collection->count() > 0){
152
  $serializedArray [] = array (
153
  $value->getLbVendorName (),
154
  $value->getLbVendorCode (),
155
+ $this->getAttributeCode($value->getLinkingAttribute()),
156
  $value->getRanking (),
157
  $value->getIsDropship()
 
158
  );
159
  }
160
  $modelRanking->setRankingData ( serialize ( $serializedArray ) );
168
  }
169
  return;
170
  }
171
+ protected function getAttributeCode($code)
172
+ {
173
+ $helper = Mage::helper('dropship360');
174
+ switch ($code) {
175
+ case $helper::LOGICBROKER_PRODUCT_LINK_CODE_UPC:
176
+ return $helper::LOGICBROKER_PRODUCT_LINK_UPC;
177
+ break;
178
+ case $helper::LOGICBROKER_PRODUCT_LINK_CODE_MNP:
179
+ return $helper::LOGICBROKER_PRODUCT_LINK_MNP;
180
+ break;
181
+ case $helper::LOGICBROKER_PRODUCT_LINK_CODE_SKU:
182
+ return $helper::LOGICBROKER_PRODUCT_LINK_SKU;
183
+ break;
184
+ default:
185
+ return $helper::LOGICBROKER_PRODUCT_LINK_NONE;
186
+ }
187
+ }
188
+ protected function saveProductLinking($data)
189
+ {
190
+ if(empty($data))
191
+ return ;
192
+ try {
193
+ $model = Mage::getModel ( 'dropship360/ranking' )->load ( $data['code'], 'lb_vendor_code' );
194
+ $model->setUpdatedAt(now());
195
+ $model->setLinkingAttribute($data['attr']);
196
+ $model->save ();
197
+ } catch ( Exception $e ) {
198
+ Mage::getSingleton ( 'adminhtml/session' )->addError ( $e->getMessage () );
199
+ }
200
+ }
201
+
202
+ /**
203
+ * Acl check for admin
204
+ *
205
+ * @return bool
206
+ */
207
+ protected function _isAllowed()
208
+ {
209
+ return (Mage::getSingleton('admin/session')->isAllowed('dropship360/suppliers') || Mage::getSingleton('admin/session')->isAllowed('dropship360/vendor_ranking'));
210
+ }
211
  }
app/code/community/Logicbroker/Dropship360/controllers/Adminhtml/ReportController.php CHANGED
@@ -12,7 +12,7 @@ class Logicbroker_Dropship360_Adminhtml_ReportController extends Mage_Adminhtml_
12
 
13
  protected function _initAction() {
14
  $this->loadLayout()
15
- ->_setActiveMenu('logicbroker/bar_report')
16
  ->_addBreadcrumb(Mage::helper('adminhtml')->__('Report'), Mage::helper('adminhtml')->__('Report'));
17
 
18
  return $this;
@@ -54,7 +54,8 @@ class Logicbroker_Dropship360_Adminhtml_ReportController extends Mage_Adminhtml_
54
  $formData = Mage::helper('adminhtml')->prepareFilterString($this->getRequest()->getParam('refresh'));
55
  $this->_prepareReportData($formData);
56
  Mage::getSingleton('adminhtml/session')->setFormData($formData);
57
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('logicbroker')->__('Report Refreshed Successfully '));
 
58
  $this->renderLayout();
59
  return $this;
60
  }
@@ -64,21 +65,21 @@ class Logicbroker_Dropship360_Adminhtml_ReportController extends Mage_Adminhtml_
64
  //print_r($data);
65
  //die();
66
  $formData['email'] = rtrim($formData['email'],',');
67
- Mage::getModel('logicbroker/report')->saveReportData('business_activity_monitor', $formData);
68
  $this->_prepareReportData($formData);
69
  Mage::getSingleton('adminhtml/session')->setFormData($formData);
70
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('logicbroker')->__('Report Data Save Successfully '));
71
  $this->_redirect('*/*/activitymonitor');
72
  }else
73
  {
74
- $formData = Mage::getModel('logicbroker/report')->getActivityReportData();
75
  if(is_array($formData) && !empty($formData)){
76
  $this->_prepareReportData($formData);
77
  Mage::getSingleton('adminhtml/session')->setFormData($formData);
78
  }
79
 
80
  }
81
-
82
  $this->renderLayout();
83
  return $this;
84
  }
@@ -86,7 +87,7 @@ class Logicbroker_Dropship360_Adminhtml_ReportController extends Mage_Adminhtml_
86
 
87
  protected function _prepareReportData($data = array()){
88
 
89
- $collection = Mage::getModel('logicbroker/report')->activityReportCollection($data)->getBlockGraphData();
90
  Mage::register('activity_report_collection', $collection['collection']);
91
  $this->getLayout()->getBlock('report.activitymonitor')->setData(array('totalDropshipOrder'=>$collection['totalDropshipOrder'],'dropshipStatus'=> $collection['dropshipStatus']));
92
  }
@@ -98,7 +99,7 @@ class Logicbroker_Dropship360_Adminhtml_ReportController extends Mage_Adminhtml_
98
  */
99
  public function chooserAction()
100
  {
101
- $block = $this->getLayout()->createBlock('logicbroker/adminhtml_reports_activitymonitor_email', 'adminhtml_chooser_email');
102
 
103
  if ($block) {
104
  $this->getResponse()->setBody($block->toHtml());
@@ -106,5 +107,15 @@ class Logicbroker_Dropship360_Adminhtml_ReportController extends Mage_Adminhtml_
106
 
107
  }
108
 
 
 
 
 
 
 
 
 
 
 
109
 
110
  }
12
 
13
  protected function _initAction() {
14
  $this->loadLayout()
15
+ ->_setActiveMenu('dropship360/bar_report')
16
  ->_addBreadcrumb(Mage::helper('adminhtml')->__('Report'), Mage::helper('adminhtml')->__('Report'));
17
 
18
  return $this;
54
  $formData = Mage::helper('adminhtml')->prepareFilterString($this->getRequest()->getParam('refresh'));
55
  $this->_prepareReportData($formData);
56
  Mage::getSingleton('adminhtml/session')->setFormData($formData);
57
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('dropship360')->__('Report Refreshed Successfully '));
58
+ Mage::app()->getCacheInstance()->cleanType('config');
59
  $this->renderLayout();
60
  return $this;
61
  }
65
  //print_r($data);
66
  //die();
67
  $formData['email'] = rtrim($formData['email'],',');
68
+ Mage::getModel('dropship360/report')->saveReportData('business_activity_monitor', $formData);
69
  $this->_prepareReportData($formData);
70
  Mage::getSingleton('adminhtml/session')->setFormData($formData);
71
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('dropship360')->__('Report Data Save Successfully '));
72
  $this->_redirect('*/*/activitymonitor');
73
  }else
74
  {
75
+ $formData = Mage::getModel('dropship360/report')->getActivityReportData();
76
  if(is_array($formData) && !empty($formData)){
77
  $this->_prepareReportData($formData);
78
  Mage::getSingleton('adminhtml/session')->setFormData($formData);
79
  }
80
 
81
  }
82
+ Mage::app()->getCacheInstance()->cleanType('config');
83
  $this->renderLayout();
84
  return $this;
85
  }
87
 
88
  protected function _prepareReportData($data = array()){
89
 
90
+ $collection = Mage::getModel('dropship360/report')->activityReportCollection($data)->getBlockGraphData();
91
  Mage::register('activity_report_collection', $collection['collection']);
92
  $this->getLayout()->getBlock('report.activitymonitor')->setData(array('totalDropshipOrder'=>$collection['totalDropshipOrder'],'dropshipStatus'=> $collection['dropshipStatus']));
93
  }
99
  */
100
  public function chooserAction()
101
  {
102
+ $block = $this->getLayout()->createBlock('dropship360/adminhtml_reports_activitymonitor_email', 'adminhtml_chooser_email');
103
 
104
  if ($block) {
105
  $this->getResponse()->setBody($block->toHtml());
107
 
108
  }
109
 
110
+ /**
111
+ * Acl check for admin
112
+ *
113
+ * @return bool
114
+ */
115
+ protected function _isAllowed()
116
+ {
117
+ return Mage::getSingleton('admin/session')->isAllowed('dropship360/bar_report');
118
+ }
119
+
120
 
121
  }
app/code/community/Logicbroker/Dropship360/controllers/Adminhtml/SourcingController.php CHANGED
@@ -12,7 +12,7 @@ class Logicbroker_Dropship360_Adminhtml_SourcingController extends Mage_Adminhtm
12
 
13
  protected function _initAction() {
14
  $this->loadLayout()
15
- ->_setActiveMenu('logicbroker/order_sourcing')
16
  ->_addBreadcrumb(Mage::helper('adminhtml')->__('PO Management'), Mage::helper('adminhtml')->__('PO Management'));
17
 
18
  return $this;
@@ -28,13 +28,13 @@ class Logicbroker_Dropship360_Adminhtml_SourcingController extends Mage_Adminhtm
28
 
29
  public function sourcinggridAction() {
30
  $this->_initAction() ->_title($this->__('PO Management'));
31
- $this->getLayout()->createBlock('logicbroker/adminhtml_sourcing_grid')->toHtml();
32
  $this->loadLayout()->renderLayout();
33
 
34
  }
35
  public function editAction() {
36
  $id = $this->getRequest()->getParam('lb_item_id');
37
- $model = Mage::getModel('logicbroker/orderitems')->load($id);
38
 
39
  if ($model->getId()) {
40
  $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
@@ -44,13 +44,13 @@ class Logicbroker_Dropship360_Adminhtml_SourcingController extends Mage_Adminhtm
44
  Mage::register('sourcing_data', $model);
45
 
46
  $this->loadLayout();
47
- $this->_setActiveMenu('logicbroker/order_sourcing');
48
  $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Order Sourcing'), Mage::helper('adminhtml')->__('Order Sourcing'));
49
- $this->_addContent($this->getLayout()->createBlock('logicbroker/adminhtml_sourcing_edit'))
50
- ->_addLeft($this->getLayout()->createBlock('logicbroker/adminhtml_sourcing_edit_tabs'));
51
  $this->renderLayout();
52
  } else {
53
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('logicbroker')->__('Sourcing does not exist'));
54
  $this->_redirect('*/*/sourcinggrid');
55
  }
56
  }
@@ -58,18 +58,18 @@ class Logicbroker_Dropship360_Adminhtml_SourcingController extends Mage_Adminhtm
58
  if ($data = $this->getRequest()->getPost()) {
59
  $vendorCode = $data['lb_vendor_code'];
60
  $sku = $data['sku'];
61
- $model = Mage::getModel('logicbroker/orderitems');
62
  $model->load($this->getRequest()->getParam('lb_item_id'));
63
  $order = Mage::getModel('sales/order')->load($model->getItemOrderId());
64
  $orderStatus = $order->getStatus();
65
  if($this->getRequest()->getParam('cancel') == 'item'){
66
- $itemStatusHistory = Mage::helper('logicbroker')->getSerialisedData($model->load($this->getRequest()->getParam('lb_item_id')), 'Cancelled', $orderStatus);
67
  $model->setLbItemStatus('Cancelled');
68
  $model->setUpdatedBy('User');
69
  $model->setItemStatusHistory($itemStatusHistory);
70
  try{
71
  $model->save();
72
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('logicbroker')->__('Item %s Cancelled Successfully ',$model->getSku()));
73
 
74
  }catch(Exception $e){
75
  Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
@@ -82,17 +82,17 @@ class Logicbroker_Dropship360_Adminhtml_SourcingController extends Mage_Adminhtm
82
  }
83
 
84
  if(!$data['lb_vendor_code']){
85
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('logicbroker')->__('Under Processing By Logicbroker Can Not Update %s Sku',$model->getSku()));
86
  $this->_redirect('*/*/sourcinggrid');
87
  return;
88
  }
89
- $itemStatusHistory = Mage::helper('logicbroker')->getSerialisedData($model->load($this->getRequest()->getParam('lb_item_id')), 'Transmitting', $orderStatus);
90
  $arrData = $model->updateSourcingByUser(array('lb_vendor_code'=>$vendorCode,'product_sku'=>$sku, 'qty'=>$this->getRequest()->getParam('qty'), 'item_status_history'=>$itemStatusHistory));
91
  $model->addData($arrData);
92
  try {
93
  $model->save();
94
  Mage::getSingleton('adminhtml/session')->setFormData(false);
95
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('logicbroker')->__('Sourcing Updated For %s',$model->getSku()));
96
 
97
  if ($this->getRequest()->getParam('back')) {
98
  $this->_redirect('*/*/edit', array('lb_item_id' => $model->getId()));
@@ -107,7 +107,7 @@ class Logicbroker_Dropship360_Adminhtml_SourcingController extends Mage_Adminhtm
107
  return;
108
  }
109
  }
110
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('logicbroker')->__('Unable to save sourcing'));
111
  $this->_redirect('*/*/sourcinggrid');
112
  }
113
 
@@ -116,7 +116,8 @@ class Logicbroker_Dropship360_Adminhtml_SourcingController extends Mage_Adminhtm
116
  $paramsArray = $this->getRequest()->getParams();
117
  if(!empty($paramsArray['user_id']) && !empty($paramsArray['api_key'])){
118
  Mage::getModel('api/user')->load($paramsArray['user_id'])->setApiKey($paramsArray['api_key'])->save();
119
- Mage::getModel('logicbroker/logicbroker')->send(null,array());
 
120
  $result['message'] = 'password save successfully';
121
  }else{
122
  $result['message'] = 'can not save password';
@@ -133,7 +134,7 @@ class Logicbroker_Dropship360_Adminhtml_SourcingController extends Mage_Adminhtm
133
  public function exportCsvAction()
134
  {
135
  $fileName = 'sourcing.csv';
136
- $content = $this->getLayout()->createBlock('logicbroker/adminhtml_sourcing_grid')->getCsvFile();
137
  $this->_prepareDownloadResponse($fileName, $content);
138
  }
139
 
@@ -143,7 +144,7 @@ class Logicbroker_Dropship360_Adminhtml_SourcingController extends Mage_Adminhtm
143
  public function exportXmlAction()
144
  {
145
  $fileName = 'sourcing.xml';
146
- $content = $this->getLayout()->createBlock('logicbroker/adminhtml_sourcing_grid')->getExcelFile($fileName);
147
  $this->_prepareDownloadResponse($fileName, $content);
148
  }
149
 
@@ -153,17 +154,28 @@ class Logicbroker_Dropship360_Adminhtml_SourcingController extends Mage_Adminhtm
153
 
154
  $this->_initAction();
155
  $itemId = $this->getRequest()->getParam('lb_item_id');
156
- $orderItems = Mage::getModel( 'logicbroker/orderitems' )->load($itemId, 'item_id');
157
 
158
  $this->_title(sprintf("Item Sku %s", $orderItems->getSku()));
159
 
160
  $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
161
 
162
- $this->_addContent($this->getLayout()->createBlock('logicbroker/adminhtml_sourcing_history_view'))
163
- ->_addLeft($this->getLayout()->createBlock('logicbroker/adminhtml_sourcing_history_view_tabs'));
164
 
165
  $this->renderLayout();
166
 
167
  }
168
 
 
 
 
 
 
 
 
 
 
 
 
169
  }
12
 
13
  protected function _initAction() {
14
  $this->loadLayout()
15
+ ->_setActiveMenu('dropship360/order_sourcing')
16
  ->_addBreadcrumb(Mage::helper('adminhtml')->__('PO Management'), Mage::helper('adminhtml')->__('PO Management'));
17
 
18
  return $this;
28
 
29
  public function sourcinggridAction() {
30
  $this->_initAction() ->_title($this->__('PO Management'));
31
+ $this->getLayout()->createBlock('dropship360/adminhtml_sourcing_grid')->toHtml();
32
  $this->loadLayout()->renderLayout();
33
 
34
  }
35
  public function editAction() {
36
  $id = $this->getRequest()->getParam('lb_item_id');
37
+ $model = Mage::getModel('dropship360/orderitems')->load($id);
38
 
39
  if ($model->getId()) {
40
  $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
44
  Mage::register('sourcing_data', $model);
45
 
46
  $this->loadLayout();
47
+ $this->_setActiveMenu('dropship360/order_sourcing');
48
  $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Order Sourcing'), Mage::helper('adminhtml')->__('Order Sourcing'));
49
+ $this->_addContent($this->getLayout()->createBlock('dropship360/adminhtml_sourcing_edit'))
50
+ ->_addLeft($this->getLayout()->createBlock('dropship360/adminhtml_sourcing_edit_tabs'));
51
  $this->renderLayout();
52
  } else {
53
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship360')->__('Sourcing does not exist'));
54
  $this->_redirect('*/*/sourcinggrid');
55
  }
56
  }
58
  if ($data = $this->getRequest()->getPost()) {
59
  $vendorCode = $data['lb_vendor_code'];
60
  $sku = $data['sku'];
61
+ $model = Mage::getModel('dropship360/orderitems');
62
  $model->load($this->getRequest()->getParam('lb_item_id'));
63
  $order = Mage::getModel('sales/order')->load($model->getItemOrderId());
64
  $orderStatus = $order->getStatus();
65
  if($this->getRequest()->getParam('cancel') == 'item'){
66
+ $itemStatusHistory = Mage::helper('dropship360')->getSerialisedData($model->load($this->getRequest()->getParam('lb_item_id')), 'Cancelled', $orderStatus);
67
  $model->setLbItemStatus('Cancelled');
68
  $model->setUpdatedBy('User');
69
  $model->setItemStatusHistory($itemStatusHistory);
70
  try{
71
  $model->save();
72
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('dropship360')->__('Item %s Cancelled Successfully ',$model->getSku()));
73
 
74
  }catch(Exception $e){
75
  Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
82
  }
83
 
84
  if(!$data['lb_vendor_code']){
85
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship360')->__('Under Processing By Logicbroker Can Not Update %s Sku',$model->getSku()));
86
  $this->_redirect('*/*/sourcinggrid');
87
  return;
88
  }
89
+ $itemStatusHistory = Mage::helper('dropship360')->getSerialisedData($model->load($this->getRequest()->getParam('lb_item_id')), 'Transmitting', $orderStatus);
90
  $arrData = $model->updateSourcingByUser(array('lb_vendor_code'=>$vendorCode,'product_sku'=>$sku, 'qty'=>$this->getRequest()->getParam('qty'), 'item_status_history'=>$itemStatusHistory));
91
  $model->addData($arrData);
92
  try {
93
  $model->save();
94
  Mage::getSingleton('adminhtml/session')->setFormData(false);
95
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('dropship360')->__('Sourcing Updated For %s',$model->getSku()));
96
 
97
  if ($this->getRequest()->getParam('back')) {
98
  $this->_redirect('*/*/edit', array('lb_item_id' => $model->getId()));
107
  return;
108
  }
109
  }
110
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship360')->__('Unable to save sourcing'));
111
  $this->_redirect('*/*/sourcinggrid');
112
  }
113
 
116
  $paramsArray = $this->getRequest()->getParams();
117
  if(!empty($paramsArray['user_id']) && !empty($paramsArray['api_key'])){
118
  Mage::getModel('api/user')->load($paramsArray['user_id'])->setApiKey($paramsArray['api_key'])->save();
119
+ if(is_null(Mage::getSingleton('adminhtml/session')->getNotification()))
120
+ Mage::getModel('dropship360/logicbroker')->send(null,array());
121
  $result['message'] = 'password save successfully';
122
  }else{
123
  $result['message'] = 'can not save password';
134
  public function exportCsvAction()
135
  {
136
  $fileName = 'sourcing.csv';
137
+ $content = $this->getLayout()->createBlock('dropship360/adminhtml_sourcing_grid')->getCsvFile();
138
  $this->_prepareDownloadResponse($fileName, $content);
139
  }
140
 
144
  public function exportXmlAction()
145
  {
146
  $fileName = 'sourcing.xml';
147
+ $content = $this->getLayout()->createBlock('dropship360/adminhtml_sourcing_grid')->getExcelFile($fileName);
148
  $this->_prepareDownloadResponse($fileName, $content);
149
  }
150
 
154
 
155
  $this->_initAction();
156
  $itemId = $this->getRequest()->getParam('lb_item_id');
157
+ $orderItems = Mage::getModel( 'dropship360/orderitems' )->load($itemId, 'item_id');
158
 
159
  $this->_title(sprintf("Item Sku %s", $orderItems->getSku()));
160
 
161
  $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
162
 
163
+ $this->_addContent($this->getLayout()->createBlock('dropship360/adminhtml_sourcing_history_view'))
164
+ ->_addLeft($this->getLayout()->createBlock('dropship360/adminhtml_sourcing_history_view_tabs'));
165
 
166
  $this->renderLayout();
167
 
168
  }
169
 
170
+ /**
171
+ * Acl check for admin
172
+ *
173
+ * @return bool
174
+ */
175
+ protected function _isAllowed()
176
+ {
177
+ return Mage::getSingleton('admin/session')->isAllowed('dropship360/order_sourcing');
178
+ }
179
+
180
+
181
  }
app/code/community/Logicbroker/Dropship360/controllers/Adminhtml/UploadController.php CHANGED
@@ -13,8 +13,8 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
13
  protected function _initAction()
14
  {
15
  $this->loadLayout()
16
- ->_setActiveMenu('logicbroker/upload_vendor_product')
17
- ->_addBreadcrumb(Mage::helper('adminhtml')->__('logicbroker'), Mage::helper('adminhtml')->__('Supplier Inventory'));
18
  return $this;
19
  }
20
 
@@ -35,7 +35,7 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
35
  public function gridAction()
36
  {
37
  $this->getResponse()->setBody(
38
- $this->getLayout()->createBlock('logicbroker/adminhtml_inventory_grid')->toHtml()
39
  );
40
  }
41
  public function uploadFileAction()
@@ -50,22 +50,22 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
50
  {
51
  $redirectUrl = '*/*/index';
52
  }
53
- if(Mage::helper('logicbroker')->isProcessRunning('bulk_assign')){
54
  $this->_getSession()->addError($this->__('Bulk product setup is currently running please try again later'));
55
  $this->_redirect($redirectUrl);
56
  return;
57
  }
58
  if ($data) {
59
  try {
60
- $import = Mage::getModel('logicbroker/uploadvendor');
61
  $validationResult = $import->setData($data)->uploadSource();
62
  if(!$validationResult){
63
  $this->initialize();
64
  $import->parseCsv(Mage::registry('file_name'),$data['vendor']);
65
- $this->_getSession()->addSuccess(Mage::helper('logicbroker')->__('File upload successfully '));
66
  $this->finalize();
67
  }else{
68
- $this->_getSession()->addError(Mage::helper('logicbroker')->__('File cannot be uploaded '));
69
  }
70
  } catch (Exception $e) {
71
  $this->_getSession()->addError($e->getMessage());
@@ -80,11 +80,11 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
80
  }
81
 
82
  protected function initialize(){
83
- Mage::helper('logicbroker')->startProcess('manual_upload');
84
  }
85
 
86
  protected function finalize(){
87
- Mage::helper('logicbroker')->finishProcess('manual_upload');
88
  }
89
 
90
  public function vendorsuploadhistoryAction()
@@ -98,7 +98,7 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
98
  public function editAction()
99
  {
100
  $id = $this->getRequest()->getParam('lb_item_id');
101
- $model = Mage::getModel('logicbroker/orderitems')->load($id);
102
  if ($model->getId()) {
103
  $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
104
  if (!empty($data)) {
@@ -106,13 +106,13 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
106
  }
107
  Mage::register('sourcing_data', $model);
108
  $this->loadLayout();
109
- $this->_setActiveMenu('logicbroker/order_sourcing');
110
  $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Order Sourcing'), Mage::helper('adminhtml')->__('Order Sourcing'));
111
- $this->_addContent($this->getLayout()->createBlock('logicbroker/adminhtml_sourcing_edit'))
112
- ->_addLeft($this->getLayout()->createBlock('logicbroker/adminhtml_sourcing_edit_tabs'));
113
  $this->renderLayout();
114
  } else {
115
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('logicbroker')->__('Sourcing does not exist'));
116
  $this->_redirect('*/*/sourcinggrid');
117
  }
118
  }
@@ -121,7 +121,7 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
121
  public function validateftpconnectionAction()
122
  {
123
  $paramsArray = $this->getRequest()->getParams();
124
- $validateConnection = Mage::getModel('logicbroker/uploadvendor');
125
  $result = $validateConnection->testFtpConnection($paramsArray['groups']['cron_settings_upload']['fields']);
126
  $result = Mage::helper('core')->jsonEncode($result);
127
  Mage::app()->getResponse()->setBody($result);
@@ -133,14 +133,14 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
133
  if ($data = $this->getRequest()->getPost()) {
134
  $vendorCode = $data['lb_vendor_code'];
135
  $sku = $data['sku'];
136
- $model = Mage::getModel('logicbroker/orderitems');
137
 
138
  if($this->getRequest()->getParam('cancel') == 'item'){
139
  $model->load($this->getRequest()->getParam('lb_item_id'));
140
  $model->setLbItemStatus('Cancelled');
141
  try{
142
  $model->save();
143
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('logicbroker')->__('Item %s Cancelled Successfully ',$model->getSku()));
144
 
145
  }catch(Exception $e){
146
  Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
@@ -153,7 +153,7 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
153
  }
154
 
155
  if(!$data['lb_vendor_code']){
156
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('logicbroker')->__('Under Processing By Logicbroker Can Not Update %s Sku',$model->getSku()));
157
  $this->_redirect('*/*/sourcinggrid');
158
  return;
159
  }
@@ -163,7 +163,7 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
163
  $model->save();
164
  $model->updateOrderStatus($model->getItemOrderId(),$model->getItemId());
165
  Mage::getSingleton('adminhtml/session')->setFormData(false);
166
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('logicbroker')->__('Sourcing Updated For %s',$model->getSku()));
167
  if ($this->getRequest()->getParam('back')) {
168
  $this->_redirect('*/*/edit', array('lb_item_id' => $model->getId()));
169
  return;
@@ -177,7 +177,7 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
177
  return;
178
  }
179
  }
180
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('logicbroker')->__('Unable to save sourcing'));
181
  $this->_redirect('*/*/sourcinggrid');
182
  }
183
 
@@ -214,7 +214,7 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
214
  $isProductSetupMode = (isset($paramsArray['isproductsetupmode']) && $paramsArray['isproductsetupmode']) ? true : false;
215
  $type = ($isProductSetupMode) ? 'setup' : 'upload';
216
  $fileName = 'logicbroker_supplier_product_'.$type.'.csv';
217
- $content = Mage::getModel('logicbroker/uploadvendor')->getCsvFile($isProductSetupMode);
218
  $this->_prepareDownloadResponse($fileName, $content);
219
  $this->_redirect('*/*/index');
220
 
@@ -224,7 +224,7 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
224
 
225
  protected function _initSystem()
226
  {
227
- $this->_title($this->__('logicbroker'))
228
  ->_title($this->__('Bulk vendor assignment'));
229
  $vendorCode = $this->getRequest()->getParam('lb_vendor_code');
230
  if (!$vendorCode) {
@@ -250,23 +250,23 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
250
  if (!is_array($rowIds) || count($rowIds) < 1) {
251
  return;
252
  }
253
- $vendorName = Mage::getModel('logicbroker/ranking')->load($vendorCode,'lb_vendor_code');
254
  $errors = array();
255
  $saved = 0;
256
  $skuError = array();
257
  $skuSuccuess = array();
258
  if(!Mage::getSingleton('adminhtml/session')->getTerminateExecution()){
259
- Mage::helper('logicbroker')->startProcess('bulk_assign');
260
  }else
261
  {
262
  return;
263
  }
264
  foreach($rowIds as $sku){
265
- $collection = Mage::getModel('logicbroker/inventory')->getCollection()->addFieldToFilter('product_sku',$sku)->addFieldToFilter('lb_vendor_code',$vendorCode);
266
  $inventoryId = ($collection->getSize() > 0) ? $collection->getFirstItem()->getId() : '';
267
  if(!$inventoryId)
268
  {
269
- $inventoryCollection = Mage::getModel('logicbroker/inventory');
270
  $inventoryCollection->setLbVendorCode($vendorCode);
271
  $inventoryCollection->setLbVendorName(($vendorName) ? $vendorName->getLbVendorName() : '');
272
  $inventoryCollection->setProductSku($sku);
@@ -277,7 +277,7 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
277
  $inventoryCollection->setCreatedAt(now());
278
  try {
279
  $inventoryCollection->save();
280
- Mage::getModel('logicbroker/inventory')->_saveInventoryLog('add',array('lb_vendor_code'=>$vendorCode,'lb_vendor_name'=>($vendorName) ? $vendorName->getLbVendorName() : '','product_sku'=>$sku,'cost'=>0,'stock'=>0,'updated_by'=>'bulk_setup'));
281
  $saved ++;
282
  $skuSuccuess[] = $sku;
283
  } catch (Exception $e) {
@@ -287,7 +287,7 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
287
  }
288
  }else
289
  {
290
- $errors[] = Mage::helper('logicbroker')->__('Skip %s as supplier %s already assigned.',$sku,$vendorCode);
291
  $skuError[] = $sku;
292
  continue;
293
  }
@@ -306,21 +306,21 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
306
  $exeuctionTerminated = $this->getRequest()->getParam('exeuctionTerminated');
307
  if($exeuctionTerminated){
308
  Mage::getSingleton('adminhtml/session')->setTerminateExecution(true);
309
- Mage::helper('logicbroker')->finishProcess('bulk_assign');
310
  }else
311
  {
312
- Mage::helper('logicbroker')->finishProcess('bulk_assign');
313
  }
314
  $result = array();
315
  $data = $this->getRequest()->getPost();
316
- Mage::getResourceModel('logicbroker/vendorimportlog')->insertlog($data['lb_vendor_code'],'Bulk-product-setup',$data['sucees_sku'],$data['errorSkuCount']);
317
  $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
318
  }
319
 
320
 
321
  public function terminateAction(){
322
 
323
- Mage::helper('logicbroker')->finishProcess('manual_upload');
324
  $result = array();
325
  $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
326
  }
@@ -331,7 +331,7 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
331
  public function exportCsvAction()
332
  {
333
  $fileName = 'inventory.csv';
334
- $content = $this->getLayout()->createBlock('logicbroker/adminhtml_inventory_grid')->getCsvFile();
335
  $this->_prepareDownloadResponse($fileName, $content);
336
  }
337
 
@@ -341,7 +341,7 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
341
  public function exportXmlAction()
342
  {
343
  $fileName = 'inventory.xml';
344
- $content = $this->getLayout()->createBlock('logicbroker/adminhtml_inventory_grid')->getExcelFile($fileName);
345
  $this->_prepareDownloadResponse($fileName, $content);
346
  }
347
 
@@ -349,10 +349,41 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
349
  {
350
  $params = $this->getRequest()->getParams();
351
  $filename = 'upload_error.csv';
352
- $content = Mage::helper('logicbroker')->generateErrorList($params);
353
-
 
354
  $this->_prepareDownloadResponse($filename, $content);
355
  }
356
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
357
 
358
  }
13
  protected function _initAction()
14
  {
15
  $this->loadLayout()
16
+ ->_setActiveMenu('dropship360/upload_vendor_product')
17
+ ->_addBreadcrumb(Mage::helper('adminhtml')->__('dropship360'), Mage::helper('adminhtml')->__('Supplier Inventory'));
18
  return $this;
19
  }
20
 
35
  public function gridAction()
36
  {
37
  $this->getResponse()->setBody(
38
+ $this->getLayout()->createBlock('dropship360/adminhtml_inventory_grid')->toHtml()
39
  );
40
  }
41
  public function uploadFileAction()
50
  {
51
  $redirectUrl = '*/*/index';
52
  }
53
+ if(Mage::helper('dropship360')->isProcessRunning('bulk_assign')){
54
  $this->_getSession()->addError($this->__('Bulk product setup is currently running please try again later'));
55
  $this->_redirect($redirectUrl);
56
  return;
57
  }
58
  if ($data) {
59
  try {
60
+ $import = Mage::getModel('dropship360/uploadvendor');
61
  $validationResult = $import->setData($data)->uploadSource();
62
  if(!$validationResult){
63
  $this->initialize();
64
  $import->parseCsv(Mage::registry('file_name'),$data['vendor']);
65
+ $this->_getSession()->addSuccess(Mage::helper('dropship360')->__('File upload successfully '));
66
  $this->finalize();
67
  }else{
68
+ $this->_getSession()->addError(Mage::helper('dropship360')->__('File cannot be uploaded '));
69
  }
70
  } catch (Exception $e) {
71
  $this->_getSession()->addError($e->getMessage());
80
  }
81
 
82
  protected function initialize(){
83
+ Mage::helper('dropship360')->startProcess('manual_upload');
84
  }
85
 
86
  protected function finalize(){
87
+ Mage::helper('dropship360')->finishProcess('manual_upload');
88
  }
89
 
90
  public function vendorsuploadhistoryAction()
98
  public function editAction()
99
  {
100
  $id = $this->getRequest()->getParam('lb_item_id');
101
+ $model = Mage::getModel('dropship360/orderitems')->load($id);
102
  if ($model->getId()) {
103
  $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
104
  if (!empty($data)) {
106
  }
107
  Mage::register('sourcing_data', $model);
108
  $this->loadLayout();
109
+ $this->_setActiveMenu('dropship360/order_sourcing');
110
  $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Order Sourcing'), Mage::helper('adminhtml')->__('Order Sourcing'));
111
+ $this->_addContent($this->getLayout()->createBlock('dropship360/adminhtml_sourcing_edit'))
112
+ ->_addLeft($this->getLayout()->createBlock('dropship360/adminhtml_sourcing_edit_tabs'));
113
  $this->renderLayout();
114
  } else {
115
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship360')->__('Sourcing does not exist'));
116
  $this->_redirect('*/*/sourcinggrid');
117
  }
118
  }
121
  public function validateftpconnectionAction()
122
  {
123
  $paramsArray = $this->getRequest()->getParams();
124
+ $validateConnection = Mage::getModel('dropship360/uploadvendor');
125
  $result = $validateConnection->testFtpConnection($paramsArray['groups']['cron_settings_upload']['fields']);
126
  $result = Mage::helper('core')->jsonEncode($result);
127
  Mage::app()->getResponse()->setBody($result);
133
  if ($data = $this->getRequest()->getPost()) {
134
  $vendorCode = $data['lb_vendor_code'];
135
  $sku = $data['sku'];
136
+ $model = Mage::getModel('dropship360/orderitems');
137
 
138
  if($this->getRequest()->getParam('cancel') == 'item'){
139
  $model->load($this->getRequest()->getParam('lb_item_id'));
140
  $model->setLbItemStatus('Cancelled');
141
  try{
142
  $model->save();
143
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('dropship360')->__('Item %s Cancelled Successfully ',$model->getSku()));
144
 
145
  }catch(Exception $e){
146
  Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
153
  }
154
 
155
  if(!$data['lb_vendor_code']){
156
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship360')->__('Under Processing By Logicbroker Can Not Update %s Sku',$model->getSku()));
157
  $this->_redirect('*/*/sourcinggrid');
158
  return;
159
  }
163
  $model->save();
164
  $model->updateOrderStatus($model->getItemOrderId(),$model->getItemId());
165
  Mage::getSingleton('adminhtml/session')->setFormData(false);
166
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('dropship360')->__('Sourcing Updated For %s',$model->getSku()));
167
  if ($this->getRequest()->getParam('back')) {
168
  $this->_redirect('*/*/edit', array('lb_item_id' => $model->getId()));
169
  return;
177
  return;
178
  }
179
  }
180
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship360')->__('Unable to save sourcing'));
181
  $this->_redirect('*/*/sourcinggrid');
182
  }
183
 
214
  $isProductSetupMode = (isset($paramsArray['isproductsetupmode']) && $paramsArray['isproductsetupmode']) ? true : false;
215
  $type = ($isProductSetupMode) ? 'setup' : 'upload';
216
  $fileName = 'logicbroker_supplier_product_'.$type.'.csv';
217
+ $content = Mage::getModel('dropship360/uploadvendor')->getCsvFile($isProductSetupMode);
218
  $this->_prepareDownloadResponse($fileName, $content);
219
  $this->_redirect('*/*/index');
220
 
224
 
225
  protected function _initSystem()
226
  {
227
+ $this->_title($this->__('dropship360'))
228
  ->_title($this->__('Bulk vendor assignment'));
229
  $vendorCode = $this->getRequest()->getParam('lb_vendor_code');
230
  if (!$vendorCode) {
250
  if (!is_array($rowIds) || count($rowIds) < 1) {
251
  return;
252
  }
253
+ $vendorName = Mage::getModel('dropship360/ranking')->load($vendorCode,'lb_vendor_code');
254
  $errors = array();
255
  $saved = 0;
256
  $skuError = array();
257
  $skuSuccuess = array();
258
  if(!Mage::getSingleton('adminhtml/session')->getTerminateExecution()){
259
+ Mage::helper('dropship360')->startProcess('bulk_assign');
260
  }else
261
  {
262
  return;
263
  }
264
  foreach($rowIds as $sku){
265
+ $collection = Mage::getModel('dropship360/inventory')->getCollection()->addFieldToFilter('product_sku',$sku)->addFieldToFilter('lb_vendor_code',$vendorCode);
266
  $inventoryId = ($collection->getSize() > 0) ? $collection->getFirstItem()->getId() : '';
267
  if(!$inventoryId)
268
  {
269
+ $inventoryCollection = Mage::getModel('dropship360/inventory');
270
  $inventoryCollection->setLbVendorCode($vendorCode);
271
  $inventoryCollection->setLbVendorName(($vendorName) ? $vendorName->getLbVendorName() : '');
272
  $inventoryCollection->setProductSku($sku);
277
  $inventoryCollection->setCreatedAt(now());
278
  try {
279
  $inventoryCollection->save();
280
+ Mage::getModel('dropship360/inventory')->_saveInventoryLog('add',array('lb_vendor_code'=>$vendorCode,'lb_vendor_name'=>($vendorName) ? $vendorName->getLbVendorName() : '','product_sku'=>$sku,'cost'=>0,'stock'=>0,'updated_by'=>'bulk_setup'));
281
  $saved ++;
282
  $skuSuccuess[] = $sku;
283
  } catch (Exception $e) {
287
  }
288
  }else
289
  {
290
+ $errors[] = Mage::helper('dropship360')->__('Skip %s as supplier %s already assigned.',$sku,$vendorCode);
291
  $skuError[] = $sku;
292
  continue;
293
  }
306
  $exeuctionTerminated = $this->getRequest()->getParam('exeuctionTerminated');
307
  if($exeuctionTerminated){
308
  Mage::getSingleton('adminhtml/session')->setTerminateExecution(true);
309
+ Mage::helper('dropship360')->finishProcess('bulk_assign');
310
  }else
311
  {
312
+ Mage::helper('dropship360')->finishProcess('bulk_assign');
313
  }
314
  $result = array();
315
  $data = $this->getRequest()->getPost();
316
+ Mage::getResourceModel('dropship360/vendorimportlog')->insertlog($data['lb_vendor_code'],'Bulk-product-setup',$data['sucees_sku'],$data['errorSkuCount']);
317
  $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
318
  }
319
 
320
 
321
  public function terminateAction(){
322
 
323
+ Mage::helper('dropship360')->finishProcess('manual_upload');
324
  $result = array();
325
  $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
326
  }
331
  public function exportCsvAction()
332
  {
333
  $fileName = 'inventory.csv';
334
+ $content = $this->getLayout()->createBlock('dropship360/adminhtml_inventory_grid')->getCsvFile();
335
  $this->_prepareDownloadResponse($fileName, $content);
336
  }
337
 
341
  public function exportXmlAction()
342
  {
343
  $fileName = 'inventory.xml';
344
+ $content = $this->getLayout()->createBlock('dropship360/adminhtml_inventory_grid')->getExcelFile($fileName);
345
  $this->_prepareDownloadResponse($fileName, $content);
346
  }
347
 
349
  {
350
  $params = $this->getRequest()->getParams();
351
  $filename = 'upload_error.csv';
352
+ $content = Mage::helper('dropship360')->generateErrorList($params);
353
+ if($content['error'])
354
+ return $this->getResponse()->setRedirect($this->getUrl('*/*/vendorsuploadhistory'));
355
  $this->_prepareDownloadResponse($filename, $content);
356
  }
357
 
358
+ /**
359
+ * Delete log action
360
+ */
361
+ public function deleteAction()
362
+ {
363
+ if ($id = $this->getRequest()->getParam('id')) {
364
+ $tableName = Mage::getSingleton ( 'core/resource' )->getTableName ('dropship360/vendor_import_log');
365
+ $connection = Mage::getSingleton ('core/resource')->getConnection ('core_read');
366
+ $select = $connection->select()->from($tableName)->where('error_id=?', $id);
367
+ $connection->fetchRow($select);
368
+ try {
369
+ $connection->delete($tableName,array('error_id'=>$id));
370
+ $this->_getSession()->addSuccess($this->__('The log has been deleted.'));
371
+ } catch (Exception $e) {
372
+ $this->_getSession()->addError($e->getMessage());
373
+ }
374
+ }
375
+ $this->getResponse()
376
+ ->setRedirect($this->getUrl('*/*/vendorsuploadhistory', array('store'=>$this->getRequest()->getParam('store'))));
377
+ }
378
+
379
+ /**
380
+ * Acl check for admin
381
+ *
382
+ * @return bool
383
+ */
384
+ protected function _isAllowed()
385
+ {
386
+ return Mage::getSingleton('admin/session')->isAllowed('dropship360/inventory');
387
+ }
388
 
389
  }
app/code/community/Logicbroker/Dropship360/data/dropship360_setup/data-install-1.0.3.php CHANGED
@@ -39,6 +39,7 @@ foreach ($coreConfigData as $data) {
39
 
40
  /* Add attribute to catalog default set */
41
 
 
42
  $eavModel=Mage::getModel('eav/entity_setup','core_setup');
43
  $attributeId=$eavModel->getAttribute('catalog_product','manufacturer');
44
  $attributeSetId=$eavModel->getAttributeSetId('catalog_product','Default');
@@ -47,8 +48,8 @@ $attributeGroupId=$eavModel->getAttributeGroup('catalog_product',$attributeSetId
47
  //add attribute to a set
48
  if(!empty($attributeId) && !empty($attributeId) && $attributeSetId)
49
  $eavModel->addAttributeToSet('catalog_product',$attributeSetId,$attributeGroupId['attribute_group_id'],$attributeId['attribute_id']);
50
-
51
- Mage::getModel('logicbroker/ranking')->addPreDefineVendorList();
52
 
53
 
54
 
39
 
40
  /* Add attribute to catalog default set */
41
 
42
+ /*
43
  $eavModel=Mage::getModel('eav/entity_setup','core_setup');
44
  $attributeId=$eavModel->getAttribute('catalog_product','manufacturer');
45
  $attributeSetId=$eavModel->getAttributeSetId('catalog_product','Default');
48
  //add attribute to a set
49
  if(!empty($attributeId) && !empty($attributeId) && $attributeSetId)
50
  $eavModel->addAttributeToSet('catalog_product',$attributeSetId,$attributeGroupId['attribute_group_id'],$attributeId['attribute_id']);
51
+ */
52
+ Mage::getModel('dropship360/ranking')->addPreDefineVendorList();
53
 
54
 
55
 
app/code/community/Logicbroker/Dropship360/data/dropship360_setup/data-upgrade-1.0.3-1.0.4.php CHANGED
@@ -28,14 +28,14 @@ catch (Exception $e) {
28
 
29
  /* update order state */
30
 
31
- $orderStatuses = array('lb_ready_to_source'=>'Ready to Source');
32
- Mage::getModel('logicbroker/logicbroker')->updateOrderState($orderStatuses);
33
 
34
 
35
 
36
  /* If compiler is enabled than we need to run the compilation */
37
 
38
- if (defined('COMPILER_INCLUDE_PATH')) {
39
  try {
40
  Mage::getModel('compiler/process')->run();
41
  Mage::getSingleton('adminhtml/session')->addSuccess(
@@ -49,7 +49,7 @@ if (defined('COMPILER_INCLUDE_PATH')) {
49
  );
50
  }
51
  }
52
-
53
  /* Load default values of Sourcing Schedule Cron Jobs*/
54
  $coreConfigData = array(
55
  array(
@@ -77,7 +77,7 @@ $coreConfigData = array(
77
  'scope' => 'default',
78
  'scope_id' => '0',
79
  'path' => 'crontab/jobs/logicbroker_dropship360/run/model',
80
- 'value' => 'logicbroker/observer::logicbrokerSourcing',
81
  ),
82
  array(
83
  'scope' => 'default',
@@ -89,7 +89,7 @@ $coreConfigData = array(
89
  'scope' => 'default',
90
  'scope_id' => '0',
91
  'path' => 'crontab/jobs/logicbroker_backorder/run/model',
92
- 'value' => 'logicbroker/observer::logicbrokerBackorder',
93
  )
94
 
95
 
28
 
29
  /* update order state */
30
 
31
+ /* $orderStatuses = array('lb_ready_to_source'=>'Ready to Source');
32
+ Mage::getModel('dropship360/logicbroker')->updateOrderState($orderStatuses); */
33
 
34
 
35
 
36
  /* If compiler is enabled than we need to run the compilation */
37
 
38
+ /*if (defined('COMPILER_INCLUDE_PATH')) {
39
  try {
40
  Mage::getModel('compiler/process')->run();
41
  Mage::getSingleton('adminhtml/session')->addSuccess(
49
  );
50
  }
51
  }
52
+ */
53
  /* Load default values of Sourcing Schedule Cron Jobs*/
54
  $coreConfigData = array(
55
  array(
77
  'scope' => 'default',
78
  'scope_id' => '0',
79
  'path' => 'crontab/jobs/logicbroker_dropship360/run/model',
80
+ 'value' => 'dropship360/observer::logicbrokerSourcing',
81
  ),
82
  array(
83
  'scope' => 'default',
89
  'scope' => 'default',
90
  'scope_id' => '0',
91
  'path' => 'crontab/jobs/logicbroker_backorder/run/model',
92
+ 'value' => 'dropship360/observer::logicbrokerBackorder',
93
  )
94
 
95
 
app/code/community/Logicbroker/Dropship360/data/dropship360_setup/data-upgrade-1.0.4-1.0.5.php CHANGED
@@ -36,7 +36,7 @@
36
  'scope' => 'default',
37
  'scope_id' => '0',
38
  'path' => 'crontab/jobs/logicbroker_uploadvendor/run/model',
39
- 'value' => 'logicbroker/observer::ftpParseCsv',
40
  )
41
 
42
  );
36
  'scope' => 'default',
37
  'scope_id' => '0',
38
  'path' => 'crontab/jobs/logicbroker_uploadvendor/run/model',
39
+ 'value' => 'dropship360/observer::ftpParseCsv',
40
  )
41
 
42
  );
app/code/community/Logicbroker/Dropship360/data/dropship360_setup/data-upgrade-1.0.5-1.0.6.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Logicbroker
4
+ *
5
+ * @category Community
6
+ * @package Logicbroker_Dropship360
7
+ */
8
+ $collectionSize = (Mage::getModel('dropship360/inventory')->getCollection()->getSize() >= 1) ? 1 : '';
9
+ $coreConfigData = array(
10
+ array(
11
+ 'scope' => 'default',
12
+ 'scope_id' => '0',
13
+ 'path' => 'logicbroker/notification/vendor_setup',
14
+ 'value' => $collectionSize,
15
+
16
+ )
17
+
18
+ );
19
+
20
+ /**
21
+ * Insert default blocks
22
+ */
23
+ foreach ($coreConfigData as $data) {
24
+ Mage::getModel('core/config_data')->setData($data)->save();
25
+ }
app/code/community/Logicbroker/Dropship360/etc/adminhtml.xml CHANGED
@@ -8,15 +8,15 @@
8
  <children>
9
  <config>
10
  <children>
11
- <logicbroker_integration translate="title" module="logicbroker">
12
  <title>General Information</title>
13
  <sort_order>1</sort_order>
14
  </logicbroker_integration>
15
- <logicbroker_sourcing translate="title" module="logicbroker">
16
  <title>Sourcing Section</title>
17
  <sort_order>2</sort_order>
18
  </logicbroker_sourcing>
19
- <logicbroker_cron translate="title" module="logicbroker">
20
  <title>Cron Settings</title>
21
  <sort_order>2</sort_order>
22
  </logicbroker_cron>
@@ -24,7 +24,7 @@
24
  </config>
25
  </children>
26
  </system>
27
- <logicbroker translate="title" module="logicbroker">
28
  <title>logicbroker</title>
29
  <sort_order>91</sort_order>
30
  <children>
@@ -47,14 +47,14 @@
47
  <title>Supplier Information</title>
48
  </integration>
49
  </children>
50
- </logicbroker>
51
  </children>
52
  </admin>
53
  </resources>
54
  </acl>
55
 
56
  <menu>
57
- <logicbroker translate="title" module="logicbroker">
58
  <title>dropship360</title>
59
  <sort_order>91</sort_order>
60
  <children>
@@ -90,10 +90,10 @@
90
  </lb_sourcing>
91
  <!-- <upload_vendor_product translate="title">
92
  <title>Upload Supplier Product</title>
93
- <action>logicbroker/adminhtml_upload/index</action>
94
  <sort_order>17</sort_order>
95
  </upload_vendor_product> -->
96
  </children>
97
- </logicbroker>
98
  </menu>
99
  </config>
8
  <children>
9
  <config>
10
  <children>
11
+ <logicbroker_integration translate="title" module="dropship360">
12
  <title>General Information</title>
13
  <sort_order>1</sort_order>
14
  </logicbroker_integration>
15
+ <logicbroker_sourcing translate="title" module="dropship360">
16
  <title>Sourcing Section</title>
17
  <sort_order>2</sort_order>
18
  </logicbroker_sourcing>
19
+ <logicbroker_cron translate="title" module="dropship360">
20
  <title>Cron Settings</title>
21
  <sort_order>2</sort_order>
22
  </logicbroker_cron>
24
  </config>
25
  </children>
26
  </system>
27
+ <dropship360 translate="title" module="dropship360">
28
  <title>logicbroker</title>
29
  <sort_order>91</sort_order>
30
  <children>
47
  <title>Supplier Information</title>
48
  </integration>
49
  </children>
50
+ </dropship360>
51
  </children>
52
  </admin>
53
  </resources>
54
  </acl>
55
 
56
  <menu>
57
+ <dropship360 translate="title" module="dropship360">
58
  <title>dropship360</title>
59
  <sort_order>91</sort_order>
60
  <children>
90
  </lb_sourcing>
91
  <!-- <upload_vendor_product translate="title">
92
  <title>Upload Supplier Product</title>
93
+ <action>dropship360/adminhtml_upload/index</action>
94
  <sort_order>17</sort_order>
95
  </upload_vendor_product> -->
96
  </children>
97
+ </dropship360>
98
  </menu>
99
  </config>
app/code/community/Logicbroker/Dropship360/etc/api.xml CHANGED
@@ -38,15 +38,15 @@
38
  </unhold>
39
  <updateItemStatus translate="title" module="fulfillment">
40
  <title>updateItemStatus</title>
41
- <acl>sales/order/updateItemStatus</acl>
42
  </updateItemStatus>
43
  <getLbOrderByItemStatus>
44
  <title>getLbOrderByItemStatus</title>
45
- <acl>sales/order/getLbOrderByItemStatus</acl>
46
  </getLbOrderByItemStatus>
47
  <setLbOrderItemStatus>
48
  <title>setLbOrderItemStatus</title>
49
- <acl>sales/order/setLbOrderItemStatus</acl>
50
  </setLbOrderItemStatus>
51
 
52
  </methods>
@@ -256,11 +256,11 @@
256
  </sales_order_creditmemo>
257
  <dropship360_versions>
258
  <title>dropship360</title>
259
- <model>logicbroker/versions_api</model>
260
  <acl>dropship360/versions</acl>
261
  <methods>
262
 
263
- <getdropship360version translate="title" module="logicbroker">
264
  <title>getdropship360version</title>
265
  <title>get dropship360 vesion</title>
266
  <method>getdropship360version</method>
@@ -322,15 +322,15 @@
322
  <info translate="title" module="sales">
323
  <title>Retrieve orders info</title>
324
  </info>
325
- <updateItemStatus translate="title" module="sales">
326
  <title>update Item Status</title>
327
- </updateItemStatus>
328
- <getLbOrderByItemStatus translate="title" module="sales">
329
  <title>Retrive orders by item status</title>
330
- </getLbOrderByItemStatus>
331
- <setLbOrderItemStatus translate="title" module="sales">
332
  <title>Set order item status</title>
333
- </setLbOrderItemStatus>
334
 
335
  <shipment translate="title" module="sales">
336
  <title>Order shipments</title>
@@ -392,13 +392,13 @@
392
  </creditmemo>
393
  </order>
394
  </sales>
395
- <dropship360 translate="title" module="logicbroker">
396
  <title>dropship360</title>
397
  <sort_order>1</sort_order>
398
- <versions translate="title" module="logicbroker">
399
  <title>versions</title>
400
  <sort_order>2000</sort_order>
401
- <dropship360 translate="title" module="logicbroker">
402
  <title>dropship360</title>
403
  </dropship360>
404
  </versions>
38
  </unhold>
39
  <updateItemStatus translate="title" module="fulfillment">
40
  <title>updateItemStatus</title>
41
+ <acl>sales/order/updateitemstatus</acl>
42
  </updateItemStatus>
43
  <getLbOrderByItemStatus>
44
  <title>getLbOrderByItemStatus</title>
45
+ <acl>sales/order/getlborderbyitemstatus</acl>
46
  </getLbOrderByItemStatus>
47
  <setLbOrderItemStatus>
48
  <title>setLbOrderItemStatus</title>
49
+ <acl>sales/order/setlborderitemstatus</acl>
50
  </setLbOrderItemStatus>
51
 
52
  </methods>
256
  </sales_order_creditmemo>
257
  <dropship360_versions>
258
  <title>dropship360</title>
259
+ <model>dropship360/versions_api</model>
260
  <acl>dropship360/versions</acl>
261
  <methods>
262
 
263
+ <getdropship360version translate="title" module="dropship360">
264
  <title>getdropship360version</title>
265
  <title>get dropship360 vesion</title>
266
  <method>getdropship360version</method>
322
  <info translate="title" module="sales">
323
  <title>Retrieve orders info</title>
324
  </info>
325
+ <updateitemstatus translate="title" module="sales">
326
  <title>update Item Status</title>
327
+ </updateitemstatus>
328
+ <getlborderbyitemstatus translate="title" module="sales">
329
  <title>Retrive orders by item status</title>
330
+ </getlborderbyitemstatus>
331
+ <setlborderitemstatus translate="title" module="sales">
332
  <title>Set order item status</title>
333
+ </setlborderitemstatus>
334
 
335
  <shipment translate="title" module="sales">
336
  <title>Order shipments</title>
392
  </creditmemo>
393
  </order>
394
  </sales>
395
+ <dropship360 translate="title" module="dropship360">
396
  <title>dropship360</title>
397
  <sort_order>1</sort_order>
398
+ <versions translate="title" module="dropship360">
399
  <title>versions</title>
400
  <sort_order>2000</sort_order>
401
+ <dropship360 translate="title" module="dropship360">
402
  <title>dropship360</title>
403
  </dropship360>
404
  </versions>
app/code/community/Logicbroker/Dropship360/etc/api2.xml CHANGED
@@ -10,7 +10,7 @@
10
  <config>
11
  <api2>
12
  <resource_groups>
13
- <logicbroker translate="title" module="api2">
14
  <title>Logicbroker</title>
15
  <sort_order>30</sort_order>
16
  <children>
@@ -23,12 +23,12 @@
23
  <sort_order>51</sort_order>
24
  </inventory_import>
25
  </children>
26
- </logicbroker>
27
  </resource_groups>
28
  <resources>
29
  <import translate="title" module="api2">
30
  <group>product_import</group>
31
- <model>logicbroker/api2_product</model>
32
  <working_model>catalog/product</working_model>
33
  <title>Catalog Import</title>
34
  <sort_order>10</sort_order>
@@ -96,8 +96,8 @@
96
  </import>
97
  <inventory_import translate="title" module="api2">
98
  <group>inventory_import</group>
99
- <model>logicbroker/api2_inventory</model>
100
- <working_model>logicbroker/inventory</working_model>
101
  <title>Inventory Import</title>
102
  <sort_order>10</sort_order>
103
  <privileges>
10
  <config>
11
  <api2>
12
  <resource_groups>
13
+ <dropship360 translate="title" module="api2">
14
  <title>Logicbroker</title>
15
  <sort_order>30</sort_order>
16
  <children>
23
  <sort_order>51</sort_order>
24
  </inventory_import>
25
  </children>
26
+ </dropship360>
27
  </resource_groups>
28
  <resources>
29
  <import translate="title" module="api2">
30
  <group>product_import</group>
31
+ <model>dropship360/api2_product</model>
32
  <working_model>catalog/product</working_model>
33
  <title>Catalog Import</title>
34
  <sort_order>10</sort_order>
96
  </import>
97
  <inventory_import translate="title" module="api2">
98
  <group>inventory_import</group>
99
+ <model>dropship360/api2_inventory</model>
100
+ <working_model>dropship360/inventory</working_model>
101
  <title>Inventory Import</title>
102
  <sort_order>10</sort_order>
103
  <privileges>
app/code/community/Logicbroker/Dropship360/etc/config.xml CHANGED
@@ -2,14 +2,14 @@
2
  <config>
3
  <modules>
4
  <Logicbroker_Dropship360>
5
- <version>1.0.5</version>
6
  </Logicbroker_Dropship360>
7
  </modules>
8
  <global>
9
  <blocks>
10
- <logicbroker>
11
  <class>Logicbroker_Dropship360_Block</class>
12
- </logicbroker>
13
  <adminhtml>
14
  <rewrite>
15
  <sales_order_view_items>Logicbroker_Dropship360_Block_Adminhtml_Sales_Order_View_Items</sales_order_view_items>
@@ -18,16 +18,16 @@
18
  </blocks>
19
 
20
  <helpers>
21
- <logicbroker>
22
  <class>Logicbroker_Dropship360_Helper</class>
23
- </logicbroker>
24
  </helpers>
25
  <models>
26
- <logicbroker>
27
  <class>Logicbroker_Dropship360_Model</class>
28
- <resourceModel>logicbroker_resource</resourceModel>
29
- </logicbroker>
30
- <logicbroker_resource>
31
  <class>Logicbroker_Dropship360_Model_Resource</class>
32
  <entities>
33
  <supplier>
@@ -60,8 +60,14 @@
60
  <tmpdata>
61
  <table>logicbroker_tmp_data</table>
62
  </tmpdata>
 
 
 
 
 
 
63
  </entities>
64
- </logicbroker_resource>
65
  <sales>
66
  <rewrite>
67
  <order_api_v2>Logicbroker_Dropship360_Model_Order_Api</order_api_v2>
@@ -78,22 +84,22 @@
78
  <use>core_setup</use>
79
  </connection>
80
  </dropship360_setup>
81
- <logicbroker_write>
82
  <connection>
83
  <use>core_write</use>
84
  </connection>
85
- </logicbroker_write>
86
- <logicbroker_read>
87
  <connection>
88
  <use>core_read</use>
89
  </connection>
90
- </logicbroker_read>
91
  </resources>
92
  <events>
93
  <sales_order_place_after>
94
  <observers>
95
  <logicbroker_invoice>
96
- <class>logicbroker/observer</class>
97
  <method>insertProcessOrder</method>
98
  </logicbroker_invoice>
99
  </observers>
@@ -102,7 +108,7 @@
102
  <observers>
103
  <logicbroker_shipmentemail_sales_order_shipment_save_before>
104
  <type>singleton</type>
105
- <class>logicbroker/observer</class>
106
  <method>salesOrderShipmentSaveBefore</method>
107
  </logicbroker_shipmentemail_sales_order_shipment_save_before>
108
  </observers>
@@ -111,7 +117,7 @@
111
  <observers>
112
  <logicbroker_shipmentemail_sales_order_shipment_save_after>
113
  <type>singleton</type>
114
- <class>logicbroker/observer</class>
115
  <method>salesOrderShipmentSaveAfter</method>
116
  </logicbroker_shipmentemail_sales_order_shipment_save_after>
117
  </observers>
@@ -120,7 +126,7 @@
120
  <observers>
121
  <logicbroker_catalog_product_delete_after>
122
  <type>singleton</type>
123
- <class>logicbroker/observer</class>
124
  <method>catalogProductDeleteAfter</method>
125
  </logicbroker_catalog_product_delete_after>
126
  </observers>
@@ -128,11 +134,36 @@
128
  </events>
129
  <template>
130
  <email>
131
- <logicbroker_email_email_template translate="label" module="logicbroker">
132
  <label>logicbroker</label>
133
- <file>logicbroker.html</file>
134
  <type>html</type>
135
  </logicbroker_email_email_template>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
136
  </email>
137
  </template>
138
 
@@ -152,9 +183,9 @@
152
  <adminhtml>
153
  <layout>
154
  <updates>
155
- <logicbroker>
156
  <file>logicbroker.xml</file>
157
- </logicbroker>
158
  </updates>
159
  </layout>
160
  <translate>
@@ -171,7 +202,7 @@
171
  <observers>
172
  <logicbroker_save_product_data>
173
  <type>singleton</type>
174
- <class>logicbroker/observer</class>
175
  <method>saveProductTabData</method>
176
  </logicbroker_save_product_data>
177
  </observers>
@@ -185,7 +216,7 @@
185
  <processing_status>proceesing</processing_status>
186
  <error_status>error</error_status>
187
  <sentto_warehouse_status>sent_to_warehouse</sentto_warehouse_status>
188
- <ds360_version>2.1.0</ds360_version>
189
  </integration>
190
  </logicbroker_integration>
191
  <logicbroker_cron>
@@ -220,32 +251,39 @@
220
  </helpurl>
221
  <email>
222
  <toaddress>magentoext@logicbroker.com</toaddress>
 
223
  <toname>logicbroker</toname>
224
  <subject>logicbroker new extesnion Installation</subject>
225
  </email>
 
226
  </apiconfig>
227
  <crontab>
228
  <jobs>
229
  <logicbroker_dropship360>
230
  <run>
231
- <model>logicbroker/observer::logicbrokerSourcing</model>
232
  </run>
233
  </logicbroker_dropship360>
234
  <logicbroker_backorder>
235
  <run>
236
- <model>logicbroker/observer::logicbrokerBackorder</model>
237
  </run>
238
  </logicbroker_backorder>
239
  <logicbroker_uploadvendor>
240
  <run>
241
- <model>logicbroker/uploadvendor::ftpParseCsv</model>
242
  </run>
243
  </logicbroker_uploadvendor>
244
  <logicbroker_report_email>
245
  <run>
246
- <model>logicbroker/report::sendNotification</model>
247
  </run>
248
  </logicbroker_report_email>
 
 
 
 
 
249
  </jobs>
250
  </crontab>
251
  </config>
2
  <config>
3
  <modules>
4
  <Logicbroker_Dropship360>
5
+ <version>1.0.7</version>
6
  </Logicbroker_Dropship360>
7
  </modules>
8
  <global>
9
  <blocks>
10
+ <dropship360>
11
  <class>Logicbroker_Dropship360_Block</class>
12
+ </dropship360>
13
  <adminhtml>
14
  <rewrite>
15
  <sales_order_view_items>Logicbroker_Dropship360_Block_Adminhtml_Sales_Order_View_Items</sales_order_view_items>
18
  </blocks>
19
 
20
  <helpers>
21
+ <dropship360>
22
  <class>Logicbroker_Dropship360_Helper</class>
23
+ </dropship360>
24
  </helpers>
25
  <models>
26
+ <dropship360>
27
  <class>Logicbroker_Dropship360_Model</class>
28
+ <resourceModel>dropship360_resource</resourceModel>
29
+ </dropship360>
30
+ <dropship360_resource>
31
  <class>Logicbroker_Dropship360_Model_Resource</class>
32
  <entities>
33
  <supplier>
60
  <tmpdata>
61
  <table>logicbroker_tmp_data</table>
62
  </tmpdata>
63
+ <csvtmpdata>
64
+ <table>logicbroker_tmp_csv_dump</table>
65
+ </csvtmpdata>
66
+ <vendor_import_log_desc>
67
+ <table>logicbroker_vendor_product_import_log_description</table>
68
+ </vendor_import_log_desc>
69
  </entities>
70
+ </dropship360_resource>
71
  <sales>
72
  <rewrite>
73
  <order_api_v2>Logicbroker_Dropship360_Model_Order_Api</order_api_v2>
84
  <use>core_setup</use>
85
  </connection>
86
  </dropship360_setup>
87
+ <dropship360_write>
88
  <connection>
89
  <use>core_write</use>
90
  </connection>
91
+ </dropship360_write>
92
+ <dropship360_read>
93
  <connection>
94
  <use>core_read</use>
95
  </connection>
96
+ </dropship360_read>
97
  </resources>
98
  <events>
99
  <sales_order_place_after>
100
  <observers>
101
  <logicbroker_invoice>
102
+ <class>dropship360/observer</class>
103
  <method>insertProcessOrder</method>
104
  </logicbroker_invoice>
105
  </observers>
108
  <observers>
109
  <logicbroker_shipmentemail_sales_order_shipment_save_before>
110
  <type>singleton</type>
111
+ <class>dropship360/observer</class>
112
  <method>salesOrderShipmentSaveBefore</method>
113
  </logicbroker_shipmentemail_sales_order_shipment_save_before>
114
  </observers>
117
  <observers>
118
  <logicbroker_shipmentemail_sales_order_shipment_save_after>
119
  <type>singleton</type>
120
+ <class>dropship360/observer</class>
121
  <method>salesOrderShipmentSaveAfter</method>
122
  </logicbroker_shipmentemail_sales_order_shipment_save_after>
123
  </observers>
126
  <observers>
127
  <logicbroker_catalog_product_delete_after>
128
  <type>singleton</type>
129
+ <class>dropship360/observer</class>
130
  <method>catalogProductDeleteAfter</method>
131
  </logicbroker_catalog_product_delete_after>
132
  </observers>
134
  </events>
135
  <template>
136
  <email>
137
+ <logicbroker_email_email_template translate="label" module="dropship360">
138
  <label>logicbroker</label>
139
+ <file>logicbroker/logicbroker.html</file>
140
  <type>html</type>
141
  </logicbroker_email_email_template>
142
+ <logicbroker_ftp_con_fail translate="label" module="dropship360">
143
+ <label>logicbroker ftp connection fail</label>
144
+ <file>logicbroker/logicbroker_ftp_con_fail.html</file>
145
+ <type>html</type>
146
+ </logicbroker_ftp_con_fail>
147
+ <logicbroker_order_notification translate="label" module="dropship360">
148
+ <label>logicbroker first order notification</label>
149
+ <file>logicbroker/first_order_notification.html</file>
150
+ <type>html</type>
151
+ </logicbroker_order_notification>
152
+ <logicbroker_activty_report_staticstatus translate="label" module="dropship360">
153
+ <label>static status report notification</label>
154
+ <file>logicbroker/activity_report_staticstatus.html</file>
155
+ <type>html</type>
156
+ </logicbroker_activty_report_staticstatus>
157
+ <logicbroker_outdated_product_inventory>
158
+ <label>Outdated product inventory notification</label>
159
+ <file>logicbroker/oudated_product_inventory_notification.html</file>
160
+ <type>html</type>
161
+ </logicbroker_outdated_product_inventory>
162
+ <logicbroker_productsetup_notification translate="label" module="dropship360">
163
+ <label>logicbroker first productsetup notification</label>
164
+ <file>logicbroker/first_productsetup_notification.html</file>
165
+ <type>html</type>
166
+ </logicbroker_productsetup_notification>
167
  </email>
168
  </template>
169
 
183
  <adminhtml>
184
  <layout>
185
  <updates>
186
+ <dropship360>
187
  <file>logicbroker.xml</file>
188
+ </dropship360>
189
  </updates>
190
  </layout>
191
  <translate>
202
  <observers>
203
  <logicbroker_save_product_data>
204
  <type>singleton</type>
205
+ <class>dropship360/observer</class>
206
  <method>saveProductTabData</method>
207
  </logicbroker_save_product_data>
208
  </observers>
216
  <processing_status>proceesing</processing_status>
217
  <error_status>error</error_status>
218
  <sentto_warehouse_status>sent_to_warehouse</sentto_warehouse_status>
219
+ <ds360_version>3.1.1</ds360_version>
220
  </integration>
221
  </logicbroker_integration>
222
  <logicbroker_cron>
251
  </helpurl>
252
  <email>
253
  <toaddress>magentoext@logicbroker.com</toaddress>
254
+ <bcc>support@logicbroker.com</bcc>
255
  <toname>logicbroker</toname>
256
  <subject>logicbroker new extesnion Installation</subject>
257
  </email>
258
+ <soap_role>__root__,dropship360,dropship360/versions,dropship360/versions/dropship360,core,core/magento,core/magento/info,core/store,core/store/list,core/store/info,catalog,catalog/product,catalog/product/create,catalog/product/info,catalog/product/attributes,catalog/product/update_tier_price,catalog/product/delete,catalog/product/update,catalog/product/attribute,catalog/product/attribute/info,catalog/product/attribute/option,catalog/product/attribute/option/remove,catalog/product/attribute/option/add,catalog/product/attribute/set,catalog/product/attribute/set/group_add,catalog/product/attribute/set/group_rename,catalog/product/attribute/set/group_remove,catalog/product/attribute/set/attribute_remove,catalog/product/attribute/set/attribute_add,catalog/product/attribute/set/create,catalog/product/attribute/set/remove,catalog/product/attribute/set/list,catalog/product/attribute/remove,catalog/product/attribute/update,catalog/product/attribute/write,catalog/product/attribute/types,catalog/product/attribute/create,catalog/product/attribute/read,catalog/product/link,catalog/product/link/remove,catalog/product/link/update,catalog/product/link/assign,catalog/product/media,catalog/product/media/remove,catalog/product/media/update,catalog/product/media/create,catalog/product/tag,catalog/product/tag/remove,catalog/product/tag/update,catalog/product/tag/add,catalog/product/tag/info,catalog/product/tag/list,catalog/product/option,catalog/product/option/list,catalog/product/option/remove,catalog/product/option/add,catalog/product/option/info,catalog/product/option/types,catalog/product/option/update,catalog/product/option/value,catalog/product/option/value/remove,catalog/product/option/value/update,catalog/product/option/value/add,catalog/product/option/value/info,catalog/product/option/value/list,sales,sales/order,sales/order/updateitemstatus,sales/order/getlborderbyitemstatus,sales/order/setlborderitemstatus,sales/order/creditmemo,sales/order/creditmemo/list,sales/order/creditmemo/info,sales/order/creditmemo/cancel,sales/order/creditmemo/comment,sales/order/creditmemo/create,sales/order/invoice,sales/order/invoice/cancel,sales/order/invoice/info,sales/order/invoice/void,sales/order/invoice/capture,sales/order/invoice/comment,sales/order/invoice/create,sales/order/info,sales/order/shipment,sales/order/shipment/send,sales/order/shipment/info,sales/order/shipment/track,sales/order/shipment/comment,sales/order/shipment/create,sales/order/change</soap_role>
259
  </apiconfig>
260
  <crontab>
261
  <jobs>
262
  <logicbroker_dropship360>
263
  <run>
264
+ <model>dropship360/observer::logicbrokerSourcing</model>
265
  </run>
266
  </logicbroker_dropship360>
267
  <logicbroker_backorder>
268
  <run>
269
+ <model>dropship360/observer::logicbrokerBackorder</model>
270
  </run>
271
  </logicbroker_backorder>
272
  <logicbroker_uploadvendor>
273
  <run>
274
+ <model>dropship360/uploadvendor::ftpParseCsv</model>
275
  </run>
276
  </logicbroker_uploadvendor>
277
  <logicbroker_report_email>
278
  <run>
279
+ <model>dropship360/report::sendNotification</model>
280
  </run>
281
  </logicbroker_report_email>
282
+ <logicbroker_oudated_product_inventory_cron>
283
+ <run>
284
+ <model>dropship360/observer::notifyForProductUpdateInventory</model>
285
+ </run>
286
+ </logicbroker_oudated_product_inventory_cron>
287
  </jobs>
288
  </crontab>
289
  </config>
app/code/community/Logicbroker/Dropship360/etc/jstranslator.xml CHANGED
@@ -8,10 +8,10 @@
8
  */
9
  -->
10
  <jstranslator>
11
- <validate-url-logicbroker translate="message" module="logicbroker">
12
  <message>Please enter a valid URL. Protocol is required (http://, https:// or ftp://)</message>
13
  </validate-url-logicbroker>
14
- <validate-one-required-by-name-logicbroker translate="message" module="logicbroker">
15
  <message>Please select one of the options.</message>
16
  </validate-one-required-by-name-logicbroker>
17
  </jstranslator>
8
  */
9
  -->
10
  <jstranslator>
11
+ <validate-url-logicbroker translate="message" module="dropship360">
12
  <message>Please enter a valid URL. Protocol is required (http://, https:// or ftp://)</message>
13
  </validate-url-logicbroker>
14
+ <validate-one-required-by-name-logicbroker translate="message" module="dropship360">
15
  <message>Please select one of the options.</message>
16
  </validate-one-required-by-name-logicbroker>
17
  </jstranslator>
app/code/community/Logicbroker/Dropship360/etc/system.xml CHANGED
@@ -1,15 +1,15 @@
1
  <?xml version="1.0"?>
2
  <config>
3
  <tabs>
4
- <logicbroker translate="label" module="logicbroker">
5
  <label>dropship360</label>
6
  <sort_order>500</sort_order>
7
- </logicbroker>
8
  </tabs>
9
  <sections>
10
- <logicbroker_integration translate="label" module="logicbroker">
11
  <label>General Setup</label>
12
- <tab>logicbroker</tab>
13
  <frontend_type>text</frontend_type>
14
  <sort_order>40</sort_order>
15
  <show_in_default>1</show_in_default>
@@ -33,7 +33,7 @@
33
  <getstarted translate="label">
34
 
35
  <frontend_type>text</frontend_type>
36
- <frontend_model>logicbroker/adminhtml_system_config_fieldset_hint</frontend_model>
37
  <sort_order>6</sort_order>
38
  <show_in_default>1</show_in_default>
39
  <show_in_website>0</show_in_website>
@@ -47,9 +47,9 @@
47
  </groups>
48
  </logicbroker_integration>
49
 
50
- <logicbroker_sourcing translate="label" module="logicbroker">
51
  <label>Configuration/Setup</label>
52
- <tab>logicbroker</tab>
53
  <frontend_type>text</frontend_type>
54
  <sort_order>42</sort_order>
55
  <show_in_default>1</show_in_default>
@@ -70,7 +70,7 @@
70
  <ranktype translate="label">
71
  <label>Sourcing Rule</label>
72
  <frontend_type>select</frontend_type>
73
- <source_model>logicbroker/system_config_source_ranktype</source_model>
74
  <sort_order>0</sort_order>
75
  <show_in_default>1</show_in_default>
76
  <show_in_website>0</show_in_website>
@@ -80,7 +80,7 @@
80
  <defaultbackorder translate="label">
81
  <label>Default Supplier</label>
82
  <frontend_type>select</frontend_type>
83
- <source_model>logicbroker/system_config_source_vendorlist</source_model>
84
  <comment>Selected Supplier will override the backorder logic.</comment>
85
  <sort_order>1</sort_order>
86
  <show_in_default>1</show_in_default>
@@ -98,6 +98,16 @@
98
  <show_in_website>0</show_in_website>
99
  <show_in_store>0</show_in_store>
100
  </email_shipment>
 
 
 
 
 
 
 
 
 
 
101
 
102
  </fields>
103
 
@@ -143,8 +153,8 @@
143
  <fields>
144
  <sourcing_time translate="label">
145
  <label>Reprocessing Schedule Frequency</label>
146
- <frontend_model>logicbroker/adminhtml_system_config_crontime</frontend_model>
147
- <backend_model>logicbroker/system_config_backend_sourcing_cronsourcing</backend_model>
148
  <sort_order>0</sort_order>
149
  <show_in_default>1</show_in_default>
150
  <show_in_website>0</show_in_website>
@@ -153,8 +163,8 @@
153
  </sourcing_time>
154
  <backorder_time translate="label">
155
  <label>Backorder Schedule Frequency</label>
156
- <frontend_model>logicbroker/adminhtml_system_config_crontime</frontend_model>
157
- <backend_model>logicbroker/system_config_backend_sourcing_cronbackorder</backend_model>
158
  <sort_order>2</sort_order>
159
  <show_in_default>1</show_in_default>
160
  <show_in_website>0</show_in_website>
@@ -164,7 +174,7 @@
164
  <dispaly_sourcing_updated_time translate="label">
165
  <label>Reprocessing Last Run Date</label>
166
  <frontend_type>text</frontend_type>
167
- <frontend_model>logicbroker/adminhtml_system_config_submitbutton</frontend_model>
168
  <sort_order>7</sort_order>
169
  <show_in_default>1</show_in_default>
170
  <show_in_website>0</show_in_website>
@@ -173,7 +183,7 @@
173
  <display_backorder_updated_time translate="label">
174
  <label>Backorder Last Run Date</label>
175
  <frontend_type>text</frontend_type>
176
- <frontend_model>logicbroker/adminhtml_system_config_submitbutton</frontend_model>
177
  <sort_order>8</sort_order>
178
  <show_in_default>1</show_in_default>
179
  <show_in_website>0</show_in_website>
@@ -245,7 +255,7 @@
245
  <ftp_type>
246
  <label>Ftp Type</label>
247
  <frontend_type>select</frontend_type>
248
- <source_model>logicbroker/system_config_source_ftptype</source_model>
249
  <validate>required-entry</validate>
250
  <sort_order>14</sort_order>
251
  <show_in_default>1</show_in_default>
@@ -255,7 +265,7 @@
255
  </ftp_type>
256
  <ftp_testconnection>
257
  <frontend_type>button</frontend_type>
258
- <frontend_model>logicbroker/adminhtml_system_config_ftpconnectionbutton</frontend_model>
259
  <sort_order>15</sort_order>
260
  <show_in_default>1</show_in_default>
261
  <show_in_website>0</show_in_website>
@@ -264,8 +274,8 @@
264
  </ftp_testconnection>
265
  <time translate="label">
266
  <label>Frequency</label>
267
- <frontend_model>logicbroker/adminhtml_system_config_crontime</frontend_model>
268
- <backend_model>logicbroker/system_config_backend_uploadvendor_cron</backend_model>
269
  <sort_order>30</sort_order>
270
  <show_in_default>1</show_in_default>
271
  <show_in_website>0</show_in_website>
@@ -297,8 +307,8 @@
297
  </enabled>
298
  <time translate="label">
299
  <label>Frequency</label>
300
- <frontend_model>logicbroker/adminhtml_system_config_crontime</frontend_model>
301
- <backend_model>logicbroker/system_config_backend_report_email</backend_model>
302
  <sort_order>30</sort_order>
303
  <show_in_default>1</show_in_default>
304
  <show_in_website>0</show_in_website>
@@ -307,12 +317,64 @@
307
  </time>
308
  </fields>
309
  </cron_settings_report>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
310
  <integration translate="label">
311
  <label>Help</label>
312
  <page_heading>Help</page_heading>
313
  <expanded>1</expanded>
314
  <frontend_type>text</frontend_type>
315
- <sort_order>6</sort_order>
316
  <show_in_default>1</show_in_default>
317
  <show_in_website>0</show_in_website>
318
  <show_in_store>0</show_in_store>
@@ -320,7 +382,7 @@
320
  <need_help>
321
  <label>Need Help?</label>
322
  <frontend_type>link</frontend_type>
323
- <frontend_model>logicbroker/adminhtml_system_config_helplink</frontend_model>
324
  <href>http://help.logicbroker.com/dropship360</href>
325
  <sort_order>31</sort_order>
326
  <show_in_default>1</show_in_default>
1
  <?xml version="1.0"?>
2
  <config>
3
  <tabs>
4
+ <dropship360 translate="label" module="dropship360">
5
  <label>dropship360</label>
6
  <sort_order>500</sort_order>
7
+ </dropship360>
8
  </tabs>
9
  <sections>
10
+ <logicbroker_integration translate="label" module="dropship360">
11
  <label>General Setup</label>
12
+ <tab>dropship360</tab>
13
  <frontend_type>text</frontend_type>
14
  <sort_order>40</sort_order>
15
  <show_in_default>1</show_in_default>
33
  <getstarted translate="label">
34
 
35
  <frontend_type>text</frontend_type>
36
+ <frontend_model>dropship360/adminhtml_system_config_fieldset_hint</frontend_model>
37
  <sort_order>6</sort_order>
38
  <show_in_default>1</show_in_default>
39
  <show_in_website>0</show_in_website>
47
  </groups>
48
  </logicbroker_integration>
49
 
50
+ <logicbroker_sourcing translate="label" module="dropship360">
51
  <label>Configuration/Setup</label>
52
+ <tab>dropship360</tab>
53
  <frontend_type>text</frontend_type>
54
  <sort_order>42</sort_order>
55
  <show_in_default>1</show_in_default>
70
  <ranktype translate="label">
71
  <label>Sourcing Rule</label>
72
  <frontend_type>select</frontend_type>
73
+ <source_model>dropship360/system_config_source_ranktype</source_model>
74
  <sort_order>0</sort_order>
75
  <show_in_default>1</show_in_default>
76
  <show_in_website>0</show_in_website>
80
  <defaultbackorder translate="label">
81
  <label>Default Supplier</label>
82
  <frontend_type>select</frontend_type>
83
+ <source_model>dropship360/system_config_source_vendorlist</source_model>
84
  <comment>Selected Supplier will override the backorder logic.</comment>
85
  <sort_order>1</sort_order>
86
  <show_in_default>1</show_in_default>
98
  <show_in_website>0</show_in_website>
99
  <show_in_store>0</show_in_store>
100
  </email_shipment>
101
+ <sourcing_type>
102
+ <label>Event Driven Sourcing</label>
103
+ <frontend_type>select</frontend_type>
104
+ <source_model>adminhtml/system_config_source_yesno</source_model>
105
+ <comment>Select "Yes" to trigger sourcing logic in the sales_order_place_after event.</comment>
106
+ <sort_order>3</sort_order>
107
+ <show_in_default>1</show_in_default>
108
+ <show_in_website>0</show_in_website>
109
+ <show_in_store>0</show_in_store>
110
+ </sourcing_type>
111
 
112
  </fields>
113
 
153
  <fields>
154
  <sourcing_time translate="label">
155
  <label>Reprocessing Schedule Frequency</label>
156
+ <frontend_model>dropship360/adminhtml_system_config_crontime</frontend_model>
157
+ <backend_model>dropship360/system_config_backend_sourcing_cronsourcing</backend_model>
158
  <sort_order>0</sort_order>
159
  <show_in_default>1</show_in_default>
160
  <show_in_website>0</show_in_website>
163
  </sourcing_time>
164
  <backorder_time translate="label">
165
  <label>Backorder Schedule Frequency</label>
166
+ <frontend_model>dropship360/adminhtml_system_config_crontime</frontend_model>
167
+ <backend_model>dropship360/system_config_backend_sourcing_cronbackorder</backend_model>
168
  <sort_order>2</sort_order>
169
  <show_in_default>1</show_in_default>
170
  <show_in_website>0</show_in_website>
174
  <dispaly_sourcing_updated_time translate="label">
175
  <label>Reprocessing Last Run Date</label>
176
  <frontend_type>text</frontend_type>
177
+ <frontend_model>dropship360/adminhtml_system_config_submitbutton</frontend_model>
178
  <sort_order>7</sort_order>
179
  <show_in_default>1</show_in_default>
180
  <show_in_website>0</show_in_website>
183
  <display_backorder_updated_time translate="label">
184
  <label>Backorder Last Run Date</label>
185
  <frontend_type>text</frontend_type>
186
+ <frontend_model>dropship360/adminhtml_system_config_submitbutton</frontend_model>
187
  <sort_order>8</sort_order>
188
  <show_in_default>1</show_in_default>
189
  <show_in_website>0</show_in_website>
255
  <ftp_type>
256
  <label>Ftp Type</label>
257
  <frontend_type>select</frontend_type>
258
+ <source_model>dropship360/system_config_source_ftptype</source_model>
259
  <validate>required-entry</validate>
260
  <sort_order>14</sort_order>
261
  <show_in_default>1</show_in_default>
265
  </ftp_type>
266
  <ftp_testconnection>
267
  <frontend_type>button</frontend_type>
268
+ <frontend_model>dropship360/adminhtml_system_config_ftpconnectionbutton</frontend_model>
269
  <sort_order>15</sort_order>
270
  <show_in_default>1</show_in_default>
271
  <show_in_website>0</show_in_website>
274
  </ftp_testconnection>
275
  <time translate="label">
276
  <label>Frequency</label>
277
+ <frontend_model>dropship360/adminhtml_system_config_crontime</frontend_model>
278
+ <backend_model>dropship360/system_config_backend_uploadvendor_cron</backend_model>
279
  <sort_order>30</sort_order>
280
  <show_in_default>1</show_in_default>
281
  <show_in_website>0</show_in_website>
307
  </enabled>
308
  <time translate="label">
309
  <label>Frequency</label>
310
+ <frontend_model>dropship360/adminhtml_system_config_crontime</frontend_model>
311
+ <backend_model>dropship360/system_config_backend_report_email</backend_model>
312
  <sort_order>30</sort_order>
313
  <show_in_default>1</show_in_default>
314
  <show_in_website>0</show_in_website>
317
  </time>
318
  </fields>
319
  </cron_settings_report>
320
+ <inventory_notification translate="label">
321
+ <label>Inventory Notification</label>
322
+ <page_heading>Help</page_heading>
323
+ <expanded>1</expanded>
324
+ <frontend_type>text</frontend_type>
325
+ <sort_order>6</sort_order>
326
+ <show_in_default>1</show_in_default>
327
+ <show_in_website>0</show_in_website>
328
+ <show_in_store>0</show_in_store>
329
+ <fields>
330
+ <enabled translate="label">
331
+ <label>Enable</label>
332
+ <frontend_type>select</frontend_type>
333
+ <source_model>adminhtml/system_config_source_yesno</source_model>
334
+ <sort_order>9</sort_order>
335
+ <show_in_default>1</show_in_default>
336
+ <show_in_website>0</show_in_website>
337
+ <show_in_store>0</show_in_store>
338
+ </enabled>
339
+ <cron_setting translate="label">
340
+ <label>Oudated Product Notification Cron Frequency</label>
341
+ <frontend_model>dropship360/adminhtml_system_config_crontime</frontend_model>
342
+ <backend_model>dropship360/system_config_backend_oudatedinventory_email</backend_model>
343
+ <sort_order>10</sort_order>
344
+ <show_in_default>1</show_in_default>
345
+ <show_in_website>0</show_in_website>
346
+ <show_in_store>0</show_in_store>
347
+ <depends><enabled>1</enabled></depends>
348
+ </cron_setting>
349
+ <email>
350
+ <label>Email Address</label>
351
+ <frontend_type>text</frontend_type>
352
+ <validate>required-entry validate-email </validate>
353
+ <sort_order>11</sort_order>
354
+ <show_in_default>1</show_in_default>
355
+ <show_in_website>0</show_in_website>
356
+ <show_in_store>0</show_in_store>
357
+ <depends><enabled>1</enabled></depends>
358
+ </email>
359
+ <days>
360
+ <label>Notify me when inventory isnt't updated for all products in</label>
361
+ <frontend_type>text</frontend_type>
362
+ <validate>required-entry validate-digits validate-digits-range digits-range-1-100</validate>
363
+ <comment>days range from 1 to 100</comment>
364
+ <sort_order>12</sort_order>
365
+ <show_in_default>1</show_in_default>
366
+ <show_in_website>0</show_in_website>
367
+ <show_in_store>0</show_in_store>
368
+ <depends><enabled>1</enabled></depends>
369
+ </days>
370
+ </fields>
371
+ </inventory_notification>
372
  <integration translate="label">
373
  <label>Help</label>
374
  <page_heading>Help</page_heading>
375
  <expanded>1</expanded>
376
  <frontend_type>text</frontend_type>
377
+ <sort_order>7</sort_order>
378
  <show_in_default>1</show_in_default>
379
  <show_in_website>0</show_in_website>
380
  <show_in_store>0</show_in_store>
382
  <need_help>
383
  <label>Need Help?</label>
384
  <frontend_type>link</frontend_type>
385
+ <frontend_model>dropship360/adminhtml_system_config_helplink</frontend_model>
386
  <href>http://help.logicbroker.com/dropship360</href>
387
  <sort_order>31</sort_order>
388
  <show_in_default>1</show_in_default>
app/code/community/Logicbroker/Dropship360/sql/dropship360_setup/mysql4-install-1.0.3.php CHANGED
@@ -11,9 +11,9 @@ $installer = $this;
11
  $installer->startSetup();
12
 
13
  $installer->run("
14
- DROP TABLE IF EXISTS {$installer->getTable('logicbroker/supplier')};
15
- -- DROP TABLE IF EXISTS {$installer->getTable('logicbroker/inventory')};
16
- CREATE TABLE IF NOT EXISTS {$installer->getTable('logicbroker/inventory')} (
17
  id INT( 11 ) NOT NULL AUTO_INCREMENT ,
18
  lb_vendor_code VARCHAR( 50 ) NOT NULL ,
19
  lb_vendor_name varchar(50) NOT NULL,
@@ -31,8 +31,8 @@ CREATE TABLE IF NOT EXISTS {$installer->getTable('logicbroker/inventory')} (
31
  KEY `cost` (`cost`)
32
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=0;
33
 
34
- -- DROP TABLE IF EXISTS {$installer->getTable('logicbroker/ranking')};
35
- CREATE TABLE IF NOT EXISTS {$installer->getTable('logicbroker/ranking')} (
36
  `id` int(11) NOT NULL AUTO_INCREMENT,
37
  `lb_vendor_code` varchar(50) NOT NULL,
38
  lb_vendor_name varchar(50) NOT NULL,
@@ -51,8 +51,8 @@ CREATE TABLE IF NOT EXISTS {$installer->getTable('logicbroker/ranking')} (
51
 
52
  -- INSERT INTO `logicbroker_vendor_ranking` (`lb_vendor_code` ,`lb_vendor_name`,`ranking`,`updated_at`)VALUES ('MagVendID1','Vendor 1',1,now()),('MagVendID2','Vendor 2',2,now()),('MagVendID3','Vendor 3',3,now()),('MagVendID4','Vendor 4',4,now()),('MagVendID5','Vendor 5',5,now()),('MagVendID6','Vendor 6',6,now()),('MagVendID7','Vendor 7',7,now()),('MagVendID8','Vendor 8',8,now()),('MagVendID9','Vendor 9',9,now()),('MagVendID10','Vendor 10',10,now()),('MagVendID11','Vendor 11',11,now()),('MagVendID12','Vendor12',12,now()),('MagVendID13','Vendor 13',13,now()),('MagVendID14','Vendor 14',14,now()),('MagVendID15','Vendor15',15,now()),('MagVendID16','Vendor 16',16,now()),('MagVendID17','Vendor 17',17,now()),('MagVendID18','Vendor 18',18,now()),('MagVendID19','Vendor 19',19,now()),('MagVendID20','Vendor 20',20,now());
53
 
54
- -- DROP TABLE IF EXISTS {$installer->getTable('logicbroker/rankinglog')};
55
- CREATE TABLE IF NOT EXISTS {$installer->getTable('logicbroker/rankinglog')} (
56
  id INT( 11 ) NOT NULL AUTO_INCREMENT ,
57
  label VARCHAR( 50 ) NOT NULL ,
58
  ranking_data text NOT NULL ,
@@ -62,8 +62,8 @@ CREATE TABLE IF NOT EXISTS {$installer->getTable('logicbroker/rankinglog')} (
62
 
63
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=0;
64
 
65
- -- DROP TABLE IF EXISTS {$installer->getTable('logicbroker/ordersourcing')};
66
- CREATE TABLE IF NOT EXISTS {$installer->getTable('logicbroker/ordersourcing')} (
67
  id int(11) NOT NULL AUTO_INCREMENT,
68
  order_id int(10) NOT NULL,
69
  sourcing enum('new','resourcing','done') NOT NULL DEFAULT 'new',
@@ -75,8 +75,8 @@ CREATE TABLE IF NOT EXISTS {$installer->getTable('logicbroker/ordersourcing')} (
75
  KEY `id` (`id`)
76
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=0;
77
 
78
- -- DROP TABLE IF EXISTS {$installer->getTable('logicbroker/orderitems')};
79
- CREATE TABLE IF NOT EXISTS {$installer->getTable('logicbroker/orderitems')} (
80
  id int(11) NOT NULL AUTO_INCREMENT,
81
  item_id int(10) NOT NULL,
82
  item_order_id varchar(11) NOT NULL,
11
  $installer->startSetup();
12
 
13
  $installer->run("
14
+ DROP TABLE IF EXISTS {$installer->getTable('dropship360/supplier')};
15
+ -- DROP TABLE IF EXISTS {$installer->getTable('dropship360/inventory')};
16
+ CREATE TABLE IF NOT EXISTS {$installer->getTable('dropship360/inventory')} (
17
  id INT( 11 ) NOT NULL AUTO_INCREMENT ,
18
  lb_vendor_code VARCHAR( 50 ) NOT NULL ,
19
  lb_vendor_name varchar(50) NOT NULL,
31
  KEY `cost` (`cost`)
32
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=0;
33
 
34
+ -- DROP TABLE IF EXISTS {$installer->getTable('dropship360/ranking')};
35
+ CREATE TABLE IF NOT EXISTS {$installer->getTable('dropship360/ranking')} (
36
  `id` int(11) NOT NULL AUTO_INCREMENT,
37
  `lb_vendor_code` varchar(50) NOT NULL,
38
  lb_vendor_name varchar(50) NOT NULL,
51
 
52
  -- INSERT INTO `logicbroker_vendor_ranking` (`lb_vendor_code` ,`lb_vendor_name`,`ranking`,`updated_at`)VALUES ('MagVendID1','Vendor 1',1,now()),('MagVendID2','Vendor 2',2,now()),('MagVendID3','Vendor 3',3,now()),('MagVendID4','Vendor 4',4,now()),('MagVendID5','Vendor 5',5,now()),('MagVendID6','Vendor 6',6,now()),('MagVendID7','Vendor 7',7,now()),('MagVendID8','Vendor 8',8,now()),('MagVendID9','Vendor 9',9,now()),('MagVendID10','Vendor 10',10,now()),('MagVendID11','Vendor 11',11,now()),('MagVendID12','Vendor12',12,now()),('MagVendID13','Vendor 13',13,now()),('MagVendID14','Vendor 14',14,now()),('MagVendID15','Vendor15',15,now()),('MagVendID16','Vendor 16',16,now()),('MagVendID17','Vendor 17',17,now()),('MagVendID18','Vendor 18',18,now()),('MagVendID19','Vendor 19',19,now()),('MagVendID20','Vendor 20',20,now());
53
 
54
+ -- DROP TABLE IF EXISTS {$installer->getTable('dropship360/rankinglog')};
55
+ CREATE TABLE IF NOT EXISTS {$installer->getTable('dropship360/rankinglog')} (
56
  id INT( 11 ) NOT NULL AUTO_INCREMENT ,
57
  label VARCHAR( 50 ) NOT NULL ,
58
  ranking_data text NOT NULL ,
62
 
63
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=0;
64
 
65
+ -- DROP TABLE IF EXISTS {$installer->getTable('dropship360/ordersourcing')};
66
+ CREATE TABLE IF NOT EXISTS {$installer->getTable('dropship360/ordersourcing')} (
67
  id int(11) NOT NULL AUTO_INCREMENT,
68
  order_id int(10) NOT NULL,
69
  sourcing enum('new','resourcing','done') NOT NULL DEFAULT 'new',
75
  KEY `id` (`id`)
76
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=0;
77
 
78
+ -- DROP TABLE IF EXISTS {$installer->getTable('dropship360/orderitems')};
79
+ CREATE TABLE IF NOT EXISTS {$installer->getTable('dropship360/orderitems')} (
80
  id int(11) NOT NULL AUTO_INCREMENT,
81
  item_id int(10) NOT NULL,
82
  item_order_id varchar(11) NOT NULL,
app/code/community/Logicbroker/Dropship360/sql/dropship360_setup/mysql4-upgrade-1.0.3-1.0.4.php CHANGED
@@ -11,7 +11,7 @@ $installer->startSetup();
11
 
12
  $installer->run("
13
 
14
- CREATE TABLE IF NOT EXISTS {$installer->getTable('logicbroker/inventorylog')} (
15
  `id` int(11) NOT NULL AUTO_INCREMENT,
16
  `lb_vendor_code` varchar(50) NOT NULL,
17
  `lb_vendor_name` varchar(50) NOT NULL,
@@ -25,7 +25,7 @@ CREATE TABLE IF NOT EXISTS {$installer->getTable('logicbroker/inventorylog')} (
25
  PRIMARY KEY (`id`)
26
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ;
27
 
28
- CREATE TABLE IF NOT EXISTS {$installer->getTable('logicbroker/uploadvendor')} (
29
  `file_id` int(11) NOT NULL AUTO_INCREMENT,
30
  `file_name` varchar(50) NOT NULL,
31
  `import_status` enum('pending','done','processing') NOT NULL DEFAULT 'pending',
@@ -37,8 +37,8 @@ CREATE TABLE IF NOT EXISTS {$installer->getTable('logicbroker/uploadvendor')} (
37
  KEY `import_status` (`import_status`)
38
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ;
39
 
40
- DROP TABLE IF EXISTS {$installer->getTable('logicbroker/vendor_import_log')};
41
- CREATE TABLE IF NOT EXISTS {$installer->getTable('logicbroker/vendor_import_log')} (
42
  `lb_vendor_code` varchar(50) NOT NULL,
43
  `updated_by` text NOT NULL,
44
  `success` int(11) NOT NULL,
@@ -49,7 +49,7 @@ CREATE TABLE IF NOT EXISTS {$installer->getTable('logicbroker/vendor_import_log'
49
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ;
50
  ");
51
 
52
- $installer->getConnection()->modifyColumn($installer->getTable('logicbroker/inventorylog'),'cost', 'VARCHAR( 50 ) DEFAULT NULL');
53
- $installer->getConnection()->modifyColumn($installer->getTable('logicbroker/inventorylog'),'stock', 'VARCHAR( 50 ) DEFAULT NULL');
54
- $installer->getConnection()->modifyColumn($installer->getTable('logicbroker/inventorylog'),'activity', 'VARCHAR( 255 ) DEFAULT NULL');
55
  $installer->endSetup();
11
 
12
  $installer->run("
13
 
14
+ CREATE TABLE IF NOT EXISTS {$installer->getTable('dropship360/inventorylog')} (
15
  `id` int(11) NOT NULL AUTO_INCREMENT,
16
  `lb_vendor_code` varchar(50) NOT NULL,
17
  `lb_vendor_name` varchar(50) NOT NULL,
25
  PRIMARY KEY (`id`)
26
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ;
27
 
28
+ CREATE TABLE IF NOT EXISTS {$installer->getTable('dropship360/uploadvendor')} (
29
  `file_id` int(11) NOT NULL AUTO_INCREMENT,
30
  `file_name` varchar(50) NOT NULL,
31
  `import_status` enum('pending','done','processing') NOT NULL DEFAULT 'pending',
37
  KEY `import_status` (`import_status`)
38
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ;
39
 
40
+ -- DROP TABLE IF EXISTS {$installer->getTable('dropship360/vendor_import_log')};
41
+ CREATE TABLE IF NOT EXISTS {$installer->getTable('dropship360/vendor_import_log')} (
42
  `lb_vendor_code` varchar(50) NOT NULL,
43
  `updated_by` text NOT NULL,
44
  `success` int(11) NOT NULL,
49
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ;
50
  ");
51
 
52
+ $installer->getConnection()->modifyColumn($installer->getTable('dropship360/inventorylog'),'cost', 'VARCHAR( 50 ) DEFAULT NULL');
53
+ $installer->getConnection()->modifyColumn($installer->getTable('dropship360/inventorylog'),'stock', 'VARCHAR( 50 ) DEFAULT NULL');
54
+ $installer->getConnection()->modifyColumn($installer->getTable('dropship360/inventorylog'),'activity', 'VARCHAR( 255 ) DEFAULT NULL');
55
  $installer->endSetup();
app/code/community/Logicbroker/Dropship360/sql/dropship360_setup/mysql4-upgrade-1.0.4-1.0.5.php CHANGED
@@ -7,16 +7,15 @@
7
  */
8
  $installer = $this;
9
  $installer->startSetup();
10
- $installer->getConnection()->modifyColumn($installer->getTable('logicbroker/inventory'),'stock', 'VARCHAR(11) NOT NULL');
11
- $installer->getConnection()->modifyColumn($installer->getTable('logicbroker/inventory'),'created_at', 'TIMESTAMP NULL');
12
- $installer->getConnection()->modifyColumn($installer->getTable('logicbroker/inventorylog'),'created_at', 'TIMESTAMP NULL');
13
- $installer->getConnection()->modifyColumn($installer->getTable('logicbroker/uploadvendor'),'created_at', 'TIMESTAMP NULL');
14
- $installer->getConnection()->modifyColumn($installer->getTable('logicbroker/vendor_import_log'),'created_at', 'TIMESTAMP NULL');
15
- $installer->getConnection()->modifyColumn($installer->getTable('logicbroker/ranking'),'created_at', 'TIMESTAMP NULL');
16
- $installer->getConnection()->modifyColumn($installer->getTable('logicbroker/rankinglog'),'created_at', 'TIMESTAMP NULL');
17
- //$installer->run("ALTER TABLE {$this->getTable('logicbroker_sales_orders_items')} ADD COLUMN `item_status_history` TEXT NULL");
18
- $installer->getConnection()->addColumn($installer->getTable('logicbroker/orderitems'), 'item_status_history', 'TEXT NULL');
19
- $installer->run("CREATE TABLE IF NOT EXISTS {$installer->getTable('logicbroker/tmpdata')} (
20
  `id` int(10) NOT NULL AUTO_INCREMENT,
21
  `tmpdata` varchar(255) NOT NULL,
22
  `created_at` timestamp NULL DEFAULT NULL,
@@ -24,6 +23,6 @@ $installer->run("CREATE TABLE IF NOT EXISTS {$installer->getTable('logicbroker/t
24
  `status` varchar(255) NOT NULL DEFAULT 'active',
25
  PRIMARY KEY (`id`)
26
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;");
27
- $installer->getConnection()->modifyColumn($installer->getTable('logicbroker/orderitems'),'lb_item_status', ' ENUM( "Sourcing", "Reprocess", "Backorder", "Transmitting", "Sent to Supplier", "Sent to Vendor", "Cancelled", "No Dropship", "Completed" ) NOT NULL DEFAULT "Sourcing" ');
28
 
29
  $installer->endSetup();
7
  */
8
  $installer = $this;
9
  $installer->startSetup();
10
+ $installer->getConnection()->modifyColumn($installer->getTable('dropship360/inventory'),'stock', 'VARCHAR(11) NOT NULL');
11
+ $installer->getConnection()->modifyColumn($installer->getTable('dropship360/inventory'),'created_at', 'TIMESTAMP NULL');
12
+ $installer->getConnection()->modifyColumn($installer->getTable('dropship360/inventorylog'),'created_at', 'TIMESTAMP NULL');
13
+ $installer->getConnection()->modifyColumn($installer->getTable('dropship360/uploadvendor'),'created_at', 'TIMESTAMP NULL');
14
+ $installer->getConnection()->modifyColumn($installer->getTable('dropship360/vendor_import_log'),'created_at', 'TIMESTAMP NULL');
15
+ $installer->getConnection()->modifyColumn($installer->getTable('dropship360/ranking'),'created_at', 'TIMESTAMP NULL');
16
+ $installer->getConnection()->modifyColumn($installer->getTable('dropship360/rankinglog'),'created_at', 'TIMESTAMP NULL');
17
+ $installer->getConnection()->addColumn($installer->getTable('dropship360/orderitems'), 'item_status_history', 'TEXT NULL');
18
+ $installer->run("CREATE TABLE IF NOT EXISTS {$installer->getTable('dropship360/tmpdata')} (
 
19
  `id` int(10) NOT NULL AUTO_INCREMENT,
20
  `tmpdata` varchar(255) NOT NULL,
21
  `created_at` timestamp NULL DEFAULT NULL,
23
  `status` varchar(255) NOT NULL DEFAULT 'active',
24
  PRIMARY KEY (`id`)
25
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;");
26
+ $installer->getConnection()->modifyColumn($installer->getTable('dropship360/orderitems'),'lb_item_status', ' ENUM( "Sourcing", "Reprocess", "Backorder", "Transmitting", "Sent to Supplier", "Sent to Vendor", "Cancelled", "No Dropship", "Completed" ) NOT NULL DEFAULT "Sourcing" ');
27
 
28
  $installer->endSetup();
app/code/community/Logicbroker/Dropship360/sql/dropship360_setup/mysql4-upgrade-1.0.5-1.0.6.php ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Logicbroker
4
+ *
5
+ * @category Community
6
+ * @package Logicbroker_Dropship360
7
+ */
8
+ $installer = $this;
9
+ $importLog = $installer->getTable('dropship360/vendor_import_log');
10
+ $ranking = $installer->getTable('dropship360/ranking');
11
+ $installer->startSetup();
12
+ $installer->getConnection()->addColumn($importLog, 'error_id', array(
13
+ 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER,
14
+ 'identity' => true,
15
+ 'nullable' => false,
16
+ 'unsigned' => true,
17
+ 'primary' => true,
18
+ 'comment' => 'Add error id row'
19
+ )
20
+ );
21
+ $installer->getConnection()->addKey($importLog, 'error_id', 'error_id');
22
+ $installer->getConnection()->addColumn($ranking, 'linking_attribute', array(
23
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
24
+ 'length' =>255,
25
+ 'nullable' => true,
26
+ 'default' => null,
27
+ 'comment' => 'linking attribute'));
28
+ $installer->run(
29
+ "DROP TABLE IF EXISTS {$installer->getTable('dropship360/csvtmpdata')};
30
+ CREATE TABLE IF NOT EXISTS {$installer->getTable('dropship360/csvtmpdata')} (
31
+ `row_id` INT(11) NOT NULL AUTO_INCREMENT ,
32
+ `vendor_code` varchar(50) NOT NULL,
33
+ `csv_vendor_sku` varchar(50) NOT NULL,
34
+ `csv_stock` varchar(11) NOT NULL,
35
+ `csv_price` varchar(11) NOT NULL,
36
+ `is_processed` int(1) NOT NULL DEFAULT '0',
37
+ KEY `row_id` (`row_id`),
38
+ KEY `vendor_code` (`vendor_code`),
39
+ KEY `csv_vendor_sku` (`csv_vendor_sku`),
40
+ KEY `csv_stock` (`csv_stock`),
41
+ KEY `csv_price` (`csv_price`),
42
+ KEY `is_processed` (`is_processed`)
43
+ ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;
44
+ CREATE TABLE IF NOT EXISTS {$installer->getTable('dropship360/vendor_import_log_desc')} (
45
+ `id` int(11) NOT NULL AUTO_INCREMENT,
46
+ `error_id` int(10) unsigned NOT NULL,
47
+ `description` varchar(255) CHARACTER SET utf8 NOT NULL,
48
+ PRIMARY KEY (`id`),
49
+ KEY `error_id` (`error_id`),
50
+ FOREIGN KEY (`error_id`) REFERENCES {$installer->getTable('dropship360/vendor_import_log')} (`error_id`) ON DELETE CASCADE
51
+ ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;");
52
+
53
+ //patch apply for MAGENTO-CE/EE 1.9.2.2
54
+ $admin_permission_block = Mage::getConfig()->getTablePrefix().'permission_block';
55
+ if ($installer->getConnection()->isTableExists($admin_permission_block)){
56
+ $installer->getConnection()->insertMultiple(
57
+ $installer->getTable('admin/permission_block'),
58
+ array(
59
+ array('block_name' => 'dropship360/adminhtml_reports_staticemailgrid', 'is_allowed' => 1)
60
+ )
61
+ );
62
+ }
63
+ $admin_permission_var = Mage::getConfig()->getTablePrefix().'permission_variable';
64
+ if ($installer->getConnection()->isTableExists($admin_permission_var)){
65
+ $installer->getConnection()->insertMultiple(
66
+ $installer->getTable('admin/permission_variable'),
67
+ array(
68
+ array('variable_name' => 'logicbroker_sourcing/cron_settings_upload/ftp_site', 'is_allowed' => 1),
69
+ array('variable_name' => 'logicbroker_sourcing/cron_settings_upload/ftp_accnumber', 'is_allowed' => 1),
70
+ array('variable_name' => 'logicbroker_sourcing/cron_settings_upload/ftp_username', 'is_allowed' => 1),
71
+ )
72
+ );
73
+ }
74
+ $installer->endSetup();
app/code/community/Logicbroker/Dropship360/sql/dropship360_setup/mysql4-upgrade-1.0.6-1.0.7.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Logicbroker
4
+ *
5
+ * @category Community
6
+ * @package Logicbroker_Dropship360
7
+ */
8
+ $installer = $this;
9
+ //apply patch for insert on duplicate
10
+ $csvTempData = $installer->getTable('dropship360/csvtmpdata');
11
+ $installer->getConnection()->addKey($csvTempData,'csv_vendor_sku_unique','csv_vendor_sku','unique');
12
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/logicbroker.xml CHANGED
@@ -3,12 +3,12 @@
3
 
4
  <default>
5
  <reference name="notifications">
6
- <block type="logicbroker/adminhtml_notification" name="logicbrokernotification" as="logicbrokernotification" template="logicbroker/window.phtml" />
7
  </reference>
8
  </default>
9
  <logicbroker_adminhtml_logicbroker_index>
10
  <reference name="content">
11
- <block type="logicbroker/adminhtml_logicbroker" name="logicbroker" />
12
  </reference>
13
  <reference name="js">
14
  <block type="core/template" template="logicbroker/add_help_js.phtml"/>
@@ -17,7 +17,7 @@
17
 
18
  <logicbroker_adminhtml_sourcing_sourcinggrid>
19
  <reference name="content">
20
- <block type="logicbroker/adminhtml_sourcing" name="logicbroker" />
21
  </reference>
22
  <reference name="js">
23
  <block type="core/template" template="logicbroker/add_help_js.phtml"/>
@@ -36,8 +36,8 @@
36
  <block type="core/template" template="logicbroker/add_help_js.phtml"/>
37
  </reference>
38
  <reference name="content">
39
- <block type="logicbroker/adminhtml_ranking" name="ranking">
40
- <block type="logicbroker/adminhtml_upload" name="upload" as = "supplier.upload" template = "logicbroker/upload_vendor_product.phtml">
41
  <action method="setHeaderText"><value>Setup Supplier Products</value></action>
42
  <action method="setProductSetupMode"><value>true</value></action>
43
  </block>
@@ -47,7 +47,7 @@
47
 
48
  <logicbroker_adminhtml_inventory_index>
49
  <reference name="content">
50
- <block type="logicbroker/adminhtml_inventory" name="inventory" />
51
  </reference>
52
  <reference name="js">
53
  <block type="core/template" template="logicbroker/add_help_js.phtml"/>
@@ -57,7 +57,7 @@
57
  <logicbroker_adminhtml_inventory_vendors>
58
  <reference name="content">
59
  <block type="core/text_list" name="root" output="toHtml" >
60
- <block type="logicbroker/adminhtml_inventory_edit_tab_lbvendor" name="vendors_product_tab" template="logicbroker/vendorproducttab.phtml"/>
61
  </block>
62
  </reference>
63
  </logicbroker_adminhtml_inventory_vendors>
@@ -65,14 +65,14 @@
65
  <logicbroker_adminhtml_inventory_vendorshistory>
66
  <reference name="content">
67
  <block type="core/text_list" name="root" output="toHtml" >
68
- <block type="logicbroker/adminhtml_inventory_edit_tab_vendortabhistory" name="vendors_product_tab_history" template="logicbroker/vendorproducttabhistory.phtml"/>
69
  </block>
70
  </reference>
71
  </logicbroker_adminhtml_inventory_vendorshistory>
72
 
73
  <logicbroker_adminhtml_upload_vendorsuploadhistory>
74
  <reference name="content">
75
- <block type="logicbroker/adminhtml_Vendorproductuploadhistory" name="vendors_product_upload_history" template="logicbroker/vendor_upload_product_history.phtml"/>
76
  </reference>
77
  <reference name="js">
78
  <block type="core/template" template="logicbroker/add_help_js.phtml"/>
@@ -88,7 +88,7 @@
88
 
89
  <logicbroker_adminhtml_ranking_showhistory>
90
  <reference name="content">
91
- <block type="logicbroker/adminhtml_showhistory" name="showhistory" template="logicbroker/result.phtml"/>
92
  </reference>
93
  <reference name="js">
94
  <block type="core/template" template="logicbroker/add_help_js.phtml"/>
@@ -97,8 +97,8 @@
97
 
98
  <logicbroker_adminhtml_upload_index>
99
  <reference name="content">
100
- <block type="logicbroker/adminhtml_upload" name="upload" template = "logicbroker/upload_vendor_product.phtml">
101
- <block type="logicbroker/adminhtml_inventory" name="inventory" />
102
  <action method="setHeaderText"><value>Supplier Inventory</value></action>
103
  </block>
104
  </reference>
@@ -116,7 +116,7 @@
116
  <action method="addJs"><script>mage/translate.js</script></action>
117
  <action method="addJs"><script>mage/adminhtml/tools.js</script></action>
118
  </block>
119
- <block type="logicbroker/adminhtml_upload_bulkassign" name="logicbroker_bulkassign" template="logicbroker/process-profile.phtml" output="toHtml"/>
120
  </block>
121
  </logicbroker_adminhtml_upload_run>
122
 
@@ -145,12 +145,12 @@
145
 
146
  <adminhtml_catalog_product_edit>
147
  <reference name="product_tabs">
148
- <block type="logicbroker/adminhtml_inventory_edit_vendortab" name="vendor_tab"/>
149
  <action method="addTab">
150
  <name>vendor_tab</name>
151
  <block>vendor_tab</block>
152
  </action>
153
- <block type="logicbroker/adminhtml_inventory_edit_vendortabhistory" name="vendor_tab_history"/>
154
  <action method="addTab">
155
  <name>vendor_tab_history</name>
156
  <block>vendor_tab_history</block>
@@ -160,8 +160,8 @@
160
  <logicbroker_adminhtml_report_activitymonitor>
161
  <update handle="report_sales"/>
162
  <reference name="content">
163
- <block type="logicbroker/adminhtml_reports_activitymonitor" template="logicbroker/reports/grid/container.phtml" name="report.activitymonitor">
164
- <block type="logicbroker/adminhtml_reports_activitymonitor_form" name="report.activitymonitor.form"/>
165
  </block>
166
  </reference>
167
  <reference name="js">
3
 
4
  <default>
5
  <reference name="notifications">
6
+ <block type="dropship360/adminhtml_notification" name="logicbrokernotification" as="logicbrokernotification" template="logicbroker/window.phtml" />
7
  </reference>
8
  </default>
9
  <logicbroker_adminhtml_logicbroker_index>
10
  <reference name="content">
11
+ <block type="dropship360/adminhtml_logicbroker" name="dropship360" />
12
  </reference>
13
  <reference name="js">
14
  <block type="core/template" template="logicbroker/add_help_js.phtml"/>
17
 
18
  <logicbroker_adminhtml_sourcing_sourcinggrid>
19
  <reference name="content">
20
+ <block type="dropship360/adminhtml_sourcing" name="dropship360" />
21
  </reference>
22
  <reference name="js">
23
  <block type="core/template" template="logicbroker/add_help_js.phtml"/>
36
  <block type="core/template" template="logicbroker/add_help_js.phtml"/>
37
  </reference>
38
  <reference name="content">
39
+ <block type="dropship360/adminhtml_ranking" name="ranking">
40
+ <block type="dropship360/adminhtml_upload" name="upload" as = "supplier.upload" template = "logicbroker/upload_vendor_product.phtml">
41
  <action method="setHeaderText"><value>Setup Supplier Products</value></action>
42
  <action method="setProductSetupMode"><value>true</value></action>
43
  </block>
47
 
48
  <logicbroker_adminhtml_inventory_index>
49
  <reference name="content">
50
+ <block type="dropship360/adminhtml_inventory" name="inventory" />
51
  </reference>
52
  <reference name="js">
53
  <block type="core/template" template="logicbroker/add_help_js.phtml"/>
57
  <logicbroker_adminhtml_inventory_vendors>
58
  <reference name="content">
59
  <block type="core/text_list" name="root" output="toHtml" >
60
+ <block type="dropship360/adminhtml_inventory_edit_tab_lbvendor" name="vendors_product_tab" template="logicbroker/vendorproducttab.phtml"/>
61
  </block>
62
  </reference>
63
  </logicbroker_adminhtml_inventory_vendors>
65
  <logicbroker_adminhtml_inventory_vendorshistory>
66
  <reference name="content">
67
  <block type="core/text_list" name="root" output="toHtml" >
68
+ <block type="dropship360/adminhtml_inventory_edit_tab_vendortabhistory" name="vendors_product_tab_history" template="logicbroker/vendorproducttabhistory.phtml"/>
69
  </block>
70
  </reference>
71
  </logicbroker_adminhtml_inventory_vendorshistory>
72
 
73
  <logicbroker_adminhtml_upload_vendorsuploadhistory>
74
  <reference name="content">
75
+ <block type="dropship360/adminhtml_Vendorproductuploadhistory" name="vendors_product_upload_history" template="logicbroker/vendor_upload_product_history.phtml"/>
76
  </reference>
77
  <reference name="js">
78
  <block type="core/template" template="logicbroker/add_help_js.phtml"/>
88
 
89
  <logicbroker_adminhtml_ranking_showhistory>
90
  <reference name="content">
91
+ <block type="dropship360/adminhtml_showhistory" name="showhistory" template="logicbroker/result.phtml"/>
92
  </reference>
93
  <reference name="js">
94
  <block type="core/template" template="logicbroker/add_help_js.phtml"/>
97
 
98
  <logicbroker_adminhtml_upload_index>
99
  <reference name="content">
100
+ <block type="dropship360/adminhtml_upload" name="upload" template = "logicbroker/upload_vendor_product.phtml">
101
+ <block type="dropship360/adminhtml_inventory" name="inventory" />
102
  <action method="setHeaderText"><value>Supplier Inventory</value></action>
103
  </block>
104
  </reference>
116
  <action method="addJs"><script>mage/translate.js</script></action>
117
  <action method="addJs"><script>mage/adminhtml/tools.js</script></action>
118
  </block>
119
+ <block type="dropship360/adminhtml_upload_bulkassign" name="logicbroker_bulkassign" template="logicbroker/process-profile.phtml" output="toHtml"/>
120
  </block>
121
  </logicbroker_adminhtml_upload_run>
122
 
145
 
146
  <adminhtml_catalog_product_edit>
147
  <reference name="product_tabs">
148
+ <block type="dropship360/adminhtml_inventory_edit_vendortab" name="vendor_tab"/>
149
  <action method="addTab">
150
  <name>vendor_tab</name>
151
  <block>vendor_tab</block>
152
  </action>
153
+ <block type="dropship360/adminhtml_inventory_edit_vendortabhistory" name="vendor_tab_history"/>
154
  <action method="addTab">
155
  <name>vendor_tab_history</name>
156
  <block>vendor_tab_history</block>
160
  <logicbroker_adminhtml_report_activitymonitor>
161
  <update handle="report_sales"/>
162
  <reference name="content">
163
+ <block type="dropship360/adminhtml_reports_activitymonitor" template="logicbroker/reports/grid/container.phtml" name="report.activitymonitor">
164
+ <block type="dropship360/adminhtml_reports_activitymonitor_form" name="report.activitymonitor.form"/>
165
  </block>
166
  </reference>
167
  <reference name="js">
app/design/adminhtml/default/default/template/logicbroker/add_help_js.phtml CHANGED
@@ -13,12 +13,12 @@
13
  if($$('.form-buttons a#page-help-link').length <= 0 ){
14
  if($$('.form-buttons button').length > 0){
15
  $$('.form-buttons button')[0].insert({
16
- before: "<a style='color:black;padding-right:20px' target='_blank' id='page-help-link' href='<?php echo Mage::helper('logicbroker')->getConfigObject('apiconfig/helpurl/link'); ?>' target='magento_page_help'>Need help from logicbroker?</a>"
17
  });
18
  }else
19
  {
20
  $$('.form-buttons')[0].insert({
21
- top: "<a style='color:black;padding-right:20px' target='_blank' id='page-help-link' href='<?php echo Mage::helper('logicbroker')->getConfigObject('apiconfig/helpurl/link'); ?>' target='magento_page_help'>Need help from logicbroker?</a>"
22
  });
23
  }
24
  }
13
  if($$('.form-buttons a#page-help-link').length <= 0 ){
14
  if($$('.form-buttons button').length > 0){
15
  $$('.form-buttons button')[0].insert({
16
+ before: "<a style='color:black;padding-right:20px' target='_blank' id='page-help-link' href='<?php echo Mage::helper('dropship360')->getConfigObject('apiconfig/helpurl/link'); ?>' target='magento_page_help'>Need help from logicbroker?</a>"
17
  });
18
  }else
19
  {
20
  $$('.form-buttons')[0].insert({
21
+ top: "<a style='color:black;padding-right:20px' target='_blank' id='page-help-link' href='<?php echo Mage::helper('dropship360')->getConfigObject('apiconfig/helpurl/link'); ?>' target='magento_page_help'>Need help from logicbroker?</a>"
22
  });
23
  }
24
  }
app/design/adminhtml/default/default/template/logicbroker/addvendorfields.phtml CHANGED
@@ -18,7 +18,7 @@ var firstStepTemplate = '<div class="option-box" id="vendor_{{id}}">'+
18
  '<tr>'+
19
  '<th class="opt-title" style="width:307px;"><?php echo Mage::helper('catalog')->__('Supplier') ?> <span class="required">*</span></th>'+
20
  '<th class="opt-type" style="width:75px;"><?php echo Mage::helper('catalog')->__('Cost') ?> <span class="required">*</span></th>'+
21
- '<th class="opt-req" style="width:75px;"><?php echo $this->jsQuoteEscape(Mage::helper('logicbroker')->__('Inventory')) ?><span class="required">*</span></th>'+
22
  '<th class="opt-order" style="width:75px;"><?php echo Mage::helper('catalog')->__('Supplier Sku') ?><span class="required">*</span></th>'+
23
  '<th class="a-right"><?php echo $this->jsQuoteEscape($this->getDeleteButtonHtml()) ?></th>'+
24
  '</tr>'+
18
  '<tr>'+
19
  '<th class="opt-title" style="width:307px;"><?php echo Mage::helper('catalog')->__('Supplier') ?> <span class="required">*</span></th>'+
20
  '<th class="opt-type" style="width:75px;"><?php echo Mage::helper('catalog')->__('Cost') ?> <span class="required">*</span></th>'+
21
+ '<th class="opt-req" style="width:75px;"><?php echo $this->jsQuoteEscape(Mage::helper('dropship360')->__('Inventory')) ?><span class="required">*</span></th>'+
22
  '<th class="opt-order" style="width:75px;"><?php echo Mage::helper('catalog')->__('Supplier Sku') ?><span class="required">*</span></th>'+
23
  '<th class="a-right"><?php echo $this->jsQuoteEscape($this->getDeleteButtonHtml()) ?></th>'+
24
  '</tr>'+
app/design/adminhtml/default/default/template/logicbroker/bundle/renderer.phtml CHANGED
@@ -68,7 +68,7 @@
68
  <span id="change_status-<?php echo $_item->getItemId() ?>" style="display:none;">
69
  <select name="status" id="status-<?php echo $_item->getItemId() ?>" onchange="respondToChange(this)">
70
  <option value=""><?php echo $this->__('Please select') ?></option>
71
- <?php foreach(Mage::helper('logicbroker')->getLbOrderItemStatus() as $status):?>
72
  <?php if($lbItemStatus!=$status): ?>
73
  <option value="<?php echo $status ?>"><?php echo $status ?></option>
74
  <?php endif; ?>
68
  <span id="change_status-<?php echo $_item->getItemId() ?>" style="display:none;">
69
  <select name="status" id="status-<?php echo $_item->getItemId() ?>" onchange="respondToChange(this)">
70
  <option value=""><?php echo $this->__('Please select') ?></option>
71
+ <?php foreach(Mage::helper('dropship360')->getLbOrderItemStatus() as $status):?>
72
  <?php if($lbItemStatus!=$status): ?>
73
  <option value="<?php echo $status ?>"><?php echo $status ?></option>
74
  <?php endif; ?>
app/design/adminhtml/default/default/template/logicbroker/downloadable/downloadable.phtml CHANGED
@@ -49,7 +49,7 @@
49
  <span id="change_status-<?php echo $_item->getItemId() ?>" style="display:none;">
50
  <select name="status" id="status-<?php echo $_item->getItemId() ?>" onchange="respondToChange(this)">
51
  <option value=""><?php echo $this->__('Please select') ?></option>
52
- <?php foreach(Mage::helper('logicbroker')->getLbOrderItemStatus() as $status):?>
53
  <?php if($lbItemStatus!=$status): ?>
54
  <option value="<?php echo $status ?>"><?php echo $status ?></option>
55
  <?php endif; ?>
49
  <span id="change_status-<?php echo $_item->getItemId() ?>" style="display:none;">
50
  <select name="status" id="status-<?php echo $_item->getItemId() ?>" onchange="respondToChange(this)">
51
  <option value=""><?php echo $this->__('Please select') ?></option>
52
+ <?php foreach(Mage::helper('dropship360')->getLbOrderItemStatus() as $status):?>
53
  <?php if($lbItemStatus!=$status): ?>
54
  <option value="<?php echo $status ?>"><?php echo $status ?></option>
55
  <?php endif; ?>
app/design/adminhtml/default/default/template/logicbroker/html/pager.phtml ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * Pager template
30
+ *
31
+ * @see Mage_Page_Block_Html_Pager
32
+ */
33
+ ?>
34
+ <?php if($this->getCollection()->getSize()): ?>
35
+
36
+ <?php if($this->getUseContainer()): ?>
37
+ <div class="pager">
38
+ <?php endif ?>
39
+
40
+ <?php if($this->getShowAmounts()): ?>
41
+ <p class="amount">
42
+ <?php if($this->getLastPageNum()>1): ?>
43
+ <?php echo $this->__('Items %s to %s of %s total', $this->getFirstNum(), $this->getLastNum(), $this->getTotalNum()) ?>
44
+ <?php else: ?>
45
+ <strong><?php echo $this->__('%s Item(s)', $this->getTotalNum()) ?></strong>
46
+ <?php endif; ?>
47
+ </p>
48
+ <?php endif ?>
49
+
50
+ <?php if($this->getShowPerPage()): ?>
51
+ <div class="limiter">
52
+ <label><?php echo $this->__('Show') ?></label>
53
+ <select onchange="setLocation(this.value)">
54
+ <?php foreach ($this->getAvailableLimit() as $_key=>$_limit): ?>
55
+ <option value="<?php echo $this->getLimitUrl($_key) ?>"<?php if($this->isLimitCurrent($_key)): ?> selected="selected"<?php endif ?>>
56
+ <?php echo $_limit ?>
57
+ </option>
58
+ <?php endforeach; ?>
59
+ </select> <?php echo $this->__('per page') ?>
60
+ </div>
61
+ <?php endif ?>
62
+
63
+ <?php if($this->getLastPageNum()>1): ?>
64
+ <div class="pages">
65
+ <strong><?php echo $this->__('Page:') ?></strong>
66
+ <ol>
67
+ <?php if (!$this->isFirstPage()): ?>
68
+ <li>
69
+ <a class="previous<?php if(!$this->getAnchorTextForPrevious()): ?> i-previous<?php endif;?>" href="<?php echo $this->getPreviousPageUrl() ?>" title="<?php echo $this->__('Previous') ?>">
70
+ <?php if(!$this->getAnchorTextForPrevious()): ?>
71
+ <img src="<?php echo $this->getSkinUrl('images/pager_arrow_left.gif') ?>" alt="<?php echo $this->__('Previous') ?>" class="v-middle" />
72
+ <?php else: ?>
73
+ <?php echo $this->getAnchorTextForPrevious() ?>
74
+ <?php endif;?>
75
+ </a>
76
+ </li>
77
+ <?php endif;?>
78
+
79
+ <?php if ($this->canShowFirst()): ?>
80
+ <li><a class="first" href="<?php echo $this->getFirstPageUrl() ?>">1</a></li>
81
+ <?php endif;?>
82
+
83
+ <?php if ($this->canShowPreviousJump()): ?>
84
+ <li><a class="previous_jump" title="" href="<?php echo $this->getPreviousJumpUrl() ?>">...</a></li>
85
+ <?php endif;?>
86
+
87
+ <?php foreach ($this->getFramePages() as $_page): ?>
88
+ <?php if ($this->isPageCurrent($_page)): ?>
89
+ <li class="current"><?php echo $_page ?></li>
90
+ <?php else: ?>
91
+ <li><a href="<?php echo $this->getPageUrl($_page) ?>"><?php echo $_page ?></a></li>
92
+ <?php endif;?>
93
+ <?php endforeach;?>
94
+
95
+
96
+ <?php if ($this->canShowNextJump()): ?>
97
+ <li><a class="next_jump" title="" href="<?php echo $this->getNextJumpUrl() ?>">...</a></li>
98
+ <?php endif;?>
99
+
100
+ <?php if ($this->canShowLast()): ?>
101
+ <li><a class="last" href="<?php echo $this->getLastPageUrl() ?>"><?php echo $this->getLastPageNum() ?></a></li>
102
+ <?php endif;?>
103
+
104
+ <?php if (!$this->isLastPage()): ?>
105
+ <li>
106
+ <a class="next<?php if(!$this->getAnchorTextForNext()): ?> i-next<?php endif; ?>" href="<?php echo $this->getNextPageUrl() ?>" title="<?php echo $this->__('Next') ?>">
107
+ <?php if(!$this->getAnchorTextForNext()): ?>
108
+ <img src="<?php echo $this->getSkinUrl('images/pager_arrow_right.gif') ?>" alt="<?php echo $this->__('Next') ?>" class="v-middle" />
109
+ <?php else: ?>
110
+ <?php echo $this->getAnchorTextForNext() ?>
111
+ <?php endif;?>
112
+ </a>
113
+ </li>
114
+ <?php endif;?>
115
+ </ol>
116
+
117
+ </div>
118
+ <?php endif; ?>
119
+
120
+ <?php if($this->getUseContainer()): ?>
121
+ </div>
122
+ <?php endif ?>
123
+
124
+ <?php endif ?>
app/design/adminhtml/default/default/template/logicbroker/inline-edit.phtml CHANGED
@@ -18,16 +18,18 @@
18
  var arrDropshipParameter = $H({});
19
  var arrNonDropshipParameter = $H({});
20
  var arrVendorNameParameter = $H({});
 
21
  arrDropshipParameter.set(JSON.stringify(arrDropship));
22
  arrNonDropshipParameter.set(JSON.stringify(arrNonDropship));
23
  arrVendorNameParameter.set(JSON.stringify(arrVendorName));
 
24
 
25
 
26
 
27
 
28
  var actionUrl = '<?php echo Mage::getSingleton('adminhtml/url')->getUrl('*/*/saveranking') ?>'
29
  var formdataStart = "<form id='edit_form_ranking' action='"+actionUrl+"' method='post'></form>";
30
- var formDataEnd = "<div><input name='partent_save_table_input' id='partent_save_table_input' type='hidden' value=''><input name='dropship_data' id='dropship_data' type='hidden' value=''><input name='nondropship_data' id='nondropship_data' type='hidden' value=''><input name='vendorname_data' id='vendorname_data' type='hidden' value=''> <input name='form_key' type='hidden' value='<?php echo Mage::getSingleton('core/session')->getFormKey() ?>' /></div>";
31
 
32
  if(!$('edit_form_ranking'))
33
  {
@@ -40,6 +42,7 @@
40
  $('dropship_data').value = arrDropshipParameter.toQueryString();
41
  $('nondropship_data').value = arrNonDropshipParameter.toQueryString();
42
  $('vendorname_data').value = arrVendorNameParameter.toQueryString();
 
43
  }
44
  function setTableName(name){
45
 
18
  var arrDropshipParameter = $H({});
19
  var arrNonDropshipParameter = $H({});
20
  var arrVendorNameParameter = $H({});
21
+ var arrVendorProductLinkParameter = $H({});
22
  arrDropshipParameter.set(JSON.stringify(arrDropship));
23
  arrNonDropshipParameter.set(JSON.stringify(arrNonDropship));
24
  arrVendorNameParameter.set(JSON.stringify(arrVendorName));
25
+ arrVendorProductLinkParameter.set(JSON.stringify(arrVendorProductLink));
26
 
27
 
28
 
29
 
30
  var actionUrl = '<?php echo Mage::getSingleton('adminhtml/url')->getUrl('*/*/saveranking') ?>'
31
  var formdataStart = "<form id='edit_form_ranking' action='"+actionUrl+"' method='post'></form>";
32
+ var formDataEnd = "<div><input name='partent_save_table_input' id='partent_save_table_input' type='hidden' value=''><input name='dropship_data' id='dropship_data' type='hidden' value=''><input name='nondropship_data' id='nondropship_data' type='hidden' value=''><input name='vendorname_data' id='vendorname_data' type='hidden' value=''><input name='vendorproductlink_data' id='vendorproductlink_data' type='hidden' value=''> <input name='form_key' type='hidden' value='<?php echo Mage::getSingleton('core/session')->getFormKey() ?>' /></div>";
33
 
34
  if(!$('edit_form_ranking'))
35
  {
42
  $('dropship_data').value = arrDropshipParameter.toQueryString();
43
  $('nondropship_data').value = arrNonDropshipParameter.toQueryString();
44
  $('vendorname_data').value = arrVendorNameParameter.toQueryString();
45
+ $('vendorproductlink_data').value = arrVendorProductLinkParameter.toQueryString();
46
  }
47
  function setTableName(name){
48
 
app/design/adminhtml/default/default/template/logicbroker/process-profile.phtml CHANGED
@@ -13,6 +13,16 @@
13
  </style>
14
  <script type="text/javascript">
15
  var FORM_KEY = "<?php echo $this->getFormKey();?>";
 
 
 
 
 
 
 
 
 
 
16
  </script>
17
  <?php if($this->isManualUploadRunning()){ ?>
18
  <ul>
13
  </style>
14
  <script type="text/javascript">
15
  var FORM_KEY = "<?php echo $this->getFormKey();?>";
16
+ if (typeof auto_scroll=='undefined') {
17
+ var auto_scroll = window.setInterval(console_scroll, 10);
18
+ }
19
+ function console_scroll()
20
+ {
21
+ if (typeof top.$ != 'function') {
22
+ return;
23
+ }
24
+ document.body.scrollTop+=100;
25
+ }
26
  </script>
27
  <?php if($this->isManualUploadRunning()){ ?>
28
  <ul>
app/design/adminhtml/default/default/template/logicbroker/reports/email/grid.phtml ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+
28
+ <?php $_shipment=$this->getTemplatevar() ?>
29
+ <?php if($_shipment[itemOject]->getSize() > 0): ?>
30
+ <style>
31
+ .a-right {
32
+ text-align: right !important;
33
+ }
34
+ </style>
35
+ <table cellspacing="0" id="activitymonitorgrid_table">
36
+ <colgroup>
37
+ <col width="50">
38
+ <col width="50">
39
+ <col width="50">
40
+ <col width="50">
41
+ <col width="50">
42
+ <col width="50">
43
+ <col width="50">
44
+ <col width="50">
45
+ <col width="80">
46
+ <col width="50">
47
+ </colgroup>
48
+ <thead>
49
+ <tr class="headings">
50
+ <th class=" no-link"><span class="nobr">Period Open</span></th>
51
+ <th class=" no-link"><span class="nobr">Order#</span></th>
52
+ <th class=" no-link"><span class="nobr">Supplier</span></th>
53
+ <th class=" no-link"><span class="nobr">Cost</span></th>
54
+ <th class=" no-link"><span class="nobr">Product Name</span></th>
55
+ <th class=" no-link"><span class="nobr">Product Sku</span></th>
56
+ <th class=" no-link"><span class="nobr">Supplier Sku</span></th>
57
+ <th class=" no-link"><span class="nobr">Last Update</span></th>
58
+ <th class=" no-link"><span class="nobr">Order Date</span></th>
59
+ <th class=" no-link last"><span class="nobr">Item Status</span></th>
60
+ </tr>
61
+ </thead>
62
+ <tbody>
63
+
64
+ <?php foreach($_shipment[itemOject] as $item): ?>
65
+ <tr title="" class="even">
66
+ <td class="a-right "><?php echo $this->getPeriodToOpen($item->getUpdatedAt()) ?></td>
67
+ <td class="a-right "><?php echo $item->getIncrementId() ?></td>
68
+ <td class="a-right "><?php echo $this->escapeHtml($item->getLbVendorName()) ?></td>
69
+ <td class="a-right "><?php echo $item->getVendorCost() ?></td>
70
+ <td class="a-right "><?php echo $this->escapeHtml($item->getProductName()) ?></td>
71
+ <td class="a-right "><?php echo $this->escapeHtml($item->getSku()) ?></td>
72
+ <td class="a-right "><?php echo $this->escapeHtml($item->getLbVendorSku()) ?></td>
73
+ <td class="a-right "><?php echo $this->formatDate($item->getUpdatedAt()) ?></td>
74
+ <td class="a-right "><?php echo $this->formatDate($item->getCreatedAt()) ?></td>
75
+ <td class="a-right "><?php echo $item->getLbItemStatus() ?></td>
76
+ </tr>
77
+ <?php endforeach; ?>
78
+ </tbody>
79
+ </table>
80
+ <?php endif; ?>
app/design/adminhtml/default/default/template/logicbroker/reports/grid/container.phtml CHANGED
@@ -87,25 +87,44 @@
87
  var htmlsuffixid = 'sales_report_'
88
  var counter = Math.floor((Math.random() * 100) + 1);
89
  var inputboxname = <?php echo Mage::helper('core')->jsonEncode($this->getHtmlElementName()); ?>;
 
 
 
 
90
  function showinputbox(inputboxid,obj){
91
 
92
  if(obj.value){
93
  $(inputboxid).show();
94
- //$(inputboxid).addClassName('required-entry validate-digits validate-number-range number-range-1-999');
 
95
  }else
96
  {
97
  $(inputboxid).value = '';
98
  $(inputboxid).removeClassName('required-entry validate-digits validate-number-range number-range-1-999');
99
-
100
  if($$('.validation-advice')){
101
  $$('.validation-advice').each(function (e,v){e.setStyle({'display':'none'})})
102
  }
103
-
104
  $(inputboxid).hide();
105
-
106
  }
 
 
 
 
 
 
 
 
107
  }
108
 
 
 
 
 
 
 
 
 
109
  //get email address : start
110
  $('choose-email').observe('click', function(event) {
111
  if ($('email-list').style.display == "block") {
87
  var htmlsuffixid = 'sales_report_'
88
  var counter = Math.floor((Math.random() * 100) + 1);
89
  var inputboxname = <?php echo Mage::helper('core')->jsonEncode($this->getHtmlElementName()); ?>;
90
+ var labelorder = ['label[for ="'+htmlsuffixid+'select_monitor_order"]','label[for ="'+htmlsuffixid+'select_open_monitor"]','label[for ="'+htmlsuffixid+'select_transmitting_filter"]','label[for ="'+htmlsuffixid+'select_sentosup_filter"]'];
91
+ var selectbox = ['select_monitor_order','select_open_monitor','select_transmitting_filter','select_sentosup_filter'];
92
+ createAstrick();
93
+ assignAstrick();
94
  function showinputbox(inputboxid,obj){
95
 
96
  if(obj.value){
97
  $(inputboxid).show();
98
+ $(inputboxid).addClassName('required-entry validate-digits validate-number-range number-range-1-999');
99
+ $$('label[for ="'+htmlsuffixid+obj.id+'"] span')[0].show();
100
  }else
101
  {
102
  $(inputboxid).value = '';
103
  $(inputboxid).removeClassName('required-entry validate-digits validate-number-range number-range-1-999');
104
+ $$('label[for ="'+htmlsuffixid+obj.id+'"] span')[0].hide();
105
  if($$('.validation-advice')){
106
  $$('.validation-advice').each(function (e,v){e.setStyle({'display':'none'})})
107
  }
 
108
  $(inputboxid).hide();
 
109
  }
110
+ }
111
+ function createAstrick(){
112
+ labelorder.each(function (value){
113
+ var astrik = $$(value)[0].innerHTML;
114
+ $$(value)[0].innerHTML.empty()
115
+ var replace = astrik.indexOf('span') == -1 ? ' <span style="display:none" class="required">*</span>' : '';
116
+ $$(value)[0].innerHTML = astrik+replace
117
+ })
118
  }
119
 
120
+ function assignAstrick(){
121
+ selectbox.each(function(value){
122
+ if($(value).value){
123
+ $$('label[for ="'+htmlsuffixid+$(value).id+'"] span')[0].show();
124
+ }
125
+ })
126
+
127
+ }
128
  //get email address : start
129
  $('choose-email').observe('click', function(event) {
130
  if ($('email-list').style.display == "block") {
app/design/adminhtml/default/default/template/logicbroker/result.phtml CHANGED
@@ -22,12 +22,13 @@
22
  <?php foreach($collection as $key => $logArray){ ?>
23
  <thead>
24
  <tr class="tablelogheading" >
25
- <td colspan="4"><ul class = " logheading"><li><strong><?php echo $this->formatDate($logArray['created'], 'medium', true); ?><span class="separator">|</span><strong><?php echo $key; ?></strong></li></ul></td>
26
 
27
  </tr>
28
  <tr class="headings">
29
  <th>Supplier Name</th>
30
  <th>Supplier Code</th>
 
31
  <th>Ranking</th>
32
  <th>Active</th>
33
 
@@ -63,7 +64,7 @@ for(var i=0; i<= headingArr.length; i++ )
63
  {
64
  if( headingArr[i] !=undefined ){
65
  try{
66
- $$('.tablelogheading')[i].innerHTML = '<td colspan="4"><ul class="" style="border-bottom: 2.5px solid #000000;margin: 15px 0 5px 5px;">'+headingArr[i]+'</ul></td>';
67
  }catch(err){
68
  console.log(err.message);
69
  }
22
  <?php foreach($collection as $key => $logArray){ ?>
23
  <thead>
24
  <tr class="tablelogheading" >
25
+ <td colspan="5"><ul class = " logheading"><li><strong><?php echo $this->formatDate($logArray['created'], 'medium', true); ?><span class="separator">|</span><strong><?php echo $key; ?></strong></li></ul></td>
26
 
27
  </tr>
28
  <tr class="headings">
29
  <th>Supplier Name</th>
30
  <th>Supplier Code</th>
31
+ <th>Link Product</th>
32
  <th>Ranking</th>
33
  <th>Active</th>
34
 
64
  {
65
  if( headingArr[i] !=undefined ){
66
  try{
67
+ $$('.tablelogheading')[i].innerHTML = '<td colspan="5"><ul class="" style="border-bottom: 2.5px solid #000000;margin: 15px 0 5px 5px;">'+headingArr[i]+'</ul></td>';
68
  }catch(err){
69
  console.log(err.message);
70
  }
app/design/adminhtml/default/default/template/logicbroker/sales/default.phtml CHANGED
@@ -25,7 +25,7 @@
25
  */
26
  ?>
27
  <?php $_item = $this->getItem() ?>
28
- <?php $lbDetails = Mage::getBlockSingleton('logicbroker/adminhtml_sourcing'); ?>
29
  <?php $this->setPriceDataObject($_item) ?>
30
  <tr <?php if (!$this->canDisplayGiftmessage()): ?> class="border"<?php endif; ?>>
31
  <td>
@@ -56,7 +56,7 @@
56
  <span id="change_status-<?php echo $lbItem->getItemId() ?>" style="display:none;">
57
  <select name="status" id="status-<?php echo $lbItem->getItemId() ?>" onchange="respondToChange(this)">
58
  <option value=""><?php echo $this->__('Please select') ?></option>
59
- <?php foreach(Mage::helper('logicbroker')->getLbOrderItemStatus() as $status):?>
60
  <?php if($lbItemStatus!=$status): ?>
61
  <?php if($lbItemStatus=="Sent to Vendor" && $status=="Sent to Supplier"):?>
62
  <?php continue; ?>
@@ -268,7 +268,7 @@
268
  <td class="a-right"><?php echo $this->displayPriceAttribute('tax_amount') ?></td>
269
  <td class="a-right"><?php echo $this->displayTaxPercent($_item) ?></td>
270
  <td class="a-right"><?php echo $this->displayPriceAttribute('discount_amount') ?></td>
271
- <td class="a-right last">
272
  <?php echo $this->displayPrices(
273
  $_item->getBaseRowTotal() + $_item->getBaseTaxAmount() + $_item->getBaseHiddenTaxAmount() + $_item->getBaseWeeeTaxAppliedRowAmount() - $_item->getBaseDiscountAmount(),
274
  $_item->getRowTotal() + $_item->getTaxAmount() + $_item->getHiddenTaxAmount() + $_item->getWeeeTaxAppliedRowAmount() - $_item->getDiscountAmount()
25
  */
26
  ?>
27
  <?php $_item = $this->getItem() ?>
28
+ <?php $lbDetails = Mage::getBlockSingleton('dropship360/adminhtml_sourcing'); ?>
29
  <?php $this->setPriceDataObject($_item) ?>
30
  <tr <?php if (!$this->canDisplayGiftmessage()): ?> class="border"<?php endif; ?>>
31
  <td>
56
  <span id="change_status-<?php echo $lbItem->getItemId() ?>" style="display:none;">
57
  <select name="status" id="status-<?php echo $lbItem->getItemId() ?>" onchange="respondToChange(this)">
58
  <option value=""><?php echo $this->__('Please select') ?></option>
59
+ <?php foreach(Mage::helper('dropship360')->getLbOrderItemStatus() as $status):?>
60
  <?php if($lbItemStatus!=$status): ?>
61
  <?php if($lbItemStatus=="Sent to Vendor" && $status=="Sent to Supplier"):?>
62
  <?php continue; ?>
268
  <td class="a-right"><?php echo $this->displayPriceAttribute('tax_amount') ?></td>
269
  <td class="a-right"><?php echo $this->displayTaxPercent($_item) ?></td>
270
  <td class="a-right"><?php echo $this->displayPriceAttribute('discount_amount') ?></td>
271
+ <td class="a-right last">
272
  <?php echo $this->displayPrices(
273
  $_item->getBaseRowTotal() + $_item->getBaseTaxAmount() + $_item->getBaseHiddenTaxAmount() + $_item->getBaseWeeeTaxAppliedRowAmount() - $_item->getBaseDiscountAmount(),
274
  $_item->getRowTotal() + $_item->getTaxAmount() + $_item->getHiddenTaxAmount() + $_item->getWeeeTaxAppliedRowAmount() - $_item->getDiscountAmount()
app/design/adminhtml/default/default/template/logicbroker/system/config/fieldset/hint.phtml CHANGED
@@ -17,19 +17,19 @@
17
  if($$('.form-buttons a#page-help-link').length <= 0 ){
18
  if($$('.form-buttons button').length > 0){
19
  $$('.form-buttons button')[0].insert({
20
- before: "<a style='color:black;padding-right:20px' target='_blank' id='page-help-link' href='<?php echo Mage::helper('logicbroker')->getConfigObject('apiconfig/helpurl/link'); ?>' target='magento_page_help'>Need help from logicbroker?</a>"
21
  });
22
  }else
23
  {
24
  $$('.form-buttons')[0].insert({
25
- top: "<a style='color:black;padding-right:20px' target='_blank' id='page-help-link' href='<?php echo Mage::helper('logicbroker')->getConfigObject('apiconfig/helpurl/link'); ?>' target='magento_page_help'>Need help from logicbroker?</a>"
26
  });
27
  }
28
  }
29
  //]]>
30
  </script>
31
 
32
- <div class="logicbroker">
33
  <div class="logicbroker-notice"></div>
34
  <div class="title" style="border-bottom: 1px double #000000;">
35
  <h4 style="">Getting Started</h4>
17
  if($$('.form-buttons a#page-help-link').length <= 0 ){
18
  if($$('.form-buttons button').length > 0){
19
  $$('.form-buttons button')[0].insert({
20
+ before: "<a style='color:black;padding-right:20px' target='_blank' id='page-help-link' href='<?php echo Mage::helper('dropship360')->getConfigObject('apiconfig/helpurl/link'); ?>' target='magento_page_help'>Need help from logicbroker?</a>"
21
  });
22
  }else
23
  {
24
  $$('.form-buttons')[0].insert({
25
+ top: "<a style='color:black;padding-right:20px' target='_blank' id='page-help-link' href='<?php echo Mage::helper('dropship360')->getConfigObject('apiconfig/helpurl/link'); ?>' target='magento_page_help'>Need help from logicbroker?</a>"
26
  });
27
  }
28
  }
29
  //]]>
30
  </script>
31
 
32
+ <div class="dropship360">
33
  <div class="logicbroker-notice"></div>
34
  <div class="title" style="border-bottom: 1px double #000000;">
35
  <h4 style="">Getting Started</h4>
app/design/adminhtml/default/default/template/logicbroker/vendor_ranking.phtml CHANGED
@@ -6,6 +6,7 @@
6
  * @package Logicbroker_Dropship360
7
  */
8
  ?>
 
9
  <?php $dropshipVendorCollection = $this->getVendorCollection('yes'); ?>
10
  <?php $nonDropshipVendorCollection = $this->getVendorCollection('no'); ?>
11
  <style type="text/css">
@@ -33,6 +34,7 @@
33
  </div>
34
  <script type="text/javascript">
35
  var arrVendorName = [];
 
36
  var arrDropship = <?php echo $dropshipVendorCollection['arrayData'] ?>;
37
  var arrNonDropship = <?php echo $nonDropshipVendorCollection['arrayData'] ?>;
38
  var addNew = 1;
@@ -46,7 +48,7 @@ Ext.require([
46
 
47
  Ext.define('DataObject', {
48
  extend: 'Ext.data.Model',
49
- fields: ['name', 'code']
50
  });
51
 
52
  Ext.onReady(function(){
@@ -56,7 +58,10 @@ Ext.onReady(function(){
56
  model: 'DataObject',
57
  data: dropShipData,
58
  });
59
-
 
 
 
60
 
61
  // Column Model shortcut array
62
  var columns1 = [
@@ -65,7 +70,38 @@ Ext.onReady(function(){
65
  xtype: 'textfield',
66
  allowBlank:false
67
  }},
68
- {text: "Supplier Code", flex: 1,hidden:false,hideable:false,sortable: false, dataIndex: 'code'}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  ];
70
 
71
  var columns2 = [
@@ -77,7 +113,7 @@ Ext.onReady(function(){
77
  ];
78
 
79
  // create the destination Grid
80
- var rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
81
  clicksToMoveEditor: 2,
82
  autoCancel: false
83
  });
@@ -141,6 +177,9 @@ Ext.onReady(function(){
141
  arrNonDropship.splice(fristIndextemp, 1);
142
  }
143
  $('message').show();
 
 
 
144
  }
145
  }
146
  },
@@ -163,9 +202,7 @@ Ext.onReady(function(){
163
  });
164
  var rowNumber = ($$('.x-grid-cell-row-numberer .x-grid-cell-inner ').length);
165
  firstGridStore.insert(rowNumber, r);
166
- rowEditing.startEdit(rowNumber, 0);
167
-
168
-
169
  }
170
  }],
171
  plugins: [rowEditing],
@@ -188,6 +225,7 @@ Ext.onReady(function(){
188
  // Great, commit the record to hide the red changed flags
189
  editor.record.set('code',msg_server.message);
190
  editor.record.commit();
 
191
  firstGrid.getView().refresh();
192
  firstGrid.setLoading(false);
193
  arrDropship.push({name:editor.record.data['name'],code:msg_server.message});
@@ -203,10 +241,8 @@ Ext.onReady(function(){
203
  }
204
  });
205
  }
206
- if(editor.record.dirty && !isNew){
207
  if(arrVendorName.length > 0){
208
-
209
-
210
  var removeIndex
211
  arrVendorName.each(function(item,index){
212
 
@@ -242,7 +278,7 @@ Ext.onReady(function(){
242
  }
243
  },
244
 
245
- selType: 'rowmodel'
246
 
247
  });
248
 
@@ -306,22 +342,8 @@ Ext.onReady(function(){
306
 
307
  }
308
  }
309
-
310
-
311
- var indextemp;
312
- arrDropship.each(function(item,index){
313
-
314
- if(item.code == data.records[0].get('code')){
315
- indextemp = index
316
- }
317
- })
318
- if (arrDropship.length > 0 && indextemp > -1) {
319
- arrDropship.splice(indextemp, 1);
320
- $('message').show();
321
- }else
322
- {
323
- $('message').hide();
324
- }
325
 
326
  }
327
  }
@@ -332,7 +354,7 @@ Ext.onReady(function(){
332
  title : 'Non Active Suppliers/Warehouses',
333
  margins : '0 0 0 3',
334
  plugins: [
335
- Ext.create('Ext.grid.plugin.RowEditing', {
336
  clicksToEdit : 2,
337
  listeners: {
338
  edit: function(editor, e, eOpts) {
@@ -366,7 +388,7 @@ Ext.onReady(function(){
366
  }
367
  })
368
  ],
369
- selType: 'rowmodel'
370
  });
371
 
372
  //Simple 'border layout' panel to house both grids
@@ -389,8 +411,45 @@ Ext.onReady(function(){
389
 
390
  });
391
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
392
 
393
-
394
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
395
  </script>
396
 
6
  * @package Logicbroker_Dropship360
7
  */
8
  ?>
9
+ <?php $helper = Mage::helper('dropship360')?>
10
  <?php $dropshipVendorCollection = $this->getVendorCollection('yes'); ?>
11
  <?php $nonDropshipVendorCollection = $this->getVendorCollection('no'); ?>
12
  <style type="text/css">
34
  </div>
35
  <script type="text/javascript">
36
  var arrVendorName = [];
37
+ var arrVendorProductLink = [];
38
  var arrDropship = <?php echo $dropshipVendorCollection['arrayData'] ?>;
39
  var arrNonDropship = <?php echo $nonDropshipVendorCollection['arrayData'] ?>;
40
  var addNew = 1;
48
 
49
  Ext.define('DataObject', {
50
  extend: 'Ext.data.Model',
51
+ fields: ['name', 'code','link']
52
  });
53
 
54
  Ext.onReady(function(){
58
  model: 'DataObject',
59
  data: dropShipData,
60
  });
61
+ var pTypes = Ext.create('Ext.data.Store', {
62
+ fields : ['link', 'name'],
63
+ data : <?php echo $this->getAttributeCode(); ?>
64
+ });
65
 
66
  // Column Model shortcut array
67
  var columns1 = [
70
  xtype: 'textfield',
71
  allowBlank:false
72
  }},
73
+ {text: "Supplier Code", flex: 1,hidden:false,hideable:false,sortable: false, dataIndex: 'code'},
74
+ {text: 'Link Product',dataIndex: 'link',width: 130,
75
+ renderer : function (value) {
76
+ switch (value) {
77
+ case '<?php echo $helper::LOGICBROKER_PRODUCT_LINK_CODE_UPC ?>':
78
+ return '<?php echo $helper::LOGICBROKER_PRODUCT_LINK_UPC ?>';
79
+ break;
80
+ case '<?php echo $helper::LOGICBROKER_PRODUCT_LINK_CODE_MNP ?>':
81
+ return '<?php echo $helper::LOGICBROKER_PRODUCT_LINK_MNP ?>';
82
+ break;
83
+ case '<?php echo $helper::LOGICBROKER_PRODUCT_LINK_CODE_SKU ?>':
84
+ return '<?php echo $helper::LOGICBROKER_PRODUCT_LINK_SKU ?>';
85
+ break;
86
+ default:
87
+ return '<?php echo $helper::LOGICBROKER_PRODUCT_LINK_NONE ?>';
88
+ }
89
+ },
90
+ editor: new Ext.form.field.ComboBox({
91
+ store : pTypes,
92
+ displayField : 'name',
93
+ valueField : 'link',
94
+ queryMode : 'local',
95
+ editable: false,
96
+ listeners: {
97
+ select: function(combo, records) {
98
+ var vendCode = combo.up('grid').editingPlugin.activeRecord.data.code;
99
+ var proLink = records[0].data.link;
100
+ updateProductLink(vendCode, proLink,arrVendorProductLink)
101
+ }
102
+ }
103
+ })
104
+ }
105
  ];
106
 
107
  var columns2 = [
113
  ];
114
 
115
  // create the destination Grid
116
+ var rowEditing = Ext.create('Ext.grid.plugin.CellEditing', {
117
  clicksToMoveEditor: 2,
118
  autoCancel: false
119
  });
177
  arrNonDropship.splice(fristIndextemp, 1);
178
  }
179
  $('message').show();
180
+ },
181
+ beforedrop: function(node, data, dropRec, dropPosition,dropHandlers){
182
+ (data.records[0].data.link) ? updateProductLink(data.records[0].data.code, data.records[0].data.link,arrVendorProductLink) : data.records[0].data.link = ''
183
  }
184
  }
185
  },
202
  });
203
  var rowNumber = ($$('.x-grid-cell-row-numberer .x-grid-cell-inner ').length);
204
  firstGridStore.insert(rowNumber, r);
205
+ rowEditing.startEditByPosition({row: rowNumber, column: 1});
 
 
206
  }
207
  }],
208
  plugins: [rowEditing],
225
  // Great, commit the record to hide the red changed flags
226
  editor.record.set('code',msg_server.message);
227
  editor.record.commit();
228
+ firstGrid.getSelectionModel().selection = null
229
  firstGrid.getView().refresh();
230
  firstGrid.setLoading(false);
231
  arrDropship.push({name:editor.record.data['name'],code:msg_server.message});
241
  }
242
  });
243
  }
244
+ if(editor.record.dirty && !isNew && editor.colIdx == 1){
245
  if(arrVendorName.length > 0){
 
 
246
  var removeIndex
247
  arrVendorName.each(function(item,index){
248
 
278
  }
279
  },
280
 
281
+ selType: 'cellmodel'
282
 
283
  });
284
 
342
 
343
  }
344
  }
345
+ updateGridData(data,arrDropship,false);
346
+ updateGridData(data,arrVendorProductLink,true);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
347
 
348
  }
349
  }
354
  title : 'Non Active Suppliers/Warehouses',
355
  margins : '0 0 0 3',
356
  plugins: [
357
+ Ext.create('Ext.grid.plugin.CellEditing', {
358
  clicksToEdit : 2,
359
  listeners: {
360
  edit: function(editor, e, eOpts) {
388
  }
389
  })
390
  ],
391
+ selType: 'cellmodel'
392
  });
393
 
394
  //Simple 'border layout' panel to house both grids
411
 
412
  });
413
 
414
+ function updateGridData(data,tmpArray,isLink)
415
+ {
416
+ var indextemp;
417
+ tmpArray.each(function(item,index){
418
+
419
+ if(item.code == data.records[0].get('code')){
420
+ indextemp = index
421
+ }
422
+ })
423
+ if (tmpArray.length > 0 && indextemp > -1) {
424
+ (!isLink) ? tmpArray.splice(indextemp, 1) : tmpArray[indextemp].attr = ""
425
+ $('message').show();
426
+ }else
427
+ {
428
+ (isLink) ? tmpArray.push({code:data.records[0].get('code'),attr:""}) : ''
429
+ $('message').hide();
430
+ }
431
+ }
432
 
433
+ function updateProductLink(vendCode, proLink,prolinkArray) {
434
+ var isAvailable = false;
435
+ var removeIndex
436
+ //var vendCode = combo.up('grid').editingPlugin.activeRecord.data.code;
437
+ //var proLink = records[0].data.link;
438
+ if(prolinkArray.length > 0){
439
+ prolinkArray.each(function(item,index){
440
+ if(item.code == vendCode){
441
+ isAvailable = true
442
+ removeIndex = index
443
+ }
444
+ })
445
+ }
446
+ if(isAvailable){
447
+ prolinkArray.splice(removeIndex, 1);
448
+ prolinkArray.push({code:vendCode,attr:proLink})
449
+ }else
450
+ {
451
+ prolinkArray.push({code:vendCode,attr:proLink})
452
+ }
453
+ }
454
  </script>
455
 
app/design/adminhtml/default/default/template/logicbroker/vendor_upload_product_history.phtml CHANGED
@@ -34,7 +34,9 @@
34
  <strong><?php echo $_item['failure'] ?> failed updates</strong>
35
  <?php if(!empty($_item['ftp_error'])): ?>
36
  <a href="<?php echo $this->getUrl('*/*/exportErrorCsv',array('vcode'=>$_item['lb_vendor_code'], 'vdate'=>$_item['created_at']))?>" onmouseout = " setTimeout(function(){$('simplediv<?php echo $i ?>').hide();return false;},200); " onmouseover="$('simplediv<?php echo $i ?>').show();return false;"><strong><?php echo $_item['ftp_error'] ?> </strong></a>
37
- <div id="simplediv<?php echo $i ?>" style="background-color:none;border:1px solid black;display:none;width:500px;height:auto;word-wrap: break-word;padding:3px"><?php echo $_item['ftp_error_desc'] ?></div>
 
 
38
  <?php endif; ?>
39
  <span class="separator">|</span>
40
  <strong> <?php echo $this->formatDate($_item['created_at'], 'medium', true); ?></strong>
34
  <strong><?php echo $_item['failure'] ?> failed updates</strong>
35
  <?php if(!empty($_item['ftp_error'])): ?>
36
  <a href="<?php echo $this->getUrl('*/*/exportErrorCsv',array('vcode'=>$_item['lb_vendor_code'], 'vdate'=>$_item['created_at']))?>" onmouseout = " setTimeout(function(){$('simplediv<?php echo $i ?>').hide();return false;},200); " onmouseover="$('simplediv<?php echo $i ?>').show();return false;"><strong><?php echo $_item['ftp_error'] ?> </strong></a>
37
+ <div id="simplediv<?php echo $i ?>" style="background-color:none;border:1px solid black;display:none;width:500px;height:auto;word-wrap: break-word;padding:3px"><?php
38
+ $rowData = (!is_null($_item['ftp_error_desc'])) ? $_item['ftp_error_desc'] : $_item['error_id'];
39
+ echo $this->parseDescription($rowData,$_item['lb_vendor_code']); ?></div>
40
  <?php endif; ?>
41
  <span class="separator">|</span>
42
  <strong> <?php echo $this->formatDate($_item['created_at'], 'medium', true); ?></strong>
app/design/adminhtml/default/default/template/logicbroker/vendorproducttab.phtml CHANGED
@@ -25,12 +25,12 @@
25
  <input type="hidden" id="<?php echo $this->getFieldId() ?>_<?php echo $vendor->getId() ?>_lb_vendor_code" name="<?php echo $this->getFieldName() ?>[<?php echo $vendor->getId() ?>][lb_vendor_code]" value="<?php echo $vendor->getLbVendorCode() ?>" />
26
  <thead>
27
  <tr>
28
- <th class="opt-title" style="width:150px;"><?php echo Mage::helper('logicbroker')->__('Supplier Code') ?></th>
29
- <th class="opt-type" style="width:150px;"><?php echo Mage::helper('logicbroker')->__('Supplier Name') ?></th>
30
- <th class="opt-req" style="width:75px;"><?php echo $this->jsQuoteEscape(Mage::helper('logicbroker')->__('Cost')) ?><span class="required">*</span></th>
31
- <th class="opt-order" style="width:75px;"><?php echo Mage::helper('logicbroker')->__('Inventory') ?><span class="required">*</span></th>
32
- <th class="opt-order" style="width:75px;"><?php echo Mage::helper('logicbroker')->__('Supplier Sku') ?><span class="required">*</span></th>
33
- <th class="opt-order" style="width:150px;"><?php echo Mage::helper('logicbroker')->__('Last Sync') ?><span class="required">*</span></th>
34
  <th class="a-right"><?php echo $this->jsQuoteEscape($this->getUpdateDeleteButtonHtml()) ?></th>
35
  </tr>
36
  </thead>
25
  <input type="hidden" id="<?php echo $this->getFieldId() ?>_<?php echo $vendor->getId() ?>_lb_vendor_code" name="<?php echo $this->getFieldName() ?>[<?php echo $vendor->getId() ?>][lb_vendor_code]" value="<?php echo $vendor->getLbVendorCode() ?>" />
26
  <thead>
27
  <tr>
28
+ <th class="opt-title" style="width:150px;"><?php echo Mage::helper('dropship360')->__('Supplier Code') ?></th>
29
+ <th class="opt-type" style="width:150px;"><?php echo Mage::helper('dropship360')->__('Supplier Name') ?></th>
30
+ <th class="opt-req" style="width:75px;"><?php echo $this->jsQuoteEscape(Mage::helper('dropship360')->__('Cost')) ?><span class="required">*</span></th>
31
+ <th class="opt-order" style="width:75px;"><?php echo Mage::helper('dropship360')->__('Inventory') ?><span class="required">*</span></th>
32
+ <th class="opt-order" style="width:75px;"><?php echo Mage::helper('dropship360')->__('Supplier Sku') ?><span class="required">*</span></th>
33
+ <th class="opt-order" style="width:150px;"><?php echo Mage::helper('dropship360')->__('Last Sync') ?><span class="required">*</span></th>
34
  <th class="a-right"><?php echo $this->jsQuoteEscape($this->getUpdateDeleteButtonHtml()) ?></th>
35
  </tr>
36
  </thead>
app/design/adminhtml/default/default/template/logicbroker/window.phtml CHANGED
@@ -94,9 +94,9 @@
94
  <button title="save" id="save_button" type="button" class="scalable task" onclick="saveSaopApi()" style=""><span><span><span id="save_button_text">Save</span></span></span></button>
95
  <div class="validation-advice" id="advice-required-entry" style="display:none">This is a required field.</div>
96
  <?php endif; ?>
97
- <hr>
98
- REST CONSUMER KEY : <b><?php echo $msg['consumer_key']; ?></b><br>
99
- REST CONSUMER SECRET KEY : <b><?php echo $msg['consumer_secret']; ?></b><br>
100
  <hr>
101
  <b>This information can always be retrieved by going to dropship360 -> General Information.</b>
102
  </div>
94
  <button title="save" id="save_button" type="button" class="scalable task" onclick="saveSaopApi()" style=""><span><span><span id="save_button_text">Save</span></span></span></button>
95
  <div class="validation-advice" id="advice-required-entry" style="display:none">This is a required field.</div>
96
  <?php endif; ?>
97
+ <!-- <hr>
98
+ REST CONSUMER KEY : <b><?php //echo $msg['consumer_key']; ?></b><br>
99
+ REST CONSUMER SECRET KEY : <b><?php //echo $msg['consumer_secret']; ?></b><br> -->
100
  <hr>
101
  <b>This information can always be retrieved by going to dropship360 -> General Information.</b>
102
  </div>
app/locale/en_US/template/email/logicbroker/activity_report_staticstatus.html ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject {{var templatevar.subject}}@-->
2
+ <!--@vars
3
+ {"var data.name":"Sender Name",
4
+ "var data.email":"Sender Email",
5
+ "var data.telephone":"Sender Telephone",
6
+ "var data.comment":"Comment",
7
+ "block type='dropship360/adminhtml_reports_test' area='adminhtml' template='logicbroker/reports/email/grid.phtml' templatevar=$templatevar":"Shipment Track Details",
8
+ }@-->
9
+ <body style="background:#F6F6F6; margin:0; padding:0;">
10
+ <p style="font-size:12px; line-height:16px; margin:0;">Please see attched report for all order that have been sitting in this status for over x days and x hours</p>
11
+ {{if templatevar.canshow}}
12
+ <p style="font-size:12px; line-height:16px; margin:0;">when your order is sitting in Transmitting status, this typically indicates that there is connection issue with logicbroker
13
+ and picking up your orders. Please go to the portal.logicbroker.com to check your system connection or enter a support ticket
14
+ here; <a href= "https://portal.logicbroker.com/create-case/">create-case</a></p>
15
+ {{else}}
16
+ <p style="font-size:12px; line-height:16px; margin:0;">For orders sitting in ""Sent To Supplier" typically indicates that your supplier has yet to ship your order. It is best practice
17
+ to contact your supplier for an update</p>
18
+ {{/if}}
19
+ {{block type='dropship360/adminhtml_reports_staticemailgrid' area='adminhtml' template='logicbroker/reports/email/grid.phtml' templatevar=$templatevar}}
20
+ </body>
app/locale/en_US/template/email/logicbroker/first_order_notification.html ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <!--@subject {{var templatevar.subject}} : New Order # {{var templatevar.order.increment_id}} @-->
2
+ <!--@vars
3
+ {"var data.name":"Sender Name",
4
+ "var data.email":"Sender Email",
5
+ "var data.telephone":"Sender Telephone",
6
+ "var data.comment":"Comment"}
7
+ @-->
8
+
9
+ Item of first placed order has been moved to <b>Transmitting</b> successfully on following URL -: {{store url=""}}
app/locale/en_US/template/email/logicbroker/first_productsetup_notification.html ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <!--@subject {{var templatevar.subject}} @-->
2
+ <!--@vars
3
+ {"var data.name":"Sender Name",
4
+ "var data.email":"Sender Email",
5
+ "var data.telephone":"Sender Telephone",
6
+ "var data.comment":"Comment"}
7
+ @-->
8
+
9
+ First Product Setup is successfully done on following URL -: {{store url=""}}
app/locale/en_US/template/email/{logicbroker.html → logicbroker/logicbroker.html} RENAMED
@@ -1,4 +1,4 @@
1
- <!--@subject Contact Form@-->
2
  <!--@vars
3
  {"var data.name":"Sender Name",
4
  "var data.email":"Sender Email",
1
+ <!--@subject {{var templatevar.subject}} @-->
2
  <!--@vars
3
  {"var data.name":"Sender Name",
4
  "var data.email":"Sender Email",
app/locale/en_US/template/email/logicbroker/logicbroker_ftp_con_fail.html ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject {{var templatevar.subject}}@-->
2
+ <!--@vars
3
+ {"var data.name":"Sender Name",
4
+ "var data.email":"Sender Email",
5
+ "var data.telephone":"Sender Telephone",
6
+ "var data.comment":"Comment"}
7
+ @-->
8
+
9
+ FTP Address: {{config path='logicbroker_sourcing/cron_settings_upload/ftp_site'}}<br>
10
+ Account Number: {{config path='logicbroker_sourcing/cron_settings_upload/ftp_accnumber'}}<br>
11
+ FTP Username: {{config path='logicbroker_sourcing/cron_settings_upload/ftp_username'}}<br>
12
+ Time Failed: {{var templatevar.datetime}}<br>
13
+ Store URL: {{store url=""}}<br>
14
+ {{if templatevar.isfailed}}
15
+ Supplier: {{var templatevar.vendor_code}} <br>
16
+ {{/if}}
17
+
18
+ Reason: {{var templatevar.message}}<br>
19
+
20
+
app/locale/en_US/template/email/logicbroker/oudated_product_inventory_notification.html ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject {{var templatevar.subject}} @-->
2
+ <!--@vars
3
+ {"var data.name":"Sender Name",
4
+ "var data.email":"Sender Email",
5
+ "var data.telephone":"Sender Telephone",
6
+ "var data.comment":"Comment"}
7
+ @-->
8
+
9
+ Store URL -: {{store url=""}}
10
+ Dropship360 has not received an update for {{var templatevar.days}} days; Attached is the list of all products that have not been updated.
includes/src/Logicbroker/Dropship360/controllers/Adminhtml/InventoryController.php CHANGED
@@ -13,14 +13,14 @@ class Logicbroker_Dropship360_Adminhtml_InventoryController extends Mage_Adminht
13
  protected function _initAction()
14
  {
15
  $this->loadLayout()
16
- ->_setActiveMenu('logicbroker/inventory')
17
  ->_addBreadcrumb(Mage::helper('adminhtml')->__('Inventory Manager'), Mage::helper('adminhtml')->__('Inventory Manager'));
18
  return $this;
19
  }
20
 
21
  public function indexAction()
22
  {
23
- $this->_redirect('logicbroker/adminhtml_upload/index');
24
  $this->_initAction()->renderLayout();
25
  }
26
 
@@ -44,7 +44,7 @@ class Logicbroker_Dropship360_Adminhtml_InventoryController extends Mage_Adminht
44
  public function gridAction()
45
  {
46
  $this->getResponse()->setBody(
47
- $this->getLayout()->createBlock('logicbroker/adminhtml_inventory_grid')->toHtml()
48
  );
49
  }
50
 
@@ -54,7 +54,7 @@ class Logicbroker_Dropship360_Adminhtml_InventoryController extends Mage_Adminht
54
  public function exportCsvAction()
55
  {
56
  $fileName = 'vendor_inventory.csv';
57
- $content = $this->getLayout()->createBlock('logicbroker/adminhtml_inventory_grid')->getCsvFile();
58
  $this->_prepareDownloadResponse($fileName, $content);
59
  }
60
 
@@ -64,8 +64,18 @@ class Logicbroker_Dropship360_Adminhtml_InventoryController extends Mage_Adminht
64
  public function exportXmlAction()
65
  {
66
  $fileName = 'vendor_inventory.xml';
67
- $content = $this->getLayout()->createBlock('logicbroker/adminhtml_inventory_grid')->getExcelFile($fileName);
68
  $this->_prepareDownloadResponse($fileName, $content);
69
  }
 
 
 
 
 
 
 
 
 
 
70
 
71
  }
13
  protected function _initAction()
14
  {
15
  $this->loadLayout()
16
+ ->_setActiveMenu('dropship360/inventory')
17
  ->_addBreadcrumb(Mage::helper('adminhtml')->__('Inventory Manager'), Mage::helper('adminhtml')->__('Inventory Manager'));
18
  return $this;
19
  }
20
 
21
  public function indexAction()
22
  {
23
+ $this->_redirect('dropship360/adminhtml_upload/index');
24
  $this->_initAction()->renderLayout();
25
  }
26
 
44
  public function gridAction()
45
  {
46
  $this->getResponse()->setBody(
47
+ $this->getLayout()->createBlock('dropship360/adminhtml_inventory_grid')->toHtml()
48
  );
49
  }
50
 
54
  public function exportCsvAction()
55
  {
56
  $fileName = 'vendor_inventory.csv';
57
+ $content = $this->getLayout()->createBlock('dropship360/adminhtml_inventory_grid')->getCsvFile();
58
  $this->_prepareDownloadResponse($fileName, $content);
59
  }
60
 
64
  public function exportXmlAction()
65
  {
66
  $fileName = 'vendor_inventory.xml';
67
+ $content = $this->getLayout()->createBlock('dropship360/adminhtml_inventory_grid')->getExcelFile($fileName);
68
  $this->_prepareDownloadResponse($fileName, $content);
69
  }
70
+
71
+ /**
72
+ * Acl check for admin
73
+ *
74
+ * @return bool
75
+ */
76
+ protected function _isAllowed()
77
+ {
78
+ return Mage::getSingleton('admin/session')->isAllowed('dropship360/inventory');
79
+ }
80
 
81
  }
includes/src/Logicbroker/Dropship360/controllers/Adminhtml/LogicbrokerController.php CHANGED
@@ -12,7 +12,7 @@ class Logicbroker_Dropship360_Adminhtml_LogicbrokerController extends Mage_Admin
12
 
13
  protected function _initAction() {
14
  $this->loadLayout()
15
- ->_setActiveMenu('logicbroker/suppliers')
16
  ->_addBreadcrumb(Mage::helper('adminhtml')->__('Supplier Manager'), Mage::helper('adminhtml')->__('Supplier Manager'));
17
 
18
  return $this;
@@ -31,6 +31,7 @@ class Logicbroker_Dropship360_Adminhtml_LogicbrokerController extends Mage_Admin
31
  'value' => '0',
32
  ));
33
  Mage::app()->getCacheInstance()->cleanType('config');
 
34
  $this->_redirectReferer();
35
  }
36
  /**
@@ -39,18 +40,18 @@ class Logicbroker_Dropship360_Adminhtml_LogicbrokerController extends Mage_Admin
39
 
40
  public function sourcinggridAction() {
41
 
42
- $this->getLayout()->createBlock('logicbroker/adminhtml_sourcing_grid')->toHtml();
43
  $this->loadLayout()->renderLayout();
44
 
45
  }
46
 
47
  public function gridAction() {
48
  $this->getResponse()->setBody(
49
- $this->getLayout()->createBlock('logicbroker/adminhtml_logicbroker_grid')->toHtml());
50
  }
51
  public function editAction() {
52
  $id = $this->getRequest()->getParam('vendor_id');
53
- $model = Mage::getModel('logicbroker/supplier')->load($id);
54
 
55
  if ($model->getVendorId() || $id == 0) {
56
  $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
@@ -61,17 +62,17 @@ class Logicbroker_Dropship360_Adminhtml_LogicbrokerController extends Mage_Admin
61
  Mage::register('logicbroker_data', $model);
62
 
63
  $this->loadLayout();
64
- $this->_setActiveMenu('logicbroker/suppliers');
65
 
66
  $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Supplier Manager'), Mage::helper('adminhtml')->__('Supplier Manager'));
67
  $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
68
 
69
- $this->_addContent($this->getLayout()->createBlock('logicbroker/adminhtml_logicbroker_edit'))
70
- ->_addLeft($this->getLayout()->createBlock('logicbroker/adminhtml_logicbroker_edit_tabs'));
71
 
72
  $this->renderLayout();
73
  } else {
74
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('logicbroker')->__('Supplier does not exist'));
75
  $this->_redirect('*/*/');
76
  }
77
  }
@@ -79,9 +80,9 @@ class Logicbroker_Dropship360_Adminhtml_LogicbrokerController extends Mage_Admin
79
  public function newAction()
80
  {
81
  $this->loadLayout();
82
- $this->_setActiveMenu('logicbroker/suppliers');
83
- $this->_addContent($this->getLayout()->createBlock('logicbroker/adminhtml_logicbroker_edit'))
84
- ->_addLeft($this->getLayout()->createBlock('logicbroker/adminhtml_logicbroker_edit_tabs'));
85
  $this->renderLayout();
86
 
87
  }
@@ -89,7 +90,7 @@ class Logicbroker_Dropship360_Adminhtml_LogicbrokerController extends Mage_Admin
89
  public function saveAction()
90
  {
91
  if ($data = $this->getRequest()->getPost()) {
92
- $model = Mage::getModel('logicbroker/supplier');
93
  if ($id = $this->getRequest()->getParam('vendor_id')) {//the parameter name may be different
94
  $model->load($id);
95
  }
@@ -114,7 +115,7 @@ class Logicbroker_Dropship360_Adminhtml_LogicbrokerController extends Mage_Admin
114
  }
115
  //validate compny id as unique
116
  if($validate == 1){
117
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('logicbroker')->__('Duplicate Company ID'));
118
  Mage::getSingleton('adminhtml/session')->setFormData($data);
119
  $this->_redirect('*/*/edit', array('vendor_id' => $model->getVendorId()));
120
  return;
@@ -122,10 +123,10 @@ class Logicbroker_Dropship360_Adminhtml_LogicbrokerController extends Mage_Admin
122
  $model->save();
123
 
124
  if(!empty($data['addnewoption'])){
125
- Mage::getModel('logicbroker/logicbroker')->createOptionValueOnSave($model->getMagentoVendorCode());
126
  }
127
  Mage::getSingleton('adminhtml/session')->setFormData(false);
128
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('logicbroker')->__($message));
129
 
130
  if ($this->getRequest()->getParam('back')) {
131
  $this->_redirect('*/*/edit', array('vendor_id' => $model->getVendorId()));
@@ -140,7 +141,7 @@ class Logicbroker_Dropship360_Adminhtml_LogicbrokerController extends Mage_Admin
140
  return;
141
  }
142
  }
143
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('logicbroker')->__('Unable to find Supplier to save'));
144
  $this->_redirect('*/*/');
145
  }
146
 
@@ -148,18 +149,18 @@ class Logicbroker_Dropship360_Adminhtml_LogicbrokerController extends Mage_Admin
148
  {
149
  if ($id = $this->getRequest()->getParam('vendor_id')) {
150
  try {
151
- $model = Mage::getModel('logicbroker/supplier');
152
  $model->load($id);
153
  $model->setData('status','deleted');
154
  $model->save();
155
- $collection = Mage::getModel('logicbroker/ranking')->getCollection()->addFieldToFilter('is_dropship','yes');
156
  $collection->getSelect()->order('ranking asc');
157
- $rank = Mage::getModel('logicbroker/ranking')->load($id)->getRanking();
158
  foreach($collection as $value){
159
- Mage::getModel('logicbroker/ranking')->rearrangeRank($value, $rank);
160
  }
161
- Mage::getModel('logicbroker/ranking')->load($id,'lb_vendor_id')->setRanking('')->setIsDropship('no')->setIsActive('no')->save();
162
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('logicbroker')->__('The Supplier has been deleted.'));
163
  $this->_redirect('*/*/');
164
  return;
165
 
@@ -172,7 +173,7 @@ class Logicbroker_Dropship360_Adminhtml_LogicbrokerController extends Mage_Admin
172
  }
173
  }
174
 
175
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('logicbroker')->__('Unable to find a Supplier to delete.'));
176
 
177
  $this->_redirect('*/*/');
178
  }
@@ -184,7 +185,7 @@ class Logicbroker_Dropship360_Adminhtml_LogicbrokerController extends Mage_Admin
184
  public function exportCsvAction()
185
  {
186
  $fileName = 'supplier.csv';
187
- $content = $this->getLayout()->createBlock('logicbroker/adminhtml_logicbroker_grid')->getCsvFile();
188
  $this->_prepareDownloadResponse($fileName, $content);
189
  }
190
 
@@ -194,14 +195,14 @@ class Logicbroker_Dropship360_Adminhtml_LogicbrokerController extends Mage_Admin
194
  public function exportXmlAction()
195
  {
196
  $fileName = 'supplier.xml';
197
- $content = $this->getLayout()->createBlock('logicbroker/adminhtml_logicbroker_grid')->getExcelFile($fileName);
198
  $this->_prepareDownloadResponse($fileName, $content);
199
  }
200
 
201
  public function validateajaxrequestAction()
202
  {
203
  $paramsArray = $this->getRequest()->getParams();
204
- $validation = Mage::getModel('logicbroker/logicbroker');
205
  $result = $validation->validation($paramsArray['groups']['integration']['fields']);
206
  $result = Mage::helper('core')->jsonEncode($result);
207
  Mage::app()->getResponse()->setBody($result);
@@ -217,11 +218,11 @@ class Logicbroker_Dropship360_Adminhtml_LogicbrokerController extends Mage_Admin
217
  if($data['lb_item_status']!=""){
218
  $order = Mage::getModel('sales/order')->load($data['order_id']);
219
  $orderStatus = $order->getStatus();
220
- $lbOrderItemInstance = Mage::getModel('logicbroker/orderitems')->getCollection()->addFieldToFilter('item_id', $data['lb_item_id']);
221
  try{
222
  if($lbOrderItemInstance->count() > 0){
223
  foreach($lbOrderItemInstance as $item){
224
- $itemStatusHistory = Mage::helper('logicbroker')->getSerialisedData($item, $data['lb_item_status'], $orderStatus);
225
  $item->setLbItemStatus($data['lb_item_status']);
226
  $item->setItemStatusHistory($itemStatusHistory);
227
  $item->setUpdatedBy('User');
@@ -229,13 +230,16 @@ class Logicbroker_Dropship360_Adminhtml_LogicbrokerController extends Mage_Admin
229
  $item->save();
230
  if($data['lb_item_status']==$item->getLbItemStatus()){
231
  $data['msg'] = $item->getSku().' status successfully changed to '.$data['lb_item_status'];
232
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('logicbroker')->__($data['msg']));
233
  }else{
234
  $data['msg'] = $item->getSku().' status unable to change to '.$data['lb_item_status'];
235
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('logicbroker')->__($data['msg']));
236
  }
237
  }
238
  }
 
 
 
239
  $result = Mage::helper('core')->jsonEncode($data);
240
  Mage::app()->getResponse()->setBody($result);
241
  }catch(Exception $e){
@@ -247,4 +251,14 @@ class Logicbroker_Dropship360_Adminhtml_LogicbrokerController extends Mage_Admin
247
  }
248
  }
249
 
 
 
 
 
 
 
 
 
 
 
250
  }
12
 
13
  protected function _initAction() {
14
  $this->loadLayout()
15
+ ->_setActiveMenu('dropship360/suppliers')
16
  ->_addBreadcrumb(Mage::helper('adminhtml')->__('Supplier Manager'), Mage::helper('adminhtml')->__('Supplier Manager'));
17
 
18
  return $this;
31
  'value' => '0',
32
  ));
33
  Mage::app()->getCacheInstance()->cleanType('config');
34
+ Mage::getSingleton('adminhtml/session')->setNotification(false);
35
  $this->_redirectReferer();
36
  }
37
  /**
40
 
41
  public function sourcinggridAction() {
42
 
43
+ $this->getLayout()->createBlock('dropship360/adminhtml_sourcing_grid')->toHtml();
44
  $this->loadLayout()->renderLayout();
45
 
46
  }
47
 
48
  public function gridAction() {
49
  $this->getResponse()->setBody(
50
+ $this->getLayout()->createBlock('dropship360/adminhtml_logicbroker_grid')->toHtml());
51
  }
52
  public function editAction() {
53
  $id = $this->getRequest()->getParam('vendor_id');
54
+ $model = Mage::getModel('dropship360/supplier')->load($id);
55
 
56
  if ($model->getVendorId() || $id == 0) {
57
  $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
62
  Mage::register('logicbroker_data', $model);
63
 
64
  $this->loadLayout();
65
+ $this->_setActiveMenu('dropship360/suppliers');
66
 
67
  $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Supplier Manager'), Mage::helper('adminhtml')->__('Supplier Manager'));
68
  $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
69
 
70
+ $this->_addContent($this->getLayout()->createBlock('dropship360/adminhtml_logicbroker_edit'))
71
+ ->_addLeft($this->getLayout()->createBlock('dropship360/adminhtml_logicbroker_edit_tabs'));
72
 
73
  $this->renderLayout();
74
  } else {
75
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship360')->__('Supplier does not exist'));
76
  $this->_redirect('*/*/');
77
  }
78
  }
80
  public function newAction()
81
  {
82
  $this->loadLayout();
83
+ $this->_setActiveMenu('dropship360/suppliers');
84
+ $this->_addContent($this->getLayout()->createBlock('dropship360/adminhtml_logicbroker_edit'))
85
+ ->_addLeft($this->getLayout()->createBlock('dropship360/adminhtml_logicbroker_edit_tabs'));
86
  $this->renderLayout();
87
 
88
  }
90
  public function saveAction()
91
  {
92
  if ($data = $this->getRequest()->getPost()) {
93
+ $model = Mage::getModel('dropship360/supplier');
94
  if ($id = $this->getRequest()->getParam('vendor_id')) {//the parameter name may be different
95
  $model->load($id);
96
  }
115
  }
116
  //validate compny id as unique
117
  if($validate == 1){
118
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship360')->__('Duplicate Company ID'));
119
  Mage::getSingleton('adminhtml/session')->setFormData($data);
120
  $this->_redirect('*/*/edit', array('vendor_id' => $model->getVendorId()));
121
  return;
123
  $model->save();
124
 
125
  if(!empty($data['addnewoption'])){
126
+ Mage::getModel('dropship360/logicbroker')->createOptionValueOnSave($model->getMagentoVendorCode());
127
  }
128
  Mage::getSingleton('adminhtml/session')->setFormData(false);
129
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('dropship360')->__($message));
130
 
131
  if ($this->getRequest()->getParam('back')) {
132
  $this->_redirect('*/*/edit', array('vendor_id' => $model->getVendorId()));
141
  return;
142
  }
143
  }
144
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship360')->__('Unable to find Supplier to save'));
145
  $this->_redirect('*/*/');
146
  }
147
 
149
  {
150
  if ($id = $this->getRequest()->getParam('vendor_id')) {
151
  try {
152
+ $model = Mage::getModel('dropship360/supplier');
153
  $model->load($id);
154
  $model->setData('status','deleted');
155
  $model->save();
156
+ $collection = Mage::getModel('dropship360/ranking')->getCollection()->addFieldToFilter('is_dropship','yes');
157
  $collection->getSelect()->order('ranking asc');
158
+ $rank = Mage::getModel('dropship360/ranking')->load($id)->getRanking();
159
  foreach($collection as $value){
160
+ Mage::getModel('dropship360/ranking')->rearrangeRank($value, $rank);
161
  }
162
+ Mage::getModel('dropship360/ranking')->load($id,'lb_vendor_id')->setRanking('')->setIsDropship('no')->setIsActive('no')->save();
163
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('dropship360')->__('The Supplier has been deleted.'));
164
  $this->_redirect('*/*/');
165
  return;
166
 
173
  }
174
  }
175
 
176
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship360')->__('Unable to find a Supplier to delete.'));
177
 
178
  $this->_redirect('*/*/');
179
  }
185
  public function exportCsvAction()
186
  {
187
  $fileName = 'supplier.csv';
188
+ $content = $this->getLayout()->createBlock('dropship360/adminhtml_logicbroker_grid')->getCsvFile();
189
  $this->_prepareDownloadResponse($fileName, $content);
190
  }
191
 
195
  public function exportXmlAction()
196
  {
197
  $fileName = 'supplier.xml';
198
+ $content = $this->getLayout()->createBlock('dropship360/adminhtml_logicbroker_grid')->getExcelFile($fileName);
199
  $this->_prepareDownloadResponse($fileName, $content);
200
  }
201
 
202
  public function validateajaxrequestAction()
203
  {
204
  $paramsArray = $this->getRequest()->getParams();
205
+ $validation = Mage::getModel('dropship360/logicbroker');
206
  $result = $validation->validation($paramsArray['groups']['integration']['fields']);
207
  $result = Mage::helper('core')->jsonEncode($result);
208
  Mage::app()->getResponse()->setBody($result);
218
  if($data['lb_item_status']!=""){
219
  $order = Mage::getModel('sales/order')->load($data['order_id']);
220
  $orderStatus = $order->getStatus();
221
+ $lbOrderItemInstance = Mage::getModel('dropship360/orderitems')->getCollection()->addFieldToFilter('item_id', $data['lb_item_id']);
222
  try{
223
  if($lbOrderItemInstance->count() > 0){
224
  foreach($lbOrderItemInstance as $item){
225
+ $itemStatusHistory = Mage::helper('dropship360')->getSerialisedData($item, $data['lb_item_status'], $orderStatus);
226
  $item->setLbItemStatus($data['lb_item_status']);
227
  $item->setItemStatusHistory($itemStatusHistory);
228
  $item->setUpdatedBy('User');
230
  $item->save();
231
  if($data['lb_item_status']==$item->getLbItemStatus()){
232
  $data['msg'] = $item->getSku().' status successfully changed to '.$data['lb_item_status'];
233
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('dropship360')->__($data['msg']));
234
  }else{
235
  $data['msg'] = $item->getSku().' status unable to change to '.$data['lb_item_status'];
236
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship360')->__($data['msg']));
237
  }
238
  }
239
  }
240
+ if($data['lb_item_status'] == 'Transmitting'){
241
+ Mage::getModel('dropship360/logicbroker')->setupNotification();
242
+ }
243
  $result = Mage::helper('core')->jsonEncode($data);
244
  Mage::app()->getResponse()->setBody($result);
245
  }catch(Exception $e){
251
  }
252
  }
253
 
254
+ /**
255
+ * Acl check for admin
256
+ *
257
+ * @return bool
258
+ */
259
+ protected function _isAllowed()
260
+ {
261
+ return Mage::getSingleton('admin/session')->isAllowed('dropship360/inventory');
262
+ }
263
+
264
  }
includes/src/Logicbroker/Dropship360/controllers/Adminhtml/RankingController.php CHANGED
@@ -9,7 +9,7 @@
9
  class Logicbroker_Dropship360_Adminhtml_RankingController extends Mage_Adminhtml_Controller_Action {
10
 
11
  protected function _initAction() {
12
- $this->loadLayout ()->_setActiveMenu ( 'logicbroker/vendor_ranking' )->_addBreadcrumb ( Mage::helper ( 'adminhtml' )->__ ( 'Supplier Management' ), Mage::helper ( 'adminhtml' )->__ ( 'Supplier Management' ) );
13
  return $this;
14
  }
15
 
@@ -29,7 +29,7 @@ class Logicbroker_Dropship360_Adminhtml_RankingController extends Mage_Adminhtml
29
  * Ranking grid
30
  */
31
  public function gridAction() {
32
- $this->getResponse ()->setBody ( $this->getLayout ()->createBlock ( 'logicbroker/adminhtml_ranking_grid' )->toHtml () );
33
  }
34
 
35
  public function showhistoryAction() {
@@ -41,7 +41,7 @@ class Logicbroker_Dropship360_Adminhtml_RankingController extends Mage_Adminhtml
41
  $isSuccess = false;
42
  $data = $this->getRequest ()->getPost ();
43
  $arrVendor = array();
44
- $vendorRankCollection = Mage::getModel ( 'logicbroker/ranking' );
45
  $genrateVendorCode = $vendorRankCollection->getCollection()->addFieldToFilter('lb_vendor_code',array('like'=>'%MagVendID%'));
46
 
47
  foreach($genrateVendorCode as $vendorCode)
@@ -81,9 +81,10 @@ class Logicbroker_Dropship360_Adminhtml_RankingController extends Mage_Adminhtml
81
  $dropShip = json_decode((urldecode($data['dropship_data'])),true);
82
  $nonDropShip = json_decode((urldecode($data['nondropship_data'])),true);
83
  $vendorName = json_decode((urldecode($data['vendorname_data'])),true);
84
- $modelRanking = Mage::getModel ( 'logicbroker/rankinglog' )->load($tableName,'label');
 
85
  if (!$tableName || $modelRanking->getId()) {
86
- Mage::getSingleton ( 'adminhtml/session' )->addError ( Mage::helper ( 'logicbroker' )->__ ( 'Ranking Table Name Is Empty Or Already Exists' ) );
87
  $this->_redirect ( '*/*/' );
88
  return;
89
  }
@@ -103,15 +104,18 @@ class Logicbroker_Dropship360_Adminhtml_RankingController extends Mage_Adminhtml
103
  $this->_updateVendorName($val);
104
  }
105
  }
 
 
 
106
  $result = $this->_saveTableRanking(trim($tableName));
107
 
108
- Mage::getSingleton ( 'adminhtml/session' )->addSuccess ( Mage::helper ( 'logicbroker' )->__ ( 'Supplier ranking saved successfully' ) );
109
  $this->_redirect ( '*/*/' );
110
  return;
111
  }
112
  protected function _saveVendorRanking($key, $val, $rank = false) {
113
  try {
114
- $model = Mage::getModel ( 'logicbroker/ranking' )->load ( $val['code'], 'lb_vendor_code' );
115
  $model->setUpdatedAt(now());
116
 
117
  if($rank)
@@ -128,15 +132,10 @@ class Logicbroker_Dropship360_Adminhtml_RankingController extends Mage_Adminhtml
128
 
129
  protected function _updateVendorName($val) {
130
  try {
131
- $model = Mage::getModel ( 'logicbroker/ranking' )->load ( $val['code'], 'lb_vendor_code' );
132
  if($model->getLbVendorCode())
133
  $model->setLbVendorName ($val['name'])->save();
134
- $modelInventoryCollection = Mage::getModel ( 'logicbroker/inventory' )->getCollection();
135
- $modelInventoryCollection->addFieldToFilter('lb_vendor_code',$val['code']);
136
- foreach($modelInventoryCollection as $modelInventory){
137
- $inventoryModel = Mage::getModel ( 'logicbroker/inventory' )->load($modelInventory->getId());
138
- $inventoryModel->setLbVendorName($val['name'])->save();
139
- }
140
  } catch ( Exception $e ) {
141
  Mage::getSingleton ( 'adminhtml/session' )->addError ( $e->getMessage () );
142
  }
@@ -144,8 +143,8 @@ class Logicbroker_Dropship360_Adminhtml_RankingController extends Mage_Adminhtml
144
 
145
  protected function _saveTableRanking($tableName) {
146
  $serializedArray = array ();
147
- $model = Mage::getModel ( 'logicbroker/ranking' );
148
- $modelRanking = Mage::getModel ( 'logicbroker/rankinglog' );
149
  $collection = $model->getCollection ();
150
  $collection->getSelect()->order('ranking asc');
151
  if($collection->count() > 0){
@@ -153,9 +152,9 @@ class Logicbroker_Dropship360_Adminhtml_RankingController extends Mage_Adminhtml
153
  $serializedArray [] = array (
154
  $value->getLbVendorName (),
155
  $value->getLbVendorCode (),
 
156
  $value->getRanking (),
157
  $value->getIsDropship()
158
-
159
  );
160
  }
161
  $modelRanking->setRankingData ( serialize ( $serializedArray ) );
@@ -169,4 +168,44 @@ class Logicbroker_Dropship360_Adminhtml_RankingController extends Mage_Adminhtml
169
  }
170
  return;
171
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
172
  }
9
  class Logicbroker_Dropship360_Adminhtml_RankingController extends Mage_Adminhtml_Controller_Action {
10
 
11
  protected function _initAction() {
12
+ $this->loadLayout ()->_setActiveMenu ( 'dropship360/vendor_ranking' )->_addBreadcrumb ( Mage::helper ( 'adminhtml' )->__ ( 'Supplier Management' ), Mage::helper ( 'adminhtml' )->__ ( 'Supplier Management' ) );
13
  return $this;
14
  }
15
 
29
  * Ranking grid
30
  */
31
  public function gridAction() {
32
+ $this->getResponse ()->setBody ( $this->getLayout ()->createBlock ( 'dropship360/adminhtml_ranking_grid' )->toHtml () );
33
  }
34
 
35
  public function showhistoryAction() {
41
  $isSuccess = false;
42
  $data = $this->getRequest ()->getPost ();
43
  $arrVendor = array();
44
+ $vendorRankCollection = Mage::getModel ( 'dropship360/ranking' );
45
  $genrateVendorCode = $vendorRankCollection->getCollection()->addFieldToFilter('lb_vendor_code',array('like'=>'%MagVendID%'));
46
 
47
  foreach($genrateVendorCode as $vendorCode)
81
  $dropShip = json_decode((urldecode($data['dropship_data'])),true);
82
  $nonDropShip = json_decode((urldecode($data['nondropship_data'])),true);
83
  $vendorName = json_decode((urldecode($data['vendorname_data'])),true);
84
+ $vendorProductLink = json_decode((urldecode($data['vendorproductlink_data'])),true);
85
+ $modelRanking = Mage::getModel ( 'dropship360/rankinglog' )->load($tableName,'label');
86
  if (!$tableName || $modelRanking->getId()) {
87
+ Mage::getSingleton ( 'adminhtml/session' )->addError ( Mage::helper ( 'dropship360' )->__ ( 'Ranking Table Name Is Empty Or Already Exists' ) );
88
  $this->_redirect ( '*/*/' );
89
  return;
90
  }
104
  $this->_updateVendorName($val);
105
  }
106
  }
107
+ foreach ($vendorProductLink as $value) {
108
+ $this->saveProductLinking($value);
109
+ }
110
  $result = $this->_saveTableRanking(trim($tableName));
111
 
112
+ Mage::getSingleton ( 'adminhtml/session' )->addSuccess ( Mage::helper ( 'dropship360' )->__ ( 'Supplier ranking saved successfully' ) );
113
  $this->_redirect ( '*/*/' );
114
  return;
115
  }
116
  protected function _saveVendorRanking($key, $val, $rank = false) {
117
  try {
118
+ $model = Mage::getModel ( 'dropship360/ranking' )->load ( $val['code'], 'lb_vendor_code' );
119
  $model->setUpdatedAt(now());
120
 
121
  if($rank)
132
 
133
  protected function _updateVendorName($val) {
134
  try {
135
+ $model = Mage::getModel ( 'dropship360/ranking' )->load ( $val['code'], 'lb_vendor_code' );
136
  if($model->getLbVendorCode())
137
  $model->setLbVendorName ($val['name'])->save();
138
+ Mage::getModel ( 'dropship360/inventory' )->upDateVendorName($val);
 
 
 
 
 
139
  } catch ( Exception $e ) {
140
  Mage::getSingleton ( 'adminhtml/session' )->addError ( $e->getMessage () );
141
  }
143
 
144
  protected function _saveTableRanking($tableName) {
145
  $serializedArray = array ();
146
+ $model = Mage::getModel ( 'dropship360/ranking' );
147
+ $modelRanking = Mage::getModel ( 'dropship360/rankinglog' );
148
  $collection = $model->getCollection ();
149
  $collection->getSelect()->order('ranking asc');
150
  if($collection->count() > 0){
152
  $serializedArray [] = array (
153
  $value->getLbVendorName (),
154
  $value->getLbVendorCode (),
155
+ $this->getAttributeCode($value->getLinkingAttribute()),
156
  $value->getRanking (),
157
  $value->getIsDropship()
 
158
  );
159
  }
160
  $modelRanking->setRankingData ( serialize ( $serializedArray ) );
168
  }
169
  return;
170
  }
171
+ protected function getAttributeCode($code)
172
+ {
173
+ $helper = Mage::helper('dropship360');
174
+ switch ($code) {
175
+ case $helper::LOGICBROKER_PRODUCT_LINK_CODE_UPC:
176
+ return $helper::LOGICBROKER_PRODUCT_LINK_UPC;
177
+ break;
178
+ case $helper::LOGICBROKER_PRODUCT_LINK_CODE_MNP:
179
+ return $helper::LOGICBROKER_PRODUCT_LINK_MNP;
180
+ break;
181
+ case $helper::LOGICBROKER_PRODUCT_LINK_CODE_SKU:
182
+ return $helper::LOGICBROKER_PRODUCT_LINK_SKU;
183
+ break;
184
+ default:
185
+ return $helper::LOGICBROKER_PRODUCT_LINK_NONE;
186
+ }
187
+ }
188
+ protected function saveProductLinking($data)
189
+ {
190
+ if(empty($data))
191
+ return ;
192
+ try {
193
+ $model = Mage::getModel ( 'dropship360/ranking' )->load ( $data['code'], 'lb_vendor_code' );
194
+ $model->setUpdatedAt(now());
195
+ $model->setLinkingAttribute($data['attr']);
196
+ $model->save ();
197
+ } catch ( Exception $e ) {
198
+ Mage::getSingleton ( 'adminhtml/session' )->addError ( $e->getMessage () );
199
+ }
200
+ }
201
+
202
+ /**
203
+ * Acl check for admin
204
+ *
205
+ * @return bool
206
+ */
207
+ protected function _isAllowed()
208
+ {
209
+ return (Mage::getSingleton('admin/session')->isAllowed('dropship360/suppliers') || Mage::getSingleton('admin/session')->isAllowed('dropship360/vendor_ranking'));
210
+ }
211
  }
includes/src/Logicbroker/Dropship360/controllers/Adminhtml/ReportController.php CHANGED
@@ -12,7 +12,7 @@ class Logicbroker_Dropship360_Adminhtml_ReportController extends Mage_Adminhtml_
12
 
13
  protected function _initAction() {
14
  $this->loadLayout()
15
- ->_setActiveMenu('logicbroker/bar_report')
16
  ->_addBreadcrumb(Mage::helper('adminhtml')->__('Report'), Mage::helper('adminhtml')->__('Report'));
17
 
18
  return $this;
@@ -54,7 +54,8 @@ class Logicbroker_Dropship360_Adminhtml_ReportController extends Mage_Adminhtml_
54
  $formData = Mage::helper('adminhtml')->prepareFilterString($this->getRequest()->getParam('refresh'));
55
  $this->_prepareReportData($formData);
56
  Mage::getSingleton('adminhtml/session')->setFormData($formData);
57
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('logicbroker')->__('Report Refreshed Successfully '));
 
58
  $this->renderLayout();
59
  return $this;
60
  }
@@ -64,21 +65,21 @@ class Logicbroker_Dropship360_Adminhtml_ReportController extends Mage_Adminhtml_
64
  //print_r($data);
65
  //die();
66
  $formData['email'] = rtrim($formData['email'],',');
67
- Mage::getModel('logicbroker/report')->saveReportData('business_activity_monitor', $formData);
68
  $this->_prepareReportData($formData);
69
  Mage::getSingleton('adminhtml/session')->setFormData($formData);
70
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('logicbroker')->__('Report Data Save Successfully '));
71
  $this->_redirect('*/*/activitymonitor');
72
  }else
73
  {
74
- $formData = Mage::getModel('logicbroker/report')->getActivityReportData();
75
  if(is_array($formData) && !empty($formData)){
76
  $this->_prepareReportData($formData);
77
  Mage::getSingleton('adminhtml/session')->setFormData($formData);
78
  }
79
 
80
  }
81
-
82
  $this->renderLayout();
83
  return $this;
84
  }
@@ -86,7 +87,7 @@ class Logicbroker_Dropship360_Adminhtml_ReportController extends Mage_Adminhtml_
86
 
87
  protected function _prepareReportData($data = array()){
88
 
89
- $collection = Mage::getModel('logicbroker/report')->activityReportCollection($data)->getBlockGraphData();
90
  Mage::register('activity_report_collection', $collection['collection']);
91
  $this->getLayout()->getBlock('report.activitymonitor')->setData(array('totalDropshipOrder'=>$collection['totalDropshipOrder'],'dropshipStatus'=> $collection['dropshipStatus']));
92
  }
@@ -98,7 +99,7 @@ class Logicbroker_Dropship360_Adminhtml_ReportController extends Mage_Adminhtml_
98
  */
99
  public function chooserAction()
100
  {
101
- $block = $this->getLayout()->createBlock('logicbroker/adminhtml_reports_activitymonitor_email', 'adminhtml_chooser_email');
102
 
103
  if ($block) {
104
  $this->getResponse()->setBody($block->toHtml());
@@ -106,5 +107,15 @@ class Logicbroker_Dropship360_Adminhtml_ReportController extends Mage_Adminhtml_
106
 
107
  }
108
 
 
 
 
 
 
 
 
 
 
 
109
 
110
  }
12
 
13
  protected function _initAction() {
14
  $this->loadLayout()
15
+ ->_setActiveMenu('dropship360/bar_report')
16
  ->_addBreadcrumb(Mage::helper('adminhtml')->__('Report'), Mage::helper('adminhtml')->__('Report'));
17
 
18
  return $this;
54
  $formData = Mage::helper('adminhtml')->prepareFilterString($this->getRequest()->getParam('refresh'));
55
  $this->_prepareReportData($formData);
56
  Mage::getSingleton('adminhtml/session')->setFormData($formData);
57
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('dropship360')->__('Report Refreshed Successfully '));
58
+ Mage::app()->getCacheInstance()->cleanType('config');
59
  $this->renderLayout();
60
  return $this;
61
  }
65
  //print_r($data);
66
  //die();
67
  $formData['email'] = rtrim($formData['email'],',');
68
+ Mage::getModel('dropship360/report')->saveReportData('business_activity_monitor', $formData);
69
  $this->_prepareReportData($formData);
70
  Mage::getSingleton('adminhtml/session')->setFormData($formData);
71
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('dropship360')->__('Report Data Save Successfully '));
72
  $this->_redirect('*/*/activitymonitor');
73
  }else
74
  {
75
+ $formData = Mage::getModel('dropship360/report')->getActivityReportData();
76
  if(is_array($formData) && !empty($formData)){
77
  $this->_prepareReportData($formData);
78
  Mage::getSingleton('adminhtml/session')->setFormData($formData);
79
  }
80
 
81
  }
82
+ Mage::app()->getCacheInstance()->cleanType('config');
83
  $this->renderLayout();
84
  return $this;
85
  }
87
 
88
  protected function _prepareReportData($data = array()){
89
 
90
+ $collection = Mage::getModel('dropship360/report')->activityReportCollection($data)->getBlockGraphData();
91
  Mage::register('activity_report_collection', $collection['collection']);
92
  $this->getLayout()->getBlock('report.activitymonitor')->setData(array('totalDropshipOrder'=>$collection['totalDropshipOrder'],'dropshipStatus'=> $collection['dropshipStatus']));
93
  }
99
  */
100
  public function chooserAction()
101
  {
102
+ $block = $this->getLayout()->createBlock('dropship360/adminhtml_reports_activitymonitor_email', 'adminhtml_chooser_email');
103
 
104
  if ($block) {
105
  $this->getResponse()->setBody($block->toHtml());
107
 
108
  }
109
 
110
+ /**
111
+ * Acl check for admin
112
+ *
113
+ * @return bool
114
+ */
115
+ protected function _isAllowed()
116
+ {
117
+ return Mage::getSingleton('admin/session')->isAllowed('dropship360/bar_report');
118
+ }
119
+
120
 
121
  }
includes/src/Logicbroker/Dropship360/controllers/Adminhtml/SourcingController.php CHANGED
@@ -12,7 +12,7 @@ class Logicbroker_Dropship360_Adminhtml_SourcingController extends Mage_Adminhtm
12
 
13
  protected function _initAction() {
14
  $this->loadLayout()
15
- ->_setActiveMenu('logicbroker/order_sourcing')
16
  ->_addBreadcrumb(Mage::helper('adminhtml')->__('PO Management'), Mage::helper('adminhtml')->__('PO Management'));
17
 
18
  return $this;
@@ -28,13 +28,13 @@ class Logicbroker_Dropship360_Adminhtml_SourcingController extends Mage_Adminhtm
28
 
29
  public function sourcinggridAction() {
30
  $this->_initAction() ->_title($this->__('PO Management'));
31
- $this->getLayout()->createBlock('logicbroker/adminhtml_sourcing_grid')->toHtml();
32
  $this->loadLayout()->renderLayout();
33
 
34
  }
35
  public function editAction() {
36
  $id = $this->getRequest()->getParam('lb_item_id');
37
- $model = Mage::getModel('logicbroker/orderitems')->load($id);
38
 
39
  if ($model->getId()) {
40
  $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
@@ -44,13 +44,13 @@ class Logicbroker_Dropship360_Adminhtml_SourcingController extends Mage_Adminhtm
44
  Mage::register('sourcing_data', $model);
45
 
46
  $this->loadLayout();
47
- $this->_setActiveMenu('logicbroker/order_sourcing');
48
  $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Order Sourcing'), Mage::helper('adminhtml')->__('Order Sourcing'));
49
- $this->_addContent($this->getLayout()->createBlock('logicbroker/adminhtml_sourcing_edit'))
50
- ->_addLeft($this->getLayout()->createBlock('logicbroker/adminhtml_sourcing_edit_tabs'));
51
  $this->renderLayout();
52
  } else {
53
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('logicbroker')->__('Sourcing does not exist'));
54
  $this->_redirect('*/*/sourcinggrid');
55
  }
56
  }
@@ -58,18 +58,18 @@ class Logicbroker_Dropship360_Adminhtml_SourcingController extends Mage_Adminhtm
58
  if ($data = $this->getRequest()->getPost()) {
59
  $vendorCode = $data['lb_vendor_code'];
60
  $sku = $data['sku'];
61
- $model = Mage::getModel('logicbroker/orderitems');
62
  $model->load($this->getRequest()->getParam('lb_item_id'));
63
  $order = Mage::getModel('sales/order')->load($model->getItemOrderId());
64
  $orderStatus = $order->getStatus();
65
  if($this->getRequest()->getParam('cancel') == 'item'){
66
- $itemStatusHistory = Mage::helper('logicbroker')->getSerialisedData($model->load($this->getRequest()->getParam('lb_item_id')), 'Cancelled', $orderStatus);
67
  $model->setLbItemStatus('Cancelled');
68
  $model->setUpdatedBy('User');
69
  $model->setItemStatusHistory($itemStatusHistory);
70
  try{
71
  $model->save();
72
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('logicbroker')->__('Item %s Cancelled Successfully ',$model->getSku()));
73
 
74
  }catch(Exception $e){
75
  Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
@@ -82,17 +82,17 @@ class Logicbroker_Dropship360_Adminhtml_SourcingController extends Mage_Adminhtm
82
  }
83
 
84
  if(!$data['lb_vendor_code']){
85
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('logicbroker')->__('Under Processing By Logicbroker Can Not Update %s Sku',$model->getSku()));
86
  $this->_redirect('*/*/sourcinggrid');
87
  return;
88
  }
89
- $itemStatusHistory = Mage::helper('logicbroker')->getSerialisedData($model->load($this->getRequest()->getParam('lb_item_id')), 'Transmitting', $orderStatus);
90
  $arrData = $model->updateSourcingByUser(array('lb_vendor_code'=>$vendorCode,'product_sku'=>$sku, 'qty'=>$this->getRequest()->getParam('qty'), 'item_status_history'=>$itemStatusHistory));
91
  $model->addData($arrData);
92
  try {
93
  $model->save();
94
  Mage::getSingleton('adminhtml/session')->setFormData(false);
95
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('logicbroker')->__('Sourcing Updated For %s',$model->getSku()));
96
 
97
  if ($this->getRequest()->getParam('back')) {
98
  $this->_redirect('*/*/edit', array('lb_item_id' => $model->getId()));
@@ -107,7 +107,7 @@ class Logicbroker_Dropship360_Adminhtml_SourcingController extends Mage_Adminhtm
107
  return;
108
  }
109
  }
110
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('logicbroker')->__('Unable to save sourcing'));
111
  $this->_redirect('*/*/sourcinggrid');
112
  }
113
 
@@ -116,7 +116,8 @@ class Logicbroker_Dropship360_Adminhtml_SourcingController extends Mage_Adminhtm
116
  $paramsArray = $this->getRequest()->getParams();
117
  if(!empty($paramsArray['user_id']) && !empty($paramsArray['api_key'])){
118
  Mage::getModel('api/user')->load($paramsArray['user_id'])->setApiKey($paramsArray['api_key'])->save();
119
- Mage::getModel('logicbroker/logicbroker')->send(null,array());
 
120
  $result['message'] = 'password save successfully';
121
  }else{
122
  $result['message'] = 'can not save password';
@@ -133,7 +134,7 @@ class Logicbroker_Dropship360_Adminhtml_SourcingController extends Mage_Adminhtm
133
  public function exportCsvAction()
134
  {
135
  $fileName = 'sourcing.csv';
136
- $content = $this->getLayout()->createBlock('logicbroker/adminhtml_sourcing_grid')->getCsvFile();
137
  $this->_prepareDownloadResponse($fileName, $content);
138
  }
139
 
@@ -143,7 +144,7 @@ class Logicbroker_Dropship360_Adminhtml_SourcingController extends Mage_Adminhtm
143
  public function exportXmlAction()
144
  {
145
  $fileName = 'sourcing.xml';
146
- $content = $this->getLayout()->createBlock('logicbroker/adminhtml_sourcing_grid')->getExcelFile($fileName);
147
  $this->_prepareDownloadResponse($fileName, $content);
148
  }
149
 
@@ -153,17 +154,28 @@ class Logicbroker_Dropship360_Adminhtml_SourcingController extends Mage_Adminhtm
153
 
154
  $this->_initAction();
155
  $itemId = $this->getRequest()->getParam('lb_item_id');
156
- $orderItems = Mage::getModel( 'logicbroker/orderitems' )->load($itemId, 'item_id');
157
 
158
  $this->_title(sprintf("Item Sku %s", $orderItems->getSku()));
159
 
160
  $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
161
 
162
- $this->_addContent($this->getLayout()->createBlock('logicbroker/adminhtml_sourcing_history_view'))
163
- ->_addLeft($this->getLayout()->createBlock('logicbroker/adminhtml_sourcing_history_view_tabs'));
164
 
165
  $this->renderLayout();
166
 
167
  }
168
 
 
 
 
 
 
 
 
 
 
 
 
169
  }
12
 
13
  protected function _initAction() {
14
  $this->loadLayout()
15
+ ->_setActiveMenu('dropship360/order_sourcing')
16
  ->_addBreadcrumb(Mage::helper('adminhtml')->__('PO Management'), Mage::helper('adminhtml')->__('PO Management'));
17
 
18
  return $this;
28
 
29
  public function sourcinggridAction() {
30
  $this->_initAction() ->_title($this->__('PO Management'));
31
+ $this->getLayout()->createBlock('dropship360/adminhtml_sourcing_grid')->toHtml();
32
  $this->loadLayout()->renderLayout();
33
 
34
  }
35
  public function editAction() {
36
  $id = $this->getRequest()->getParam('lb_item_id');
37
+ $model = Mage::getModel('dropship360/orderitems')->load($id);
38
 
39
  if ($model->getId()) {
40
  $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
44
  Mage::register('sourcing_data', $model);
45
 
46
  $this->loadLayout();
47
+ $this->_setActiveMenu('dropship360/order_sourcing');
48
  $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Order Sourcing'), Mage::helper('adminhtml')->__('Order Sourcing'));
49
+ $this->_addContent($this->getLayout()->createBlock('dropship360/adminhtml_sourcing_edit'))
50
+ ->_addLeft($this->getLayout()->createBlock('dropship360/adminhtml_sourcing_edit_tabs'));
51
  $this->renderLayout();
52
  } else {
53
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship360')->__('Sourcing does not exist'));
54
  $this->_redirect('*/*/sourcinggrid');
55
  }
56
  }
58
  if ($data = $this->getRequest()->getPost()) {
59
  $vendorCode = $data['lb_vendor_code'];
60
  $sku = $data['sku'];
61
+ $model = Mage::getModel('dropship360/orderitems');
62
  $model->load($this->getRequest()->getParam('lb_item_id'));
63
  $order = Mage::getModel('sales/order')->load($model->getItemOrderId());
64
  $orderStatus = $order->getStatus();
65
  if($this->getRequest()->getParam('cancel') == 'item'){
66
+ $itemStatusHistory = Mage::helper('dropship360')->getSerialisedData($model->load($this->getRequest()->getParam('lb_item_id')), 'Cancelled', $orderStatus);
67
  $model->setLbItemStatus('Cancelled');
68
  $model->setUpdatedBy('User');
69
  $model->setItemStatusHistory($itemStatusHistory);
70
  try{
71
  $model->save();
72
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('dropship360')->__('Item %s Cancelled Successfully ',$model->getSku()));
73
 
74
  }catch(Exception $e){
75
  Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
82
  }
83
 
84
  if(!$data['lb_vendor_code']){
85
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship360')->__('Under Processing By Logicbroker Can Not Update %s Sku',$model->getSku()));
86
  $this->_redirect('*/*/sourcinggrid');
87
  return;
88
  }
89
+ $itemStatusHistory = Mage::helper('dropship360')->getSerialisedData($model->load($this->getRequest()->getParam('lb_item_id')), 'Transmitting', $orderStatus);
90
  $arrData = $model->updateSourcingByUser(array('lb_vendor_code'=>$vendorCode,'product_sku'=>$sku, 'qty'=>$this->getRequest()->getParam('qty'), 'item_status_history'=>$itemStatusHistory));
91
  $model->addData($arrData);
92
  try {
93
  $model->save();
94
  Mage::getSingleton('adminhtml/session')->setFormData(false);
95
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('dropship360')->__('Sourcing Updated For %s',$model->getSku()));
96
 
97
  if ($this->getRequest()->getParam('back')) {
98
  $this->_redirect('*/*/edit', array('lb_item_id' => $model->getId()));
107
  return;
108
  }
109
  }
110
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship360')->__('Unable to save sourcing'));
111
  $this->_redirect('*/*/sourcinggrid');
112
  }
113
 
116
  $paramsArray = $this->getRequest()->getParams();
117
  if(!empty($paramsArray['user_id']) && !empty($paramsArray['api_key'])){
118
  Mage::getModel('api/user')->load($paramsArray['user_id'])->setApiKey($paramsArray['api_key'])->save();
119
+ if(is_null(Mage::getSingleton('adminhtml/session')->getNotification()))
120
+ Mage::getModel('dropship360/logicbroker')->send(null,array());
121
  $result['message'] = 'password save successfully';
122
  }else{
123
  $result['message'] = 'can not save password';
134
  public function exportCsvAction()
135
  {
136
  $fileName = 'sourcing.csv';
137
+ $content = $this->getLayout()->createBlock('dropship360/adminhtml_sourcing_grid')->getCsvFile();
138
  $this->_prepareDownloadResponse($fileName, $content);
139
  }
140
 
144
  public function exportXmlAction()
145
  {
146
  $fileName = 'sourcing.xml';
147
+ $content = $this->getLayout()->createBlock('dropship360/adminhtml_sourcing_grid')->getExcelFile($fileName);
148
  $this->_prepareDownloadResponse($fileName, $content);
149
  }
150
 
154
 
155
  $this->_initAction();
156
  $itemId = $this->getRequest()->getParam('lb_item_id');
157
+ $orderItems = Mage::getModel( 'dropship360/orderitems' )->load($itemId, 'item_id');
158
 
159
  $this->_title(sprintf("Item Sku %s", $orderItems->getSku()));
160
 
161
  $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
162
 
163
+ $this->_addContent($this->getLayout()->createBlock('dropship360/adminhtml_sourcing_history_view'))
164
+ ->_addLeft($this->getLayout()->createBlock('dropship360/adminhtml_sourcing_history_view_tabs'));
165
 
166
  $this->renderLayout();
167
 
168
  }
169
 
170
+ /**
171
+ * Acl check for admin
172
+ *
173
+ * @return bool
174
+ */
175
+ protected function _isAllowed()
176
+ {
177
+ return Mage::getSingleton('admin/session')->isAllowed('dropship360/order_sourcing');
178
+ }
179
+
180
+
181
  }
includes/src/Logicbroker/Dropship360/controllers/Adminhtml/UploadController.php CHANGED
@@ -13,8 +13,8 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
13
  protected function _initAction()
14
  {
15
  $this->loadLayout()
16
- ->_setActiveMenu('logicbroker/upload_vendor_product')
17
- ->_addBreadcrumb(Mage::helper('adminhtml')->__('logicbroker'), Mage::helper('adminhtml')->__('Supplier Inventory'));
18
  return $this;
19
  }
20
 
@@ -35,7 +35,7 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
35
  public function gridAction()
36
  {
37
  $this->getResponse()->setBody(
38
- $this->getLayout()->createBlock('logicbroker/adminhtml_inventory_grid')->toHtml()
39
  );
40
  }
41
  public function uploadFileAction()
@@ -50,22 +50,22 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
50
  {
51
  $redirectUrl = '*/*/index';
52
  }
53
- if(Mage::helper('logicbroker')->isProcessRunning('bulk_assign')){
54
  $this->_getSession()->addError($this->__('Bulk product setup is currently running please try again later'));
55
  $this->_redirect($redirectUrl);
56
  return;
57
  }
58
  if ($data) {
59
  try {
60
- $import = Mage::getModel('logicbroker/uploadvendor');
61
  $validationResult = $import->setData($data)->uploadSource();
62
  if(!$validationResult){
63
  $this->initialize();
64
  $import->parseCsv(Mage::registry('file_name'),$data['vendor']);
65
- $this->_getSession()->addSuccess(Mage::helper('logicbroker')->__('File upload successfully '));
66
  $this->finalize();
67
  }else{
68
- $this->_getSession()->addError(Mage::helper('logicbroker')->__('File cannot be uploaded '));
69
  }
70
  } catch (Exception $e) {
71
  $this->_getSession()->addError($e->getMessage());
@@ -80,11 +80,11 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
80
  }
81
 
82
  protected function initialize(){
83
- Mage::helper('logicbroker')->startProcess('manual_upload');
84
  }
85
 
86
  protected function finalize(){
87
- Mage::helper('logicbroker')->finishProcess('manual_upload');
88
  }
89
 
90
  public function vendorsuploadhistoryAction()
@@ -98,7 +98,7 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
98
  public function editAction()
99
  {
100
  $id = $this->getRequest()->getParam('lb_item_id');
101
- $model = Mage::getModel('logicbroker/orderitems')->load($id);
102
  if ($model->getId()) {
103
  $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
104
  if (!empty($data)) {
@@ -106,13 +106,13 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
106
  }
107
  Mage::register('sourcing_data', $model);
108
  $this->loadLayout();
109
- $this->_setActiveMenu('logicbroker/order_sourcing');
110
  $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Order Sourcing'), Mage::helper('adminhtml')->__('Order Sourcing'));
111
- $this->_addContent($this->getLayout()->createBlock('logicbroker/adminhtml_sourcing_edit'))
112
- ->_addLeft($this->getLayout()->createBlock('logicbroker/adminhtml_sourcing_edit_tabs'));
113
  $this->renderLayout();
114
  } else {
115
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('logicbroker')->__('Sourcing does not exist'));
116
  $this->_redirect('*/*/sourcinggrid');
117
  }
118
  }
@@ -121,7 +121,7 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
121
  public function validateftpconnectionAction()
122
  {
123
  $paramsArray = $this->getRequest()->getParams();
124
- $validateConnection = Mage::getModel('logicbroker/uploadvendor');
125
  $result = $validateConnection->testFtpConnection($paramsArray['groups']['cron_settings_upload']['fields']);
126
  $result = Mage::helper('core')->jsonEncode($result);
127
  Mage::app()->getResponse()->setBody($result);
@@ -133,14 +133,14 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
133
  if ($data = $this->getRequest()->getPost()) {
134
  $vendorCode = $data['lb_vendor_code'];
135
  $sku = $data['sku'];
136
- $model = Mage::getModel('logicbroker/orderitems');
137
 
138
  if($this->getRequest()->getParam('cancel') == 'item'){
139
  $model->load($this->getRequest()->getParam('lb_item_id'));
140
  $model->setLbItemStatus('Cancelled');
141
  try{
142
  $model->save();
143
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('logicbroker')->__('Item %s Cancelled Successfully ',$model->getSku()));
144
 
145
  }catch(Exception $e){
146
  Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
@@ -153,7 +153,7 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
153
  }
154
 
155
  if(!$data['lb_vendor_code']){
156
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('logicbroker')->__('Under Processing By Logicbroker Can Not Update %s Sku',$model->getSku()));
157
  $this->_redirect('*/*/sourcinggrid');
158
  return;
159
  }
@@ -163,7 +163,7 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
163
  $model->save();
164
  $model->updateOrderStatus($model->getItemOrderId(),$model->getItemId());
165
  Mage::getSingleton('adminhtml/session')->setFormData(false);
166
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('logicbroker')->__('Sourcing Updated For %s',$model->getSku()));
167
  if ($this->getRequest()->getParam('back')) {
168
  $this->_redirect('*/*/edit', array('lb_item_id' => $model->getId()));
169
  return;
@@ -177,7 +177,7 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
177
  return;
178
  }
179
  }
180
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('logicbroker')->__('Unable to save sourcing'));
181
  $this->_redirect('*/*/sourcinggrid');
182
  }
183
 
@@ -214,7 +214,7 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
214
  $isProductSetupMode = (isset($paramsArray['isproductsetupmode']) && $paramsArray['isproductsetupmode']) ? true : false;
215
  $type = ($isProductSetupMode) ? 'setup' : 'upload';
216
  $fileName = 'logicbroker_supplier_product_'.$type.'.csv';
217
- $content = Mage::getModel('logicbroker/uploadvendor')->getCsvFile($isProductSetupMode);
218
  $this->_prepareDownloadResponse($fileName, $content);
219
  $this->_redirect('*/*/index');
220
 
@@ -224,7 +224,7 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
224
 
225
  protected function _initSystem()
226
  {
227
- $this->_title($this->__('logicbroker'))
228
  ->_title($this->__('Bulk vendor assignment'));
229
  $vendorCode = $this->getRequest()->getParam('lb_vendor_code');
230
  if (!$vendorCode) {
@@ -250,23 +250,23 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
250
  if (!is_array($rowIds) || count($rowIds) < 1) {
251
  return;
252
  }
253
- $vendorName = Mage::getModel('logicbroker/ranking')->load($vendorCode,'lb_vendor_code');
254
  $errors = array();
255
  $saved = 0;
256
  $skuError = array();
257
  $skuSuccuess = array();
258
  if(!Mage::getSingleton('adminhtml/session')->getTerminateExecution()){
259
- Mage::helper('logicbroker')->startProcess('bulk_assign');
260
  }else
261
  {
262
  return;
263
  }
264
  foreach($rowIds as $sku){
265
- $collection = Mage::getModel('logicbroker/inventory')->getCollection()->addFieldToFilter('product_sku',$sku)->addFieldToFilter('lb_vendor_code',$vendorCode);
266
  $inventoryId = ($collection->getSize() > 0) ? $collection->getFirstItem()->getId() : '';
267
  if(!$inventoryId)
268
  {
269
- $inventoryCollection = Mage::getModel('logicbroker/inventory');
270
  $inventoryCollection->setLbVendorCode($vendorCode);
271
  $inventoryCollection->setLbVendorName(($vendorName) ? $vendorName->getLbVendorName() : '');
272
  $inventoryCollection->setProductSku($sku);
@@ -277,7 +277,7 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
277
  $inventoryCollection->setCreatedAt(now());
278
  try {
279
  $inventoryCollection->save();
280
- Mage::getModel('logicbroker/inventory')->_saveInventoryLog('add',array('lb_vendor_code'=>$vendorCode,'lb_vendor_name'=>($vendorName) ? $vendorName->getLbVendorName() : '','product_sku'=>$sku,'cost'=>0,'stock'=>0,'updated_by'=>'bulk_setup'));
281
  $saved ++;
282
  $skuSuccuess[] = $sku;
283
  } catch (Exception $e) {
@@ -287,7 +287,7 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
287
  }
288
  }else
289
  {
290
- $errors[] = Mage::helper('logicbroker')->__('Skip %s as supplier %s already assigned.',$sku,$vendorCode);
291
  $skuError[] = $sku;
292
  continue;
293
  }
@@ -306,21 +306,21 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
306
  $exeuctionTerminated = $this->getRequest()->getParam('exeuctionTerminated');
307
  if($exeuctionTerminated){
308
  Mage::getSingleton('adminhtml/session')->setTerminateExecution(true);
309
- Mage::helper('logicbroker')->finishProcess('bulk_assign');
310
  }else
311
  {
312
- Mage::helper('logicbroker')->finishProcess('bulk_assign');
313
  }
314
  $result = array();
315
  $data = $this->getRequest()->getPost();
316
- Mage::getResourceModel('logicbroker/vendorimportlog')->insertlog($data['lb_vendor_code'],'Bulk-product-setup',$data['sucees_sku'],$data['errorSkuCount']);
317
  $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
318
  }
319
 
320
 
321
  public function terminateAction(){
322
 
323
- Mage::helper('logicbroker')->finishProcess('manual_upload');
324
  $result = array();
325
  $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
326
  }
@@ -331,7 +331,7 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
331
  public function exportCsvAction()
332
  {
333
  $fileName = 'inventory.csv';
334
- $content = $this->getLayout()->createBlock('logicbroker/adminhtml_inventory_grid')->getCsvFile();
335
  $this->_prepareDownloadResponse($fileName, $content);
336
  }
337
 
@@ -341,7 +341,7 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
341
  public function exportXmlAction()
342
  {
343
  $fileName = 'inventory.xml';
344
- $content = $this->getLayout()->createBlock('logicbroker/adminhtml_inventory_grid')->getExcelFile($fileName);
345
  $this->_prepareDownloadResponse($fileName, $content);
346
  }
347
 
@@ -349,10 +349,41 @@ class Logicbroker_Dropship360_Adminhtml_UploadController extends Mage_Adminhtml_
349
  {
350
  $params = $this->getRequest()->getParams();
351
  $filename = 'upload_error.csv';
352
- $content = Mage::helper('logicbroker')->generateErrorList($params);
353
-
 
354
  $this->_prepareDownloadResponse($filename, $content);
355
  }
356
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
357
 
358
  }
13
  protected function _initAction()
14
  {
15
  $this->loadLayout()
16
+ ->_setActiveMenu('dropship360/upload_vendor_product')
17
+ ->_addBreadcrumb(Mage::helper('adminhtml')->__('dropship360'), Mage::helper('adminhtml')->__('Supplier Inventory'));
18
  return $this;
19
  }
20
 
35
  public function gridAction()
36
  {
37
  $this->getResponse()->setBody(
38
+ $this->getLayout()->createBlock('dropship360/adminhtml_inventory_grid')->toHtml()
39
  );
40
  }
41
  public function uploadFileAction()
50
  {
51
  $redirectUrl = '*/*/index';
52
  }
53
+ if(Mage::helper('dropship360')->isProcessRunning('bulk_assign')){
54
  $this->_getSession()->addError($this->__('Bulk product setup is currently running please try again later'));
55
  $this->_redirect($redirectUrl);
56
  return;
57
  }
58
  if ($data) {
59
  try {
60
+ $import = Mage::getModel('dropship360/uploadvendor');
61
  $validationResult = $import->setData($data)->uploadSource();
62
  if(!$validationResult){
63
  $this->initialize();
64
  $import->parseCsv(Mage::registry('file_name'),$data['vendor']);
65
+ $this->_getSession()->addSuccess(Mage::helper('dropship360')->__('File upload successfully '));
66
  $this->finalize();
67
  }else{
68
+ $this->_getSession()->addError(Mage::helper('dropship360')->__('File cannot be uploaded '));
69
  }
70
  } catch (Exception $e) {
71
  $this->_getSession()->addError($e->getMessage());
80
  }
81
 
82
  protected function initialize(){
83
+ Mage::helper('dropship360')->startProcess('manual_upload');
84
  }
85
 
86
  protected function finalize(){
87
+ Mage::helper('dropship360')->finishProcess('manual_upload');
88
  }
89
 
90
  public function vendorsuploadhistoryAction()
98
  public function editAction()
99
  {
100
  $id = $this->getRequest()->getParam('lb_item_id');
101
+ $model = Mage::getModel('dropship360/orderitems')->load($id);
102
  if ($model->getId()) {
103
  $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
104
  if (!empty($data)) {
106
  }
107
  Mage::register('sourcing_data', $model);
108
  $this->loadLayout();
109
+ $this->_setActiveMenu('dropship360/order_sourcing');
110
  $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Order Sourcing'), Mage::helper('adminhtml')->__('Order Sourcing'));
111
+ $this->_addContent($this->getLayout()->createBlock('dropship360/adminhtml_sourcing_edit'))
112
+ ->_addLeft($this->getLayout()->createBlock('dropship360/adminhtml_sourcing_edit_tabs'));
113
  $this->renderLayout();
114
  } else {
115
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship360')->__('Sourcing does not exist'));
116
  $this->_redirect('*/*/sourcinggrid');
117
  }
118
  }
121
  public function validateftpconnectionAction()
122
  {
123
  $paramsArray = $this->getRequest()->getParams();
124
+ $validateConnection = Mage::getModel('dropship360/uploadvendor');
125
  $result = $validateConnection->testFtpConnection($paramsArray['groups']['cron_settings_upload']['fields']);
126
  $result = Mage::helper('core')->jsonEncode($result);
127
  Mage::app()->getResponse()->setBody($result);
133
  if ($data = $this->getRequest()->getPost()) {
134
  $vendorCode = $data['lb_vendor_code'];
135
  $sku = $data['sku'];
136
+ $model = Mage::getModel('dropship360/orderitems');
137
 
138
  if($this->getRequest()->getParam('cancel') == 'item'){
139
  $model->load($this->getRequest()->getParam('lb_item_id'));
140
  $model->setLbItemStatus('Cancelled');
141
  try{
142
  $model->save();
143
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('dropship360')->__('Item %s Cancelled Successfully ',$model->getSku()));
144
 
145
  }catch(Exception $e){
146
  Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
153
  }
154
 
155
  if(!$data['lb_vendor_code']){
156
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship360')->__('Under Processing By Logicbroker Can Not Update %s Sku',$model->getSku()));
157
  $this->_redirect('*/*/sourcinggrid');
158
  return;
159
  }
163
  $model->save();
164
  $model->updateOrderStatus($model->getItemOrderId(),$model->getItemId());
165
  Mage::getSingleton('adminhtml/session')->setFormData(false);
166
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('dropship360')->__('Sourcing Updated For %s',$model->getSku()));
167
  if ($this->getRequest()->getParam('back')) {
168
  $this->_redirect('*/*/edit', array('lb_item_id' => $model->getId()));
169
  return;
177
  return;
178
  }
179
  }
180
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship360')->__('Unable to save sourcing'));
181
  $this->_redirect('*/*/sourcinggrid');
182
  }
183
 
214
  $isProductSetupMode = (isset($paramsArray['isproductsetupmode']) && $paramsArray['isproductsetupmode']) ? true : false;
215
  $type = ($isProductSetupMode) ? 'setup' : 'upload';
216
  $fileName = 'logicbroker_supplier_product_'.$type.'.csv';
217
+ $content = Mage::getModel('dropship360/uploadvendor')->getCsvFile($isProductSetupMode);
218
  $this->_prepareDownloadResponse($fileName, $content);
219
  $this->_redirect('*/*/index');
220
 
224
 
225
  protected function _initSystem()
226
  {
227
+ $this->_title($this->__('dropship360'))
228
  ->_title($this->__('Bulk vendor assignment'));
229
  $vendorCode = $this->getRequest()->getParam('lb_vendor_code');
230
  if (!$vendorCode) {
250
  if (!is_array($rowIds) || count($rowIds) < 1) {
251
  return;
252
  }
253
+ $vendorName = Mage::getModel('dropship360/ranking')->load($vendorCode,'lb_vendor_code');
254
  $errors = array();
255
  $saved = 0;
256
  $skuError = array();
257
  $skuSuccuess = array();
258
  if(!Mage::getSingleton('adminhtml/session')->getTerminateExecution()){
259
+ Mage::helper('dropship360')->startProcess('bulk_assign');
260
  }else
261
  {
262
  return;
263
  }
264
  foreach($rowIds as $sku){
265
+ $collection = Mage::getModel('dropship360/inventory')->getCollection()->addFieldToFilter('product_sku',$sku)->addFieldToFilter('lb_vendor_code',$vendorCode);
266
  $inventoryId = ($collection->getSize() > 0) ? $collection->getFirstItem()->getId() : '';
267
  if(!$inventoryId)
268
  {
269
+ $inventoryCollection = Mage::getModel('dropship360/inventory');
270
  $inventoryCollection->setLbVendorCode($vendorCode);
271
  $inventoryCollection->setLbVendorName(($vendorName) ? $vendorName->getLbVendorName() : '');
272
  $inventoryCollection->setProductSku($sku);
277
  $inventoryCollection->setCreatedAt(now());
278
  try {
279
  $inventoryCollection->save();
280
+ Mage::getModel('dropship360/inventory')->_saveInventoryLog('add',array('lb_vendor_code'=>$vendorCode,'lb_vendor_name'=>($vendorName) ? $vendorName->getLbVendorName() : '','product_sku'=>$sku,'cost'=>0,'stock'=>0,'updated_by'=>'bulk_setup'));
281
  $saved ++;
282
  $skuSuccuess[] = $sku;
283
  } catch (Exception $e) {
287
  }
288
  }else
289
  {
290
+ $errors[] = Mage::helper('dropship360')->__('Skip %s as supplier %s already assigned.',$sku,$vendorCode);
291
  $skuError[] = $sku;
292
  continue;
293
  }
306
  $exeuctionTerminated = $this->getRequest()->getParam('exeuctionTerminated');
307
  if($exeuctionTerminated){
308
  Mage::getSingleton('adminhtml/session')->setTerminateExecution(true);
309
+ Mage::helper('dropship360')->finishProcess('bulk_assign');
310
  }else
311
  {
312
+ Mage::helper('dropship360')->finishProcess('bulk_assign');
313
  }
314
  $result = array();
315
  $data = $this->getRequest()->getPost();
316
+ Mage::getResourceModel('dropship360/vendorimportlog')->insertlog($data['lb_vendor_code'],'Bulk-product-setup',$data['sucees_sku'],$data['errorSkuCount']);
317
  $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
318
  }
319
 
320
 
321
  public function terminateAction(){
322
 
323
+ Mage::helper('dropship360')->finishProcess('manual_upload');
324
  $result = array();
325
  $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
326
  }
331
  public function exportCsvAction()
332
  {
333
  $fileName = 'inventory.csv';
334
+ $content = $this->getLayout()->createBlock('dropship360/adminhtml_inventory_grid')->getCsvFile();
335
  $this->_prepareDownloadResponse($fileName, $content);
336
  }
337
 
341
  public function exportXmlAction()
342
  {
343
  $fileName = 'inventory.xml';
344
+ $content = $this->getLayout()->createBlock('dropship360/adminhtml_inventory_grid')->getExcelFile($fileName);
345
  $this->_prepareDownloadResponse($fileName, $content);
346
  }
347
 
349
  {
350
  $params = $this->getRequest()->getParams();
351
  $filename = 'upload_error.csv';
352
+ $content = Mage::helper('dropship360')->generateErrorList($params);
353
+ if($content['error'])
354
+ return $this->getResponse()->setRedirect($this->getUrl('*/*/vendorsuploadhistory'));
355
  $this->_prepareDownloadResponse($filename, $content);
356
  }
357
 
358
+ /**
359
+ * Delete log action
360
+ */
361
+ public function deleteAction()
362
+ {
363
+ if ($id = $this->getRequest()->getParam('id')) {
364
+ $tableName = Mage::getSingleton ( 'core/resource' )->getTableName ('dropship360/vendor_import_log');
365
+ $connection = Mage::getSingleton ('core/resource')->getConnection ('core_read');
366
+ $select = $connection->select()->from($tableName)->where('error_id=?', $id);
367
+ $connection->fetchRow($select);
368
+ try {
369
+ $connection->delete($tableName,array('error_id'=>$id));
370
+ $this->_getSession()->addSuccess($this->__('The log has been deleted.'));
371
+ } catch (Exception $e) {
372
+ $this->_getSession()->addError($e->getMessage());
373
+ }
374
+ }
375
+ $this->getResponse()
376
+ ->setRedirect($this->getUrl('*/*/vendorsuploadhistory', array('store'=>$this->getRequest()->getParam('store'))));
377
+ }
378
+
379
+ /**
380
+ * Acl check for admin
381
+ *
382
+ * @return bool
383
+ */
384
+ protected function _isAllowed()
385
+ {
386
+ return Mage::getSingleton('admin/session')->isAllowed('dropship360/inventory');
387
+ }
388
 
389
  }
includes/src/Logicbroker/Fulfillment/controllers/Adminhtml/InventoryController.php DELETED
@@ -1,49 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Logicbroker
5
- *
6
- * @category Community
7
- * @package Logicbroker_Fulfillment
8
- */
9
-
10
- class Logicbroker_Fulfillment_Adminhtml_InventoryController extends Mage_Adminhtml_Controller_Action
11
- {
12
-
13
- protected function _initAction() {
14
- $this->loadLayout()
15
- ->_setActiveMenu('logicbroker/invemtory')
16
- ->_addBreadcrumb(Mage::helper('adminhtml')->__('Inventory Manager'), Mage::helper('adminhtml')->__('Inventory Manager'));
17
-
18
- return $this;
19
- }
20
-
21
- public function indexAction() {
22
- $this->_initAction()
23
- ->renderLayout();
24
- }
25
-
26
- public function vendorsAction(){
27
- $this->loadLayout();
28
- $this->getLayout()->getBlock("vendors_product_tab")
29
- ->setProductId($this->getRequest()->getParam('id'));
30
- $this->renderLayout();
31
- }
32
-
33
- public function vendorshistoryAction(){
34
- $this->loadLayout();
35
- $this->getLayout()->getBlock("vendors_product_tab_history")
36
- ->setProductId($this->getRequest()->getParam('id'));
37
- $this->renderLayout();
38
- }
39
-
40
- /**
41
- * suppplier grid for AJAX request
42
- */
43
- public function gridAction() {
44
- $this->getResponse()->setBody(
45
- $this->getLayout()->createBlock('logicbroker/adminhtml_inventory_grid')->toHtml()
46
- );
47
- }
48
-
49
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/src/Logicbroker/Fulfillment/controllers/Adminhtml/LogicbrokerController.php DELETED
@@ -1,217 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Logicbroker
5
- *
6
- * @category Community
7
- * @package Logicbroker_Fulfillment
8
- */
9
-
10
- class Logicbroker_Fulfillment_Adminhtml_LogicbrokerController extends Mage_Adminhtml_Controller_Action
11
- {
12
-
13
- protected function _initAction() {
14
- $this->loadLayout()
15
- ->_setActiveMenu('logicbroker/suppliers')
16
- ->_addBreadcrumb(Mage::helper('adminhtml')->__('Vendor Manager'), Mage::helper('adminhtml')->__('Vendor Manager'));
17
-
18
- return $this;
19
- }
20
-
21
- public function indexAction() {
22
- $this->_initAction()
23
- ->renderLayout();
24
- }
25
-
26
- /**
27
- * suppplier grid for AJAX request
28
- */
29
-
30
- public function sourcinggridAction() {
31
-
32
- $this->getLayout()->createBlock('logicbroker/adminhtml_sourcing_grid')->toHtml();
33
- $this->loadLayout()->renderLayout();
34
-
35
- }
36
-
37
- public function gridAction() {
38
- $this->getResponse()->setBody(
39
- $this->getLayout()->createBlock('logicbroker/adminhtml_logicbroker_grid')->toHtml()
40
- );
41
- }
42
- public function editAction() {
43
- $id = $this->getRequest()->getParam('vendor_id');
44
- $model = Mage::getModel('logicbroker/supplier')->load($id);
45
-
46
- if ($model->getVendorId() || $id == 0) {
47
- $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
48
- if (!empty($data)) {
49
- $model->setData($data);
50
-
51
- }
52
- Mage::register('logicbroker_data', $model);
53
-
54
- $this->loadLayout();
55
- $this->_setActiveMenu('logicbroker/suppliers');
56
-
57
- $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Vendor Manager'), Mage::helper('adminhtml')->__('Vendor Manager'));
58
- $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
59
-
60
- $this->_addContent($this->getLayout()->createBlock('logicbroker/adminhtml_logicbroker_edit'))
61
- ->_addLeft($this->getLayout()->createBlock('logicbroker/adminhtml_logicbroker_edit_tabs'));
62
-
63
- $this->renderLayout();
64
- } else {
65
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('logicbroker')->__('Vendor does not exist'));
66
- $this->_redirect('*/*/');
67
- }
68
- }
69
-
70
- public function newAction()
71
- {
72
- $this->loadLayout();
73
- $this->_setActiveMenu('logicbroker/suppliers');
74
- $this->_addContent($this->getLayout()->createBlock('logicbroker/adminhtml_logicbroker_edit'))
75
- ->_addLeft($this->getLayout()->createBlock('logicbroker/adminhtml_logicbroker_edit_tabs'));
76
- $this->renderLayout();
77
-
78
- }
79
-
80
- public function saveAction() {
81
- if ($data = $this->getRequest()->getPost()) {
82
-
83
-
84
- $model = Mage::getModel('logicbroker/supplier');
85
- if ($id = $this->getRequest()->getParam('vendor_id')) {//the parameter name may be different
86
- $model->load($id);
87
- }
88
- $companyid = $this->getRequest()->getParam('company_id');
89
- $message = '';
90
- //echo $model->getCompanyId() .'=='. $companyid;
91
- //var_dump(strcmp($model->getCompanyId(),$companyid));
92
- //die();
93
- $result = array();
94
- if(empty($companyid) || strcmp($model->getCompanyId(),$companyid) == 0 )
95
- $validate = 0;
96
- else{
97
- $result = $model->validateCompany($companyid,$data);
98
- $validate = $result['validate'];
99
- $data = $result['data'];
100
- if(!$validate){
101
- $model->load($data['id']);
102
- }
103
-
104
- }
105
- $message = ($result['message']) ? 'Vendor Recovered Successfully -'.$data['company_id'] : 'vendor was successfully saved';
106
- $model->addData($data);
107
-
108
-
109
- try {
110
- if(!empty($data['addnewoption'])){
111
- $model->setData('magento_vendor_code',strtolower($data['addnewoption']));
112
- }
113
- //validate compny id as unique
114
-
115
-
116
- if($validate == 1){
117
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('logicbroker')->__('Duplicate Company ID'));
118
- Mage::getSingleton('adminhtml/session')->setFormData($data);
119
- $this->_redirect('*/*/edit', array('vendor_id' => $model->getVendorId()));
120
- return;
121
- }
122
- //$model->getFtpPassword = md5($model->getFtpPassword());
123
- //$model->setData('ftp_password',$model->getFtpPassword);
124
- $model->save();
125
-
126
- if(!empty($data['addnewoption'])){
127
- Mage::getModel('logicbroker/logicbroker')->createOptionValueOnSave($model->getMagentoVendorCode());
128
- }
129
- Mage::getModel('logicbroker/ranking')->setVendorRanking($data,$model);
130
- Mage::getSingleton('adminhtml/session')->setFormData(false);
131
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('logicbroker')->__($message));
132
-
133
- if ($this->getRequest()->getParam('back')) {
134
- $this->_redirect('*/*/edit', array('vendor_id' => $model->getVendorId()));
135
- return;
136
- }
137
- $this->_redirect('*/*/');
138
- return;
139
- } catch (Exception $e) {
140
- Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
141
- Mage::getSingleton('adminhtml/session')->setFormData($data);
142
- $this->_redirect('*/*/edit', array('vendor_id'=>$model->getVendorId(), '_current'=>true));
143
- return;
144
- }
145
- }
146
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('logicbroker')->__('Unable to find vendor to save'));
147
- $this->_redirect('*/*/');
148
- }
149
-
150
- public function deleteAction()
151
- {
152
-
153
- if ($id = $this->getRequest()->getParam('vendor_id')) {
154
- try {
155
-
156
- $model = Mage::getModel('logicbroker/supplier');
157
- $model->load($id);
158
- $model->setData('status','deleted');
159
- $model->save();
160
- Mage::getModel('logicbroker/ranking')->rearrangeRank($id);
161
- Mage::getModel('logicbroker/ranking')->load($id,'lb_vendor_id')->setRanking('')->setIsDropship('no')->setIsActive('no')->save();
162
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('logicbroker')->__('The vendor has been deleted.'));
163
- $this->_redirect('*/*/');
164
- return;
165
-
166
- } catch (Exception $e) {
167
-
168
- Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
169
-
170
- $this->_redirect('*/*/edit', array('vendor_id' => $id));
171
- return;
172
- }
173
- }
174
-
175
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('logicbroker')->__('Unable to find a vendor to delete.'));
176
-
177
- $this->_redirect('*/*/');
178
- }
179
-
180
-
181
- /**
182
- * Export vendor in csv format
183
- */
184
- public function exportCsvAction()
185
- {
186
- $fileName = 'vendor.csv';
187
- $content = $this->getLayout()->createBlock('logicbroker/adminhtml_logicbroker_grid')
188
- ->getCsvFile();
189
-
190
- $this->_prepareDownloadResponse($fileName, $content);
191
- }
192
-
193
- /**
194
- * Export vendor in Excel format
195
- */
196
- public function exportXmlAction()
197
- {
198
- $fileName = 'vendor.xml';
199
- $content = $this->getLayout()->createBlock('logicbroker/adminhtml_logicbroker_grid')
200
- ->getExcelFile($fileName);
201
-
202
- $this->_prepareDownloadResponse($fileName, $content);
203
- }
204
-
205
- public function validateajaxrequestAction()
206
- {
207
-
208
- $paramsArray = $this->getRequest()->getParams();
209
- $validation = Mage::getModel('logicbroker/logicbroker');
210
- $result = $validation->validation($paramsArray['groups']['integration']['fields']);
211
- //$result['message'] = 'JAI hohohoh';
212
- $result = Mage::helper('core')->jsonEncode($result);
213
- Mage::app()->getResponse()->setBody($result);
214
-
215
- }
216
-
217
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/src/Logicbroker/Fulfillment/controllers/Adminhtml/RankingController.php DELETED
@@ -1,217 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Logicbroker
5
- *
6
- * @category Community
7
- * @package Logicbroker_Fulfillment
8
- */
9
- class Logicbroker_Fulfillment_Adminhtml_RankingController extends Mage_Adminhtml_Controller_Action {
10
- protected function _initAction() {
11
- $this->loadLayout ()->_setActiveMenu ( 'logicbroker/vendor_ranking' )->_addBreadcrumb ( Mage::helper ( 'adminhtml' )->__ ( 'Vendor Ranking' ), Mage::helper ( 'adminhtml' )->__ ( 'Vendor Ranking' ) );
12
-
13
- return $this;
14
- }
15
- public function indexAction() {
16
- $layout = $this->_initAction ();
17
- $layout->getLayout()->getBlock('head')->setCanLoadExtJs(false);
18
- $layout->renderLayout ();
19
-
20
- }
21
- public function popupAction() {
22
- $this->loadLayout ();
23
- $this->renderLayout ();
24
- }
25
-
26
- /**
27
- * Ranking grid
28
- */
29
- public function gridAction() {
30
- $this->getResponse ()->setBody ( $this->getLayout ()->createBlock ( 'logicbroker/adminhtml_ranking_grid' )->toHtml () );
31
- }
32
- public function editAction() {
33
-
34
- }
35
- public function newAction() {
36
-
37
- }
38
-
39
- public function showhistoryAction() {
40
- $this->loadLayout ();
41
- $this->renderLayout ();
42
- }
43
-
44
- public function addNewVendorAction() {
45
-
46
- $isSuccess = false;
47
- $data = $this->getRequest ()->getPost ();
48
- $arrVendor = array();
49
- $vendorRankCollection = Mage::getModel ( 'logicbroker/ranking' );
50
- $eavModel=Mage::getModel('eav/entity_setup','core_setup');
51
- $genrateVendorCode = $vendorRankCollection->getCollection()->addFieldToFilter('lb_vendor_code',array('like'=>'%MagVendID%'));
52
-
53
- foreach($genrateVendorCode as $vendorCode)
54
- {
55
- if(preg_match('!\d+!', $vendorCode->getLbVendorCode(), $matches)){
56
- $arrVendor[] = (int) $matches[0];
57
- }
58
-
59
- }
60
- $suffix = ((int) max($arrVendor) + 1);
61
- $code = 'MagVendID'.$suffix;
62
- $vendorRankCollection->setLbVendorCode($code);
63
- $vendorRankCollection->setRanking($data['rank']);
64
- $vendorRankCollection->setLbVendorName($data['name']);
65
- $vendorRankCollection->setLbVendorType('user');
66
- $vendorRankCollection->setUpdatedAt(gmdate('Y-m-d H:i:s'));
67
- try{
68
- $vendorRankCollection->save();
69
- $option = array ('values' =>array ($suffix => $code));
70
- $option['attribute_id'] = $eavModel->getAttributeId(Mage::getModel ( 'eav/config' )->getEntityType ( 'catalog_product' )->getEntityTypeId (), 'lb_vendor_code_list');
71
- $eavModel->addAttributeOption($option);
72
-
73
- $isSuccess = true;
74
- }catch ( Exception $e ) {
75
- Mage::getSingleton ( 'adminhtml/session' )->addError ( $e->getMessage () );
76
- $isSuccess = false;
77
- }
78
- $result = array('success'=>$isSuccess,'message'=>$code);
79
-
80
- $result = Mage::helper('core')->jsonEncode($result);
81
- Mage::app()->getResponse()->setBody($result);
82
-
83
- return;
84
- }
85
-
86
-
87
- public function saverankingAction() {
88
- $updateVendorRank = array ();
89
- $vendorRanking = array ();
90
- $rankingArray = array ();
91
- $vendorName = array();
92
-
93
- $data = $this->getRequest ()->getPost ();
94
-
95
- $tableName = $data['partent_save_table_input'];
96
- $dropShip = json_decode((urldecode($data['dropship_data'])),true);
97
- $nonDropShip = json_decode((urldecode($data['nondropship_data'])),true);
98
- $vendorName = json_decode((urldecode($data['vendorname_data'])),true);
99
- $modelRanking = Mage::getModel ( 'logicbroker/rankinglog' )->load($tableName,'label');
100
- /* echo '<pre>';
101
- print_r($dropShip);
102
- print_r($nonDropShip);
103
- print_r($vendorName);
104
- die */;
105
-
106
- if (!$tableName || $modelRanking->getId()) {
107
- Mage::getSingleton ( 'adminhtml/session' )->addError ( Mage::helper ( 'logicbroker' )->__ ( 'Ranking Table Name Is Empty Or Already Exists' ) );
108
- $this->_redirect ( '*/*/' );
109
- return;
110
- }
111
-
112
- $this->_saveVendorRanking($dropShip,true);
113
- $this->_saveVendorRanking($nonDropShip,false);
114
- $this->_updateVendorName($vendorName);
115
- $result = $this->_saveTableRanking(trim($tableName));
116
-
117
- Mage::getSingleton ( 'adminhtml/session' )->addSuccess ( Mage::helper ( 'logicbroker' )->__ ( 'Vendor ranking saved successfully' ) );
118
- $this->_redirect ( '*/*/' );
119
- return;
120
- }
121
- protected function _saveVendorRanking($collection,$rank = false) {
122
- if(!empty($collection))
123
- {
124
- try {
125
- foreach ( $collection as $key => $val ) {
126
- $model = Mage::getModel ( 'logicbroker/ranking' )->load ( $val['code'], 'lb_vendor_code' );
127
- $model->setUpdatedAt(gmdate('Y-m-d H:i:s'));
128
-
129
- if($rank)
130
- $model->setIsDropship ('yes');
131
- else
132
- $model->setIsDropship ('no');
133
-
134
- $model->setRanking ( ($rank) ? $key+1:0 );
135
- $model->save ();
136
- }
137
-
138
- } catch ( Exception $e ) {
139
- Mage::getSingleton ( 'adminhtml/session' )->addError ( $e->getMessage () );
140
- }
141
- }
142
-
143
- }
144
-
145
- protected function _updateVendorName($collection) {
146
- if(!empty($collection))
147
- {
148
- try {
149
- foreach ( $collection as $key => $val ) {
150
- $model = Mage::getModel ( 'logicbroker/ranking' )->load ( $val['code'], 'lb_vendor_code' );
151
- if($model->getLbVendorCode())
152
- $model->setLbVendorName ($val['name'])->save();
153
-
154
- $modelInventory = Mage::getModel ( 'logicbroker/inventory' )->load ( $val['code'], 'lb_vendor_code' );
155
- if($modelInventory->getLbVendorCode())
156
- $modelInventory->setLbVendorName ($val['name'])->save();
157
-
158
- }
159
-
160
- } catch ( Exception $e ) {
161
- Mage::getSingleton ( 'adminhtml/session' )->addError ( $e->getMessage () );
162
- }
163
- }
164
-
165
- }
166
-
167
- protected function _saveTableRanking($tableName) {
168
-
169
- $serializedArray = array ();
170
- $model = Mage::getModel ( 'logicbroker/ranking' );
171
- $modelRanking = Mage::getModel ( 'logicbroker/rankinglog' );
172
- $collection = $model->getCollection ();
173
- $collection->getSelect()->order('ranking asc');
174
-
175
-
176
-
177
- if($collection->count() > 0){
178
- foreach ( $collection as $value ) {
179
- $serializedArray [] = array (
180
- $value->getLbVendorName (),
181
- $value->getLbVendorCode (),
182
- $value->getRanking (),
183
- $value->getIsDropship()
184
-
185
- );
186
- }
187
- $modelRanking->setRankingData ( serialize ( $serializedArray ) );
188
- $modelRanking->setLabel ( trim ( $tableName ) );
189
-
190
- try {
191
- $modelRanking->save ();
192
-
193
- } catch ( Exception $e ) {
194
- Mage::getSingleton ( 'adminhtml/session' )->addError ( $e->getMessage () );
195
- }
196
- }
197
- return;
198
- }
199
-
200
- public function deleteAction() {
201
-
202
- }
203
-
204
- /**
205
- * Export vendor in csv format
206
- */
207
- public function exportCsvAction() {
208
-
209
- }
210
-
211
- /**
212
- * Export vendor in Excel format
213
- */
214
- public function exportXmlAction() {
215
-
216
- }
217
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/src/Logicbroker/Fulfillment/controllers/Adminhtml/SourcingController.php DELETED
@@ -1,138 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Logicbroker
5
- *
6
- * @category Community
7
- * @package Logicbroker_Fulfillment
8
- */
9
-
10
- class Logicbroker_Fulfillment_Adminhtml_SourcingController extends Mage_Adminhtml_Controller_Action
11
- {
12
-
13
- protected function _initAction() {
14
- $this->loadLayout()
15
- ->_setActiveMenu('logicbroker/order_sourcing')
16
- ->_addBreadcrumb(Mage::helper('adminhtml')->__('Order Sourcing'), Mage::helper('adminhtml')->__('Oreder Sourcing'));
17
-
18
- return $this;
19
- }
20
-
21
- public function indexAction() {
22
- $this->_initAction()
23
- ->renderLayout();
24
- }
25
-
26
- /**
27
- * sourcing grid
28
- */
29
-
30
- public function sourcinggridAction() {
31
-
32
- $this->getLayout()->createBlock('logicbroker/adminhtml_sourcing_grid')->toHtml();
33
- $this->loadLayout()->renderLayout();
34
-
35
- }
36
-
37
-
38
- public function editAction() {
39
- $id = $this->getRequest()->getParam('lb_item_id');
40
- $model = Mage::getModel('logicbroker/orderitems')->load($id);
41
-
42
- if ($model->getId()) {
43
- $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
44
- if (!empty($data)) {
45
- $model->setData($data);
46
-
47
- }
48
- Mage::register('sourcing_data', $model);
49
-
50
- $this->loadLayout();
51
- $this->_setActiveMenu('logicbroker/order_sourcing');
52
-
53
- $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Order Sourcing'), Mage::helper('adminhtml')->__('Order Sourcing'));
54
- $this->_addContent($this->getLayout()->createBlock('logicbroker/adminhtml_sourcing_edit'))
55
- ->_addLeft($this->getLayout()->createBlock('logicbroker/adminhtml_sourcing_edit_tabs'));
56
-
57
- $this->renderLayout();
58
- } else {
59
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('logicbroker')->__('Sourcing does not exist'));
60
- $this->_redirect('*/*/sourcinggrid');
61
- }
62
- }
63
-
64
-
65
-
66
- public function saveAction() {
67
- if ($data = $this->getRequest()->getPost()) {
68
-
69
- $vendorCode = $data['lb_vendor_code'];
70
- $sku = $data['sku'];
71
- $model = Mage::getModel('logicbroker/orderitems');
72
- if ($id = $this->getRequest()->getParam('lb_item_id')) {//the parameter name may be different
73
- $model->load($id);
74
- }
75
-
76
- if(!$data['lb_vendor_code']){
77
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('logicbroker')->__('Under Processing By Logicbroker Can Not Update %s Sku',$model->getSku()));
78
- $this->_redirect('*/*/sourcinggrid');
79
- return;
80
- }
81
-
82
- //echo $model->getCompanyId() .'=='. $companyid;
83
- //var_dump(strcmp($model->getCompanyId(),$companyid));
84
- //die();
85
- $arrData = $model->updateSourcingByUser(array('lb_vendor_code'=>$vendorCode,'product_sku'=>$sku));
86
- $model->addData($arrData);
87
-
88
-
89
- try {
90
- $model->updateOrderStatus($model->getItemOrderId(),$model->getItemId());
91
- $model->save();
92
- Mage::getSingleton('adminhtml/session')->setFormData(false);
93
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('logicbroker')->__('Sourcing Updated For %s',$model->getSku()));
94
-
95
- if ($this->getRequest()->getParam('back')) {
96
- $this->_redirect('*/*/edit', array('lb_item_id' => $model->getId()));
97
- return;
98
- }
99
- $this->_redirect('*/*/sourcinggrid');
100
- return;
101
- } catch (Exception $e) {
102
- Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
103
- Mage::getSingleton('adminhtml/session')->setFormData($data);
104
- $this->_redirect('*/*/edit', array('lb_item_id' => $model->getId(), '_current'=>true));
105
- return;
106
- }
107
- }
108
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('logicbroker')->__('Unable to save sourcing'));
109
- $this->_redirect('*/*/sourcinggrid');
110
- }
111
-
112
-
113
- /**
114
- * Export vendor in csv format
115
- */
116
- public function exportCsvAction()
117
- {
118
- $fileName = 'sourcing.csv';
119
- $content = $this->getLayout()->createBlock('logicbroker/adminhtml_sourcing_grid')
120
- ->getCsvFile();
121
-
122
- $this->_prepareDownloadResponse($fileName, $content);
123
- }
124
-
125
- /**
126
- * Export vendor in Excel format
127
- */
128
- public function exportXmlAction()
129
- {
130
- $fileName = 'sourcing.xml';
131
- $content = $this->getLayout()->createBlock('logicbroker/adminhtml_sourcing_grid')
132
- ->getExcelFile($fileName);
133
-
134
- $this->_prepareDownloadResponse($fileName, $content);
135
- }
136
-
137
-
138
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/src/Logicbroker_Dropship360_Block_Adminhtml_Inventory.php CHANGED
@@ -11,8 +11,8 @@ class Logicbroker_Dropship360_Block_Adminhtml_Inventory extends Mage_Adminhtml_B
11
  public function __construct()
12
  {
13
  $this->_controller = 'adminhtml_inventory';
14
- $this->_blockGroup = 'logicbroker';
15
- $this->_headerText = Mage::helper('logicbroker')->__('');
16
  parent::__construct();
17
  $this->removeButton('add');
18
  }
11
  public function __construct()
12
  {
13
  $this->_controller = 'adminhtml_inventory';
14
+ $this->_blockGroup = 'dropship360';
15
+ $this->_headerText = Mage::helper('dropship360')->__('');
16
  parent::__construct();
17
  $this->removeButton('add');
18
  }
includes/src/Logicbroker_Dropship360_Block_Adminhtml_Inventory_Edit_Tab_Addvendorfield.php CHANGED
@@ -67,7 +67,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Inventory_Edit_Tab_Addvendorfield
67
  'class' => 'select select-product-option-type required-option-select'
68
  ))
69
  ->setName($this->getFieldName().'[{{id}}][lb_vendor_code]')
70
- ->setOptions(Mage::getSingleton('logicbroker/system_config_source_vendorlist')->vendorList('',$productsku));
71
 
72
  return $select->getHtml();
73
  }
@@ -76,7 +76,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Inventory_Edit_Tab_Addvendorfield
76
  $this->setChild('delete_button_vendor',
77
  $this->getLayout()->createBlock('adminhtml/widget_button')
78
  ->setData(array(
79
- 'label' => Mage::helper('logicbroker')->__('Delete Option'),
80
  'class' => 'delete delete-product-option-vendor '
81
  ))
82
  );
67
  'class' => 'select select-product-option-type required-option-select'
68
  ))
69
  ->setName($this->getFieldName().'[{{id}}][lb_vendor_code]')
70
+ ->setOptions(Mage::getSingleton('dropship360/system_config_source_vendorlist')->vendorList('',$productsku));
71
 
72
  return $select->getHtml();
73
  }
76
  $this->setChild('delete_button_vendor',
77
  $this->getLayout()->createBlock('adminhtml/widget_button')
78
  ->setData(array(
79
+ 'label' => Mage::helper('dropship360')->__('Delete Option'),
80
  'class' => 'delete delete-product-option-vendor '
81
  ))
82
  );
includes/src/Logicbroker_Dropship360_Block_Adminhtml_Inventory_Edit_Tab_Lbvendor.php CHANGED
@@ -20,7 +20,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Inventory_Edit_Tab_Lbvendor extend
20
  $this->setChild('vendor_add_button',
21
  $this->getLayout()->createBlock('adminhtml/widget_button')
22
  ->setData(array(
23
- 'label' => Mage::helper('logicbroker')->__('Add New Supplier'),
24
  'class' => 'add',
25
  'id' => 'add_new_defined_option_vendor'
26
  ))
@@ -29,13 +29,13 @@ class Logicbroker_Dropship360_Block_Adminhtml_Inventory_Edit_Tab_Lbvendor extend
29
  $this->setChild('update_delete_button_vendor',
30
  $this->getLayout()->createBlock('adminhtml/widget_button')
31
  ->setData(array(
32
- 'label' => Mage::helper('logicbroker')->__('Delete Option'),
33
  'class' => 'delete delete-product-option-vendor '
34
  ))
35
  );
36
 
37
  $this->setChild('vendor_options_box',
38
- $this->getLayout()->createBlock('logicbroker/adminhtml_inventory_edit_tab_addvendorfield')
39
  );
40
 
41
  return parent::_prepareLayout();
@@ -53,8 +53,8 @@ class Logicbroker_Dropship360_Block_Adminhtml_Inventory_Edit_Tab_Lbvendor extend
53
 
54
  public function getAssignedData(){
55
 
56
- $rankingTableName = Mage::getSingleton('core/resource')->getTableName('logicbroker/ranking');
57
- $collection = Mage::getModel('logicbroker/inventory')->getCollection()
58
  ->addFieldToFilter('product_sku',Mage::getModel('catalog/product')->load($this->getProductId())->getSku());
59
  $collection->getSelect()->joinLeft(array('ranking' => $rankingTableName), 'main_table.lb_vendor_code=ranking.lb_vendor_code', array('vendor_name' => 'lb_vendor_name'));
60
  return $collection;
20
  $this->setChild('vendor_add_button',
21
  $this->getLayout()->createBlock('adminhtml/widget_button')
22
  ->setData(array(
23
+ 'label' => Mage::helper('dropship360')->__('Add New Supplier'),
24
  'class' => 'add',
25
  'id' => 'add_new_defined_option_vendor'
26
  ))
29
  $this->setChild('update_delete_button_vendor',
30
  $this->getLayout()->createBlock('adminhtml/widget_button')
31
  ->setData(array(
32
+ 'label' => Mage::helper('dropship360')->__('Delete Option'),
33
  'class' => 'delete delete-product-option-vendor '
34
  ))
35
  );
36
 
37
  $this->setChild('vendor_options_box',
38
+ $this->getLayout()->createBlock('dropship360/adminhtml_inventory_edit_tab_addvendorfield')
39
  );
40
 
41
  return parent::_prepareLayout();
53
 
54
  public function getAssignedData(){
55
 
56
+ $rankingTableName = Mage::getSingleton('core/resource')->getTableName('dropship360/ranking');
57
+ $collection = Mage::getModel('dropship360/inventory')->getCollection()
58
  ->addFieldToFilter('product_sku',Mage::getModel('catalog/product')->load($this->getProductId())->getSku());
59
  $collection->getSelect()->joinLeft(array('ranking' => $rankingTableName), 'main_table.lb_vendor_code=ranking.lb_vendor_code', array('vendor_name' => 'lb_vendor_name'));
60
  return $collection;
includes/src/Logicbroker_Dropship360_Block_Adminhtml_Inventory_Edit_Tab_Vendortabhistory.php CHANGED
@@ -22,7 +22,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Inventory_Edit_Tab_Vendortabhistor
22
 
23
  public function getInventoryLog(){
24
 
25
- $collection = Mage::getModel('logicbroker/inventorylog')->getCollection()->addFieldToFilter('product_sku',Mage::getModel('catalog/product')->load($this->getProductId())->getSku());
26
  $collection->getSelect()->order('updated_at desc');
27
 
28
  return $collection;
22
 
23
  public function getInventoryLog(){
24
 
25
+ $collection = Mage::getModel('dropship360/inventorylog')->getCollection()->addFieldToFilter('product_sku',Mage::getModel('catalog/product')->load($this->getProductId())->getSku());
26
  $collection->getSelect()->order('updated_at desc');
27
 
28
  return $collection;
includes/src/Logicbroker_Dropship360_Block_Adminhtml_Inventory_Grid.php CHANGED
@@ -23,8 +23,8 @@ class Logicbroker_Dropship360_Block_Adminhtml_Inventory_Grid extends Mage_Adminh
23
  {
24
  $entityTypeId = Mage::getModel ( 'eav/config' )->getEntityType ( 'catalog_product' )->getEntityTypeId ();
25
  $prodNameAttrId = Mage::getModel('eav/entity_attribute')->loadByCode($entityTypeId, 'name')->getAttributeId();
26
- $collection = Mage::getModel('logicbroker/inventory')->getCollection();
27
- $collection->getSelect()->join(array('lbRanking'=>Mage::getSingleton('core/resource')->getTableName('logicbroker/ranking')),'lbRanking.lb_vendor_code = main_table.lb_vendor_code', array('lb_vendor_name'));
28
  $collection->getSelect()->joinLeft(array('prod' => Mage::getSingleton('core/resource')->getTableName('catalog/product')),'prod.sku = main_table.product_sku',array('magento_pro_id'=>'entity_id'));
29
  $collection->getSelect()->joinLeft(array('cpev' => Mage::getSingleton('core/resource')->getTableName('catalog/product').'_varchar'),'cpev.entity_id=prod.entity_id AND cpev.attribute_id='.$prodNameAttrId.'',array('product_name' => 'value'));
30
  $collection->getSelect()->where('prod.entity_id IS NOT NULL');
@@ -41,7 +41,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Inventory_Grid extends Mage_Adminh
41
  protected function _prepareColumns()
42
  {
43
  $this->addColumn('lb_vendor_name', array(
44
- 'header' => Mage::helper('logicbroker')->__('Supplier'),
45
  'align' =>'right',
46
  'width' => '50px',
47
  'filter_index' => 'lbRanking.lb_vendor_name',
@@ -49,27 +49,27 @@ class Logicbroker_Dropship360_Block_Adminhtml_Inventory_Grid extends Mage_Adminh
49
  ));
50
 
51
  $this->addColumn('stock', array(
52
- 'header' => Mage::helper('logicbroker')->__('Supplier Inventory'),
53
  'index' => 'stock',
54
  'type' => 'number'
55
  ));
56
  $store = $this->_getStore();
57
  $this->addColumn('cost', array(
58
- 'header' => Mage::helper('logicbroker')->__('Cost'),
59
  'index' => 'cost',
60
  'type' => 'price',
61
  'currency_code' => $store->getBaseCurrency()->getCode(),
62
  ));
63
 
64
  $this->addColumn('product_name', array(
65
- 'header' => Mage::helper('logicbroker')->__('Product Name'),
66
  'align' =>'left',
67
  'width' => '80px',
68
  'index' => 'product_name',
69
  'filter_index'=>'cpev.value',
70
  ));
71
  $this->addColumn('product_sku', array(
72
- 'header' => Mage::helper('logicbroker')->__('Product Sku'),
73
  'align' =>'left',
74
  'width' => '80px',
75
  'index' => 'product_sku',
@@ -77,14 +77,14 @@ class Logicbroker_Dropship360_Block_Adminhtml_Inventory_Grid extends Mage_Adminh
77
  ));
78
 
79
  $this->addColumn('lb_vendor_sku', array(
80
- 'header' => Mage::helper('logicbroker')->__('Supplier Sku'),
81
  'align' =>'left',
82
  'width' => '80px',
83
  'index' => 'lb_vendor_sku',
84
  'renderer' => 'Logicbroker_Dropship360_Block_Adminhtml_Widget_Grid_Column_Skuaction'
85
  ));
86
  $this->addColumn('updated_at', array(
87
- 'header' => Mage::helper('logicbroker')->__('Last Sync'),
88
  'index' => 'updated_at',
89
  'width' => '80px',
90
  'default' => '--',
@@ -95,13 +95,13 @@ class Logicbroker_Dropship360_Block_Adminhtml_Inventory_Grid extends Mage_Adminh
95
  // below code added for Jira ticket 734
96
  $this->addColumn('action',
97
  array(
98
- 'header' => Mage::helper('logicbroker')->__('Action'),
99
  'width' => '100',
100
  'type' => 'action',
101
  'getter' => 'getMagentoProId',
102
  'actions' => array(
103
  array(
104
- 'caption' => Mage::helper('logicbroker')->__('Edit'),
105
  'url' => array('base'=> 'adminhtml/catalog_product/edit/back/edit/tab/product_info_tabs_vendor_tab'),
106
  'field' => 'id'
107
  )
@@ -111,8 +111,8 @@ class Logicbroker_Dropship360_Block_Adminhtml_Inventory_Grid extends Mage_Adminh
111
  'index' => 'stores',
112
  'is_system' => true,
113
  ));
114
- $this->addExportType('*/*/exportCsv', Mage::helper('logicbroker')->__('CSV'));
115
- $this->addExportType('*/*/exportXml', Mage::helper('logicbroker')->__('XML'));
116
 
117
  return parent::_prepareColumns();
118
  }
23
  {
24
  $entityTypeId = Mage::getModel ( 'eav/config' )->getEntityType ( 'catalog_product' )->getEntityTypeId ();
25
  $prodNameAttrId = Mage::getModel('eav/entity_attribute')->loadByCode($entityTypeId, 'name')->getAttributeId();
26
+ $collection = Mage::getModel('dropship360/inventory')->getCollection();
27
+ $collection->getSelect()->join(array('lbRanking'=>Mage::getSingleton('core/resource')->getTableName('dropship360/ranking')),'lbRanking.lb_vendor_code = main_table.lb_vendor_code', array('lb_vendor_name'));
28
  $collection->getSelect()->joinLeft(array('prod' => Mage::getSingleton('core/resource')->getTableName('catalog/product')),'prod.sku = main_table.product_sku',array('magento_pro_id'=>'entity_id'));
29
  $collection->getSelect()->joinLeft(array('cpev' => Mage::getSingleton('core/resource')->getTableName('catalog/product').'_varchar'),'cpev.entity_id=prod.entity_id AND cpev.attribute_id='.$prodNameAttrId.'',array('product_name' => 'value'));
30
  $collection->getSelect()->where('prod.entity_id IS NOT NULL');
41
  protected function _prepareColumns()
42
  {
43
  $this->addColumn('lb_vendor_name', array(
44
+ 'header' => Mage::helper('dropship360')->__('Supplier'),
45
  'align' =>'right',
46
  'width' => '50px',
47
  'filter_index' => 'lbRanking.lb_vendor_name',
49
  ));
50
 
51
  $this->addColumn('stock', array(
52
+ 'header' => Mage::helper('dropship360')->__('Supplier Inventory'),
53
  'index' => 'stock',
54
  'type' => 'number'
55
  ));
56
  $store = $this->_getStore();
57
  $this->addColumn('cost', array(
58
+ 'header' => Mage::helper('dropship360')->__('Cost'),
59
  'index' => 'cost',
60
  'type' => 'price',
61
  'currency_code' => $store->getBaseCurrency()->getCode(),
62
  ));
63
 
64
  $this->addColumn('product_name', array(
65
+ 'header' => Mage::helper('dropship360')->__('Product Name'),
66
  'align' =>'left',
67
  'width' => '80px',
68
  'index' => 'product_name',
69
  'filter_index'=>'cpev.value',
70
  ));
71
  $this->addColumn('product_sku', array(
72
+ 'header' => Mage::helper('dropship360')->__('Product Sku'),
73
  'align' =>'left',
74
  'width' => '80px',
75
  'index' => 'product_sku',
77
  ));
78
 
79
  $this->addColumn('lb_vendor_sku', array(
80
+ 'header' => Mage::helper('dropship360')->__('Supplier Sku'),
81
  'align' =>'left',
82
  'width' => '80px',
83
  'index' => 'lb_vendor_sku',
84
  'renderer' => 'Logicbroker_Dropship360_Block_Adminhtml_Widget_Grid_Column_Skuaction'
85
  ));
86
  $this->addColumn('updated_at', array(
87
+ 'header' => Mage::helper('dropship360')->__('Last Sync'),
88
  'index' => 'updated_at',
89
  'width' => '80px',
90
  'default' => '--',
95
  // below code added for Jira ticket 734
96
  $this->addColumn('action',
97
  array(
98
+ 'header' => Mage::helper('dropship360')->__('Action'),
99
  'width' => '100',
100
  'type' => 'action',
101
  'getter' => 'getMagentoProId',
102
  'actions' => array(
103
  array(
104
+ 'caption' => Mage::helper('dropship360')->__('Edit'),
105
  'url' => array('base'=> 'adminhtml/catalog_product/edit/back/edit/tab/product_info_tabs_vendor_tab'),
106
  'field' => 'id'
107
  )
111
  'index' => 'stores',
112
  'is_system' => true,
113
  ));
114
+ $this->addExportType('*/*/exportCsv', Mage::helper('dropship360')->__('CSV'));
115
+ $this->addExportType('*/*/exportXml', Mage::helper('dropship360')->__('XML'));
116
 
117
  return parent::_prepareColumns();
118
  }
includes/src/Logicbroker_Dropship360_Block_Adminhtml_Logicbroker.php CHANGED
@@ -11,9 +11,9 @@ class Logicbroker_Dropship360_Block_Adminhtml_Logicbroker extends Mage_Adminhtml
11
  public function __construct()
12
  {
13
  $this->_controller = 'adminhtml_logicbroker';
14
- $this->_blockGroup = 'logicbroker';
15
- $this->_headerText = Mage::helper('logicbroker')->__('Supplier Manager');
16
- $this->_addButtonLabel = Mage::helper('logicbroker')->__('Add Supplier');
17
  parent::__construct();
18
  }
19
  }
11
  public function __construct()
12
  {
13
  $this->_controller = 'adminhtml_logicbroker';
14
+ $this->_blockGroup = 'dropship360';
15
+ $this->_headerText = Mage::helper('dropship360')->__('Supplier Manager');
16
+ $this->_addButtonLabel = Mage::helper('dropship360')->__('Add Supplier');
17
  parent::__construct();
18
  }
19
  }
includes/src/Logicbroker_Dropship360_Block_Adminhtml_Notification.php CHANGED
@@ -25,16 +25,17 @@ class Logicbroker_Dropship360_Block_Adminhtml_Notification extends Mage_Adminhtm
25
  $result = array();
26
  //soap Details
27
  $result['username'] = 'logicbroker';
28
- $apiResult = Mage::getModel('logicbroker/logicbroker')->createApiRoleAndUser(array('api_user_name'=>'logicbroker','email'=>'noreply@logicbroker.com'));
29
  $result['api_password'] = $apiResult['password'];
30
  $result['user_id'] = $apiResult['user_id'];
31
 
32
  //rest deatils
33
- $arrRest = Mage::getModel('logicbroker/api2_createroleandrule')->initiliazeRest();
 
34
  $result['consumer_key'] = $arrRest['consumer_key'];
35
  $result['consumer_secret'] = $arrRest['consumer_secret'];
36
  $result['token'] = $arrRest['token'];
37
- $result['secret'] =$arrRest['secret'];
38
  $coreConfigData = array(
39
 
40
  array(
@@ -43,7 +44,8 @@ class Logicbroker_Dropship360_Block_Adminhtml_Notification extends Mage_Adminhtm
43
  'path' => 'logicbroker_integration/integration/soapuser',
44
  'value' => $result['username'],
45
 
46
- ),
 
47
 
48
  array(
49
  'scope' => 'default',
@@ -51,7 +53,8 @@ class Logicbroker_Dropship360_Block_Adminhtml_Notification extends Mage_Adminhtm
51
  'path' => 'logicbroker_integration/integration/cunsumer_key',
52
  'value' => $result['consumer_key'],
53
 
54
- ),
 
55
  array(
56
  'scope' => 'default',
57
  'scope_id' => '0',
@@ -71,7 +74,8 @@ class Logicbroker_Dropship360_Block_Adminhtml_Notification extends Mage_Adminhtm
71
  'path' => 'logicbroker_integration/integration/access_secret',
72
  'value' => $result['secret'],
73
 
74
- ));
 
75
 
76
  foreach ($coreConfigData as $data) {
77
  $this->setConfigValue($data);
25
  $result = array();
26
  //soap Details
27
  $result['username'] = 'logicbroker';
28
+ $apiResult = Mage::getModel('dropship360/logicbroker')->createApiRoleAndUser(array('api_user_name'=>'logicbroker','email'=>'noreply@logicbroker.com'));
29
  $result['api_password'] = $apiResult['password'];
30
  $result['user_id'] = $apiResult['user_id'];
31
 
32
  //rest deatils
33
+ //code comment as Rest may be a part of future release refer lbn-1351
34
+ /* $arrRest = Mage::getModel('dropship360/api2_createroleandrule')->initiliazeRest();
35
  $result['consumer_key'] = $arrRest['consumer_key'];
36
  $result['consumer_secret'] = $arrRest['consumer_secret'];
37
  $result['token'] = $arrRest['token'];
38
+ $result['secret'] =$arrRest['secret']; */
39
  $coreConfigData = array(
40
 
41
  array(
44
  'path' => 'logicbroker_integration/integration/soapuser',
45
  'value' => $result['username'],
46
 
47
+ )
48
+ /*,
49
 
50
  array(
51
  'scope' => 'default',
53
  'path' => 'logicbroker_integration/integration/cunsumer_key',
54
  'value' => $result['consumer_key'],
55
 
56
+ )
57
+ ,
58
  array(
59
  'scope' => 'default',
60
  'scope_id' => '0',
74
  'path' => 'logicbroker_integration/integration/access_secret',
75
  'value' => $result['secret'],
76
 
77
+ ) */
78
+ );
79
 
80
  foreach ($coreConfigData as $data) {
81
  $this->setConfigValue($data);
includes/src/Logicbroker_Dropship360_Block_Adminhtml_Ranking.php CHANGED
@@ -11,9 +11,9 @@ class Logicbroker_Dropship360_Block_Adminhtml_Ranking extends Mage_Adminhtml_Blo
11
  public function __construct()
12
  {
13
  $this->_controller = 'adminhtml_ranking';
14
- $this->_blockGroup = 'logicbroker';
15
- $this->_headerText = Mage::helper('logicbroker')->__('Supplier Management');
16
- $this->_addButtonLabel = Mage::helper('logicbroker')->__('Add Supplier Ranking');
17
 
18
 
19
  $this->addButton('show_history',array(
@@ -42,7 +42,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Ranking extends Mage_Adminhtml_Blo
42
  public function getVendorCollection($type = 'no'){
43
 
44
  $arrVendor = array();
45
- $tempReslt = Mage::getModel('logicbroker/ranking')->getVendorCollection($type);
46
  $result['gridData'] = Mage::helper('core')->jsonEncode($tempReslt);
47
  if(!empty($tempReslt)){
48
  foreach($tempReslt as $value){
@@ -52,5 +52,11 @@ class Logicbroker_Dropship360_Block_Adminhtml_Ranking extends Mage_Adminhtml_Blo
52
  $result['arrayData'] = Mage::helper('core')->jsonEncode($arrVendor);
53
  return $result;
54
  }
 
 
 
 
 
 
55
 
56
  }
11
  public function __construct()
12
  {
13
  $this->_controller = 'adminhtml_ranking';
14
+ $this->_blockGroup = 'dropship360';
15
+ $this->_headerText = Mage::helper('dropship360')->__('Supplier Management');
16
+ $this->_addButtonLabel = Mage::helper('dropship360')->__('Add Supplier Ranking');
17
 
18
 
19
  $this->addButton('show_history',array(
42
  public function getVendorCollection($type = 'no'){
43
 
44
  $arrVendor = array();
45
+ $tempReslt = Mage::getModel('dropship360/ranking')->getVendorCollection($type);
46
  $result['gridData'] = Mage::helper('core')->jsonEncode($tempReslt);
47
  if(!empty($tempReslt)){
48
  foreach($tempReslt as $value){
52
  $result['arrayData'] = Mage::helper('core')->jsonEncode($arrVendor);
53
  return $result;
54
  }
55
+ public function getAttributeCode()
56
+ {
57
+ $helper = Mage::helper('dropship360');
58
+ $attributeCode = array(array('link'=>'','name'=>$helper::LOGICBROKER_PRODUCT_LINK_NONE),array('link'=>$helper::LOGICBROKER_PRODUCT_LINK_CODE_UPC,'name'=>$helper::LOGICBROKER_PRODUCT_LINK_UPC),array('link'=>$helper::LOGICBROKER_PRODUCT_LINK_CODE_MNP,'name'=>$helper::LOGICBROKER_PRODUCT_LINK_MNP),array('link'=>$helper::LOGICBROKER_PRODUCT_LINK_CODE_SKU,'name'=>$helper::LOGICBROKER_PRODUCT_LINK_SKU));
59
+ return Mage::helper('core')->jsonEncode($attributeCode);
60
+ }
61
 
62
  }
includes/src/Logicbroker_Dropship360_Block_Adminhtml_Ranking_Grid.php CHANGED
@@ -21,7 +21,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Ranking_Grid extends Mage_Adminhtm
21
 
22
  protected function _prepareCollection()
23
  {
24
- $collection = Mage::getModel('logicbroker/ranking')->getCollection();
25
  $this->setCollection($collection);
26
  return parent::_prepareCollection();
27
  }
@@ -30,13 +30,13 @@ class Logicbroker_Dropship360_Block_Adminhtml_Ranking_Grid extends Mage_Adminhtm
30
  {
31
 
32
  $this->addColumn('lb_vendor_code', array(
33
- 'header' => Mage::helper('logicbroker')->__('Supplier Code'),
34
  'align' =>'right',
35
  'width' => '50px',
36
  'index' => 'lb_vendor_code',
37
  ));
38
  $this->addColumn('ranking', array(
39
- 'header' => Mage::helper('logicbroker')->__('Position'),
40
  'align' =>'right',
41
  'width' => '50px',
42
  'type' => 'input',
@@ -45,18 +45,18 @@ class Logicbroker_Dropship360_Block_Adminhtml_Ranking_Grid extends Mage_Adminhtm
45
  ));
46
  $this->addColumn('action',
47
  array(
48
- 'header' => Mage::helper('logicbroker')->__('Action'),
49
  'width' => '100',
50
  'type' => 'textaction',
51
  'getter' => 'getId',
52
  'actions' => array(
53
  array(
54
- 'caption' => Mage::helper('logicbroker')->__('edit'),
55
  'url' => array('base'=> '*/*/edit'),
56
  'field' => 'id'
57
  ),
58
  array(
59
- 'caption' => Mage::helper('logicbroker')->__('delete'),
60
  'url' => array('base'=> '*/*/delete'),
61
  'field' => 'id',
62
  'confirm' =>'Are you sure to delete the Supplier?'
21
 
22
  protected function _prepareCollection()
23
  {
24
+ $collection = Mage::getModel('dropship360/ranking')->getCollection();
25
  $this->setCollection($collection);
26
  return parent::_prepareCollection();
27
  }
30
  {
31
 
32
  $this->addColumn('lb_vendor_code', array(
33
+ 'header' => Mage::helper('dropship360')->__('Supplier Code'),
34
  'align' =>'right',
35
  'width' => '50px',
36
  'index' => 'lb_vendor_code',
37
  ));
38
  $this->addColumn('ranking', array(
39
+ 'header' => Mage::helper('dropship360')->__('Position'),
40
  'align' =>'right',
41
  'width' => '50px',
42
  'type' => 'input',
45
  ));
46
  $this->addColumn('action',
47
  array(
48
+ 'header' => Mage::helper('dropship360')->__('Action'),
49
  'width' => '100',
50
  'type' => 'textaction',
51
  'getter' => 'getId',
52
  'actions' => array(
53
  array(
54
+ 'caption' => Mage::helper('dropship360')->__('edit'),
55
  'url' => array('base'=> '*/*/edit'),
56
  'field' => 'id'
57
  ),
58
  array(
59
+ 'caption' => Mage::helper('dropship360')->__('delete'),
60
  'url' => array('base'=> '*/*/delete'),
61
  'field' => 'id',
62
  'confirm' =>'Are you sure to delete the Supplier?'
includes/src/Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor.php CHANGED
@@ -40,7 +40,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor extends Ma
40
  public function __construct()
41
  {
42
  $this->_controller = 'adminhtml_reports_activitymonitor';
43
- $this->_blockGroup = 'logicbroker';
44
  $this->_headerText = Mage::helper('reports')->__('Business Activity Monitoring');
45
  parent::__construct();
46
  $this->_removeButton('add');
@@ -71,7 +71,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor extends Ma
71
 
72
  public function getHtmlElementName()
73
  {
74
- return array('input_monitor_order','input_open_monitor');
75
  }
76
 
77
  public function getGraphData(){
@@ -98,9 +98,9 @@ class Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor extends Ma
98
  if($this->getRequest()->getParam('filter'))
99
  $reportData = Mage::helper('adminhtml')->prepareFilterString($this->getRequest()->getParam('filter'));
100
  else
101
- $reportData = Mage::getModel('logicbroker/report')->getActivityReportData();
102
 
103
  $reportData['notificationPer'] = $redper;
104
- Mage::getModel('logicbroker/report')->saveActivityData($reportData);
105
  }
106
  }
40
  public function __construct()
41
  {
42
  $this->_controller = 'adminhtml_reports_activitymonitor';
43
+ $this->_blockGroup = 'dropship360';
44
  $this->_headerText = Mage::helper('reports')->__('Business Activity Monitoring');
45
  parent::__construct();
46
  $this->_removeButton('add');
71
 
72
  public function getHtmlElementName()
73
  {
74
+ return array('input_monitor_order','input_open_monitor','input_transmitting_filter','input_sentosup_filter');
75
  }
76
 
77
  public function getGraphData(){
98
  if($this->getRequest()->getParam('filter'))
99
  $reportData = Mage::helper('adminhtml')->prepareFilterString($this->getRequest()->getParam('filter'));
100
  else
101
+ $reportData = Mage::getModel('dropship360/report')->getActivityReportData();
102
 
103
  $reportData['notificationPer'] = $redper;
104
+ Mage::getModel('dropship360/report')->saveActivityData($reportData);
105
  }
106
  }
includes/src/Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor_Email.php CHANGED
@@ -60,21 +60,21 @@ class Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor_Email exte
60
  'use_index' => true,
61
  ));
62
  $this->addColumn('role_name', array(
63
- 'header' => Mage::helper('logicbroker')->__('Role'),
64
  'align' => 'right',
65
  'width' => '50px',
66
  'index' => 'role_name',
67
  ));
68
 
69
  $this->addColumn('firstname', array(
70
- 'header' => Mage::helper('logicbroker')->__('Name'),
71
  'align' => 'right',
72
  'width' => '50px',
73
  'index' => 'firstname',
74
  ));
75
 
76
  $this->addColumn('email', array(
77
- 'header' => Mage::helper('logicbroker')->__('Email Address'),
78
  'align' => 'right',
79
  'width' => '50px',
80
  'index' => 'email',
60
  'use_index' => true,
61
  ));
62
  $this->addColumn('role_name', array(
63
+ 'header' => Mage::helper('dropship360')->__('Role'),
64
  'align' => 'right',
65
  'width' => '50px',
66
  'index' => 'role_name',
67
  ));
68
 
69
  $this->addColumn('firstname', array(
70
+ 'header' => Mage::helper('dropship360')->__('Name'),
71
  'align' => 'right',
72
  'width' => '50px',
73
  'index' => 'firstname',
74
  ));
75
 
76
  $this->addColumn('email', array(
77
+ 'header' => Mage::helper('dropship360')->__('Email Address'),
78
  'align' => 'right',
79
  'width' => '50px',
80
  'index' => 'email',
includes/src/Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor_Form.php CHANGED
@@ -49,19 +49,47 @@ class Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor_Form exten
49
 
50
  $htmlIdPrefix = 'sales_report_';
51
  $form->setHtmlIdPrefix($htmlIdPrefix);
 
52
  $fieldset = $form->addFieldset('base_fieldset', array('legend'=>Mage::helper('reports')->__('Filter')));
53
  $this->_addElementTypes($fieldset);
 
54
  $fieldset->addField('store_ids', 'hidden', array(
55
  'name' => 'store_ids'
56
  ));
57
 
58
  Mage::getSingleton('adminhtml/session')->getFormData();
59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  $fieldset->addField('notification_transmitting', 'text', array(
61
  'name' => 'notification_transmitting',
62
- 'label' => Mage::helper('logicbroker')->__('Percentage to Trigger Notification For Transmitting (%)'),
63
  'required' => true,
64
- 'title' => Mage::helper('logicbroker')->__('Percentage to Trigger Notification For Transmitting'),
65
  'value' => isset($formData['notification_transmitting']) ? $formData['notification_transmitting'] : '',
66
  'class' => ' validate-digits validate-number-range number-range-1-99'
67
 
@@ -69,18 +97,18 @@ class Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor_Form exten
69
 
70
  $fieldset->addField('notification_backorder', 'text', array(
71
  'name' => 'notification_backorder',
72
- 'label' => Mage::helper('logicbroker')->__('Percentage to Trigger Notification For Backorder(%)'),
73
  'required' => true,
74
- 'title' => Mage::helper('logicbroker')->__('Percentage to Trigger Notification For Backorder'),
75
  'value' => isset($formData['notification_backorder']) ? $formData['notification_backorder'] : '',
76
  'class' => ' validate-digits validate-number-range number-range-1-99'
77
 
78
  ));
79
  $fieldset->addField('notification_sent_to_supplier', 'text', array(
80
  'name' => 'notification_sent_to_supplier',
81
- 'label' => Mage::helper('logicbroker')->__('Percentage to Trigger Notification For Sent To Supplier (%)'),
82
  'required' => true,
83
- 'title' => Mage::helper('logicbroker')->__('Percentage to Trigger Notification For Sent To Supplier'),
84
  'value' => isset($formData['notification_sent_to_supplier']) ? $formData['notification_sent_to_supplier'] : '',
85
  'class' => ' validate-digits validate-number-range number-range-1-99'
86
 
@@ -97,8 +125,8 @@ class Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor_Form exten
97
  ));
98
  $fieldset->addField('email_adress', 'text', array(
99
  'name' => 'email',
100
- 'label' => Mage::helper('logicbroker')->__('Email Address'),
101
- 'title' => Mage::helper('logicbroker')->__('Email Address'),
102
  'required'=> true,
103
  'value' => isset($formData['email']) ? $formData['email'] : '',
104
  'class' => 'email-adress'
@@ -115,8 +143,8 @@ class Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor_Form exten
115
  $fieldset->addField('dropshipstatus', 'select', array(
116
  'name' => 'dropshipstatus',
117
  'options' => $this->prepareOptionValue(),
118
- 'label' => Mage::helper('logicbroker')->__('Dropship Status'),
119
- 'title' => Mage::helper('logicbroker')->__('Dropship Status'),
120
  'value' => isset($formData['dropshipstatus']) ? $formData['dropshipstatus'] : '',
121
  'required'=> true
122
 
@@ -125,12 +153,12 @@ class Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor_Form exten
125
  $fieldset->addField('select_monitor_order', 'timestatus', array(
126
  'name' => 'select_monitor_order',
127
  'options' => array(
128
- 'day' => Mage::helper('logicbroker')->__('Days'),
129
- 'hour' => Mage::helper('logicbroker')->__('Hours')
130
 
131
  ),
132
- 'label' => Mage::helper('logicbroker')->__('Period to Monitor All Orders'),
133
- 'title' => Mage::helper('logicbroker')->__('Period to Monitor All Orders'),
134
  'inputname' => 'input_monitor_order',
135
  'selectvalue' => isset($formData['select_monitor_order']) ? $formData['select_monitor_order'] : '',
136
  'inputvalue' => isset($formData['input_monitor_order']) ? $formData['input_monitor_order'] : '',
@@ -140,12 +168,12 @@ class Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor_Form exten
140
  $fieldset->addField('select_open_monitor', 'timestatus', array(
141
  'name' => 'select_open_monitor',
142
  'options' => array(
143
- 'day' => Mage::helper('logicbroker')->__('Days'),
144
- 'hour' => Mage::helper('logicbroker')->__('Hours')
145
 
146
  ),
147
- 'label' => Mage::helper('logicbroker')->__('Period Open to Monitor'),
148
- 'title' => Mage::helper('logicbroker')->__('Period Open to Monitor'),
149
  'inputname' => 'input_open_monitor',
150
  'selectvalue' => isset($formData['select_open_monitor']) ? $formData['select_open_monitor'] : '' ,
151
  'inputvalue' => isset($formData['input_open_monitor']) ? $formData['input_open_monitor'] : '',
@@ -161,13 +189,13 @@ class Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor_Form exten
161
 
162
  protected function prepareOptionValue(){
163
 
164
- $itemStatus = Mage::helper('logicbroker')->getItemStatuses();
165
  $options = array();
166
- $options[' '] = Mage::helper('logicbroker')->__('--Please Select--');
167
  foreach($itemStatus as $status )
168
  {
169
  if(in_array($status,array('Transmitting','Backorder','Sent to Supplier')))
170
- $options[$status] = Mage::helper('logicbroker')->__($status);
171
  }
172
  return $options;
173
  }
@@ -176,8 +204,8 @@ class Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor_Form exten
176
  protected function _getAdditionalElementTypes()
177
  {
178
  return array(
179
- 'timestatus' => Mage::getConfig()->getBlockClassName('logicbroker/adminhtml_reports_form_timestatus'),
180
- 'getemailaddress' => Mage::getConfig()->getBlockClassName('logicbroker/adminhtml_upload_edit_button')
181
  );
182
  }
183
 
49
 
50
  $htmlIdPrefix = 'sales_report_';
51
  $form->setHtmlIdPrefix($htmlIdPrefix);
52
+ $fieldsetfilter = $form->addFieldset('base_fieldset_filter', array('legend'=>Mage::helper('reports')->__('Filter')));
53
  $fieldset = $form->addFieldset('base_fieldset', array('legend'=>Mage::helper('reports')->__('Filter')));
54
  $this->_addElementTypes($fieldset);
55
+ $this->_addElementTypes($fieldsetfilter);
56
  $fieldset->addField('store_ids', 'hidden', array(
57
  'name' => 'store_ids'
58
  ));
59
 
60
  Mage::getSingleton('adminhtml/session')->getFormData();
61
 
62
+ $fieldsetfilter->addField('select_transmitting_filter', 'timestatus', array(
63
+ 'name' => 'select_transmitting_filter',
64
+ 'options' => array(
65
+ 'day' => Mage::helper('dropship360')->__('Days'),
66
+ 'hour' => Mage::helper('dropship360')->__('Hours')
67
+ ),
68
+ 'label' => Mage::helper('dropship360')->__('Time in Transmitting Status'),
69
+ 'title' => Mage::helper('dropship360')->__('Time in Transmitting Status'),
70
+ 'inputname' => 'input_transmitting_filter',
71
+ 'selectvalue' => isset($formData['select_transmitting_filter']) ? $formData['select_transmitting_filter'] : '' ,
72
+ 'inputvalue' => isset($formData['input_transmitting_filter']) ? $formData['input_transmitting_filter'] : '',
73
+ ));
74
+
75
+ $fieldsetfilter->addField('select_sentosup_filter', 'timestatus', array(
76
+ 'name' => 'select_sentosup_filter',
77
+ 'options' => array(
78
+ 'day' => Mage::helper('dropship360')->__('Days'),
79
+ 'hour' => Mage::helper('dropship360')->__('Hours')
80
+
81
+ ),
82
+ 'label' => Mage::helper('dropship360')->__('Time in Sent to Supplier Status'),
83
+ 'title' => Mage::helper('dropship360')->__('Time in Sent to Supplier Status'),
84
+ 'inputname' => 'input_sentosup_filter',
85
+ 'selectvalue' => isset($formData['select_sentosup_filter']) ? $formData['select_sentosup_filter'] : '' ,
86
+ 'inputvalue' => isset($formData['input_sentosup_filter']) ? $formData['input_sentosup_filter'] : '',
87
+ ));
88
  $fieldset->addField('notification_transmitting', 'text', array(
89
  'name' => 'notification_transmitting',
90
+ 'label' => Mage::helper('dropship360')->__('Percentage to Trigger Notification For Transmitting (%)'),
91
  'required' => true,
92
+ 'title' => Mage::helper('dropship360')->__('Percentage to Trigger Notification For Transmitting'),
93
  'value' => isset($formData['notification_transmitting']) ? $formData['notification_transmitting'] : '',
94
  'class' => ' validate-digits validate-number-range number-range-1-99'
95
 
97
 
98
  $fieldset->addField('notification_backorder', 'text', array(
99
  'name' => 'notification_backorder',
100
+ 'label' => Mage::helper('dropship360')->__('Percentage to Trigger Notification For Backorder(%)'),
101
  'required' => true,
102
+ 'title' => Mage::helper('dropship360')->__('Percentage to Trigger Notification For Backorder'),
103
  'value' => isset($formData['notification_backorder']) ? $formData['notification_backorder'] : '',
104
  'class' => ' validate-digits validate-number-range number-range-1-99'
105
 
106
  ));
107
  $fieldset->addField('notification_sent_to_supplier', 'text', array(
108
  'name' => 'notification_sent_to_supplier',
109
+ 'label' => Mage::helper('dropship360')->__('Percentage to Trigger Notification For Sent To Supplier (%)'),
110
  'required' => true,
111
+ 'title' => Mage::helper('dropship360')->__('Percentage to Trigger Notification For Sent To Supplier'),
112
  'value' => isset($formData['notification_sent_to_supplier']) ? $formData['notification_sent_to_supplier'] : '',
113
  'class' => ' validate-digits validate-number-range number-range-1-99'
114
 
125
  ));
126
  $fieldset->addField('email_adress', 'text', array(
127
  'name' => 'email',
128
+ 'label' => Mage::helper('dropship360')->__('Email Address'),
129
+ 'title' => Mage::helper('dropship360')->__('Email Address'),
130
  'required'=> true,
131
  'value' => isset($formData['email']) ? $formData['email'] : '',
132
  'class' => 'email-adress'
143
  $fieldset->addField('dropshipstatus', 'select', array(
144
  'name' => 'dropshipstatus',
145
  'options' => $this->prepareOptionValue(),
146
+ 'label' => Mage::helper('dropship360')->__('Dropship Status'),
147
+ 'title' => Mage::helper('dropship360')->__('Dropship Status'),
148
  'value' => isset($formData['dropshipstatus']) ? $formData['dropshipstatus'] : '',
149
  'required'=> true
150
 
153
  $fieldset->addField('select_monitor_order', 'timestatus', array(
154
  'name' => 'select_monitor_order',
155
  'options' => array(
156
+ 'day' => Mage::helper('dropship360')->__('Days'),
157
+ 'hour' => Mage::helper('dropship360')->__('Hours')
158
 
159
  ),
160
+ 'label' => Mage::helper('dropship360')->__('Period to Monitor All Orders'),
161
+ 'title' => Mage::helper('dropship360')->__('Period to Monitor All Orders'),
162
  'inputname' => 'input_monitor_order',
163
  'selectvalue' => isset($formData['select_monitor_order']) ? $formData['select_monitor_order'] : '',
164
  'inputvalue' => isset($formData['input_monitor_order']) ? $formData['input_monitor_order'] : '',
168
  $fieldset->addField('select_open_monitor', 'timestatus', array(
169
  'name' => 'select_open_monitor',
170
  'options' => array(
171
+ 'day' => Mage::helper('dropship360')->__('Days'),
172
+ 'hour' => Mage::helper('dropship360')->__('Hours')
173
 
174
  ),
175
+ 'label' => Mage::helper('dropship360')->__('Period Open to Monitor'),
176
+ 'title' => Mage::helper('dropship360')->__('Period Open to Monitor'),
177
  'inputname' => 'input_open_monitor',
178
  'selectvalue' => isset($formData['select_open_monitor']) ? $formData['select_open_monitor'] : '' ,
179
  'inputvalue' => isset($formData['input_open_monitor']) ? $formData['input_open_monitor'] : '',
189
 
190
  protected function prepareOptionValue(){
191
 
192
+ $itemStatus = Mage::helper('dropship360')->getItemStatuses();
193
  $options = array();
194
+ $options[' '] = Mage::helper('dropship360')->__('--Please Select--');
195
  foreach($itemStatus as $status )
196
  {
197
  if(in_array($status,array('Transmitting','Backorder','Sent to Supplier')))
198
+ $options[$status] = Mage::helper('dropship360')->__($status);
199
  }
200
  return $options;
201
  }
204
  protected function _getAdditionalElementTypes()
205
  {
206
  return array(
207
+ 'timestatus' => Mage::getConfig()->getBlockClassName('dropship360/adminhtml_reports_form_timestatus'),
208
+ 'getemailaddress' => Mage::getConfig()->getBlockClassName('dropship360/adminhtml_upload_edit_button')
209
  );
210
  }
211
 
includes/src/Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor_Grid.php CHANGED
@@ -60,16 +60,16 @@ protected function _prepareCollection()
60
  protected function _prepareColumns()
61
  {
62
  $this->addColumn('period', array(
63
- 'header' => Mage::helper('logicbroker')->__('Period Open'),
64
  'align' =>'right',
65
  'width' => 50,
66
  'index' => 'period',
67
  'sortable' => false,
68
  'filter' => false,
69
- 'renderer' => 'logicbroker/adminhtml_reports_activitymonitor_periodopen',
70
  ));
71
  $this->addColumn('increment_id', array(
72
- 'header' => Mage::helper('logicbroker')->__('Order#'),
73
  'align' =>'right',
74
  'width' => 50,
75
  'index' => 'increment_id',
@@ -77,7 +77,7 @@ protected function _prepareCollection()
77
  'filter' => false
78
  ));
79
  $this->addColumn('lb_vendor_name', array(
80
- 'header' => Mage::helper('logicbroker')->__('Supplier'),
81
  'align' =>'right',
82
  'width' => 50,
83
  'index' => 'lb_vendor_name',
@@ -86,7 +86,7 @@ protected function _prepareCollection()
86
  ));
87
 
88
  $this->addColumn('vendor_cost', array(
89
- 'header' => Mage::helper('logicbroker')->__('Cost'),
90
  'align' =>'right',
91
  'width' => 50,
92
  'index' => 'vendor_cost',
@@ -94,7 +94,7 @@ protected function _prepareCollection()
94
  'filter' => false
95
  ));
96
  $this->addColumn('product_name', array(
97
- 'header' => Mage::helper('logicbroker')->__('Product Name'),
98
  'align' =>'left',
99
  'width' => 50,
100
  'index' => 'product_name',
@@ -103,7 +103,7 @@ protected function _prepareCollection()
103
  ));
104
 
105
  $this->addColumn('sku', array(
106
- 'header' => Mage::helper('logicbroker')->__('Product Sku'),
107
  'align' =>'left',
108
  'width' => 50,
109
  'index' => 'sku',
@@ -113,7 +113,7 @@ protected function _prepareCollection()
113
  ));
114
 
115
  $this->addColumn('lb_vendor_sku', array(
116
- 'header' => Mage::helper('logicbroker')->__('Supplier Sku'),
117
  'align' =>'left',
118
  'width' => 50,
119
  'index' => 'lb_vendor_sku',
@@ -123,7 +123,7 @@ protected function _prepareCollection()
123
  ));
124
 
125
  $this->addColumn('updated_at', array(
126
- 'header' => Mage::helper('logicbroker')->__('Last Update'),
127
  'align' =>'left',
128
  'width' => 50,
129
  'index' => 'updated_at',
@@ -133,7 +133,7 @@ protected function _prepareCollection()
133
  ));
134
 
135
  $this->addColumn('created_at', array(
136
- 'header' => Mage::helper('logicbroker')->__('Order Date'),
137
  'align' =>'left',
138
  'width' => 80,
139
  'index' => 'created_at',
@@ -143,7 +143,7 @@ protected function _prepareCollection()
143
  ));
144
 
145
  $this->addColumn('lb_item_status', array(
146
- 'header' => Mage::helper('logicbroker')->__('Item Status'),
147
  'align' =>'left',
148
  'width' => 50,
149
  'index' => 'lb_item_status',
60
  protected function _prepareColumns()
61
  {
62
  $this->addColumn('period', array(
63
+ 'header' => Mage::helper('dropship360')->__('Period Open'),
64
  'align' =>'right',
65
  'width' => 50,
66
  'index' => 'period',
67
  'sortable' => false,
68
  'filter' => false,
69
+ 'renderer' => 'dropship360/adminhtml_reports_activitymonitor_periodopen',
70
  ));
71
  $this->addColumn('increment_id', array(
72
+ 'header' => Mage::helper('dropship360')->__('Order#'),
73
  'align' =>'right',
74
  'width' => 50,
75
  'index' => 'increment_id',
77
  'filter' => false
78
  ));
79
  $this->addColumn('lb_vendor_name', array(
80
+ 'header' => Mage::helper('dropship360')->__('Supplier'),
81
  'align' =>'right',
82
  'width' => 50,
83
  'index' => 'lb_vendor_name',
86
  ));
87
 
88
  $this->addColumn('vendor_cost', array(
89
+ 'header' => Mage::helper('dropship360')->__('Cost'),
90
  'align' =>'right',
91
  'width' => 50,
92
  'index' => 'vendor_cost',
94
  'filter' => false
95
  ));
96
  $this->addColumn('product_name', array(
97
+ 'header' => Mage::helper('dropship360')->__('Product Name'),
98
  'align' =>'left',
99
  'width' => 50,
100
  'index' => 'product_name',
103
  ));
104
 
105
  $this->addColumn('sku', array(
106
+ 'header' => Mage::helper('dropship360')->__('Product Sku'),
107
  'align' =>'left',
108
  'width' => 50,
109
  'index' => 'sku',
113
  ));
114
 
115
  $this->addColumn('lb_vendor_sku', array(
116
+ 'header' => Mage::helper('dropship360')->__('Supplier Sku'),
117
  'align' =>'left',
118
  'width' => 50,
119
  'index' => 'lb_vendor_sku',
123
  ));
124
 
125
  $this->addColumn('updated_at', array(
126
+ 'header' => Mage::helper('dropship360')->__('Last Update'),
127
  'align' =>'left',
128
  'width' => 50,
129
  'index' => 'updated_at',
133
  ));
134
 
135
  $this->addColumn('created_at', array(
136
+ 'header' => Mage::helper('dropship360')->__('Order Date'),
137
  'align' =>'left',
138
  'width' => 80,
139
  'index' => 'created_at',
143
  ));
144
 
145
  $this->addColumn('lb_item_status', array(
146
+ 'header' => Mage::helper('dropship360')->__('Item Status'),
147
  'align' =>'left',
148
  'width' => 50,
149
  'index' => 'lb_item_status',
includes/src/Logicbroker_Dropship360_Block_Adminhtml_Reports_Form_Timestatus.php CHANGED
@@ -16,8 +16,9 @@ class Logicbroker_Dropship360_Block_Adminhtml_Reports_Form_Timestatus extends Va
16
  $selectOption = $this->getOptions();
17
  $inputname = trim($this->getInputname());
18
  $selectValue = ($this->getSelectvalue()) ? $this->getSelectvalue() : '';
19
- $inputValue = ($this->getInputvalue()) ? $this->getInputvalue() : 0;
20
  $display = ($inputValue) ? 'display:block;' : 'display:none;';
 
21
 
22
  foreach($selectOption as $value=>$label){
23
  $isSelect = ($value == $selectValue) ? 'selected="selected"' : '';
@@ -25,7 +26,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Reports_Form_Timestatus extends Va
25
  }
26
 
27
  $html = '<div style = "float: left;"><select name= "'.$this->getName().'" id="'.$this->getId().'" title="'.$this->getTitle().'" class="select '.$required.'" onchange = showinputbox("'.$inputname.'",this)>'.$options.'</select></div>';
28
- $html .= '<div id = "input_box_'.$inputname.'" style = "padding-left:15px;float: left;" class = "'.$inputname.'#'.$this->getName().'" ><input maxlength = "3" name="'.$inputname.'" id="'.$inputname.'" value="'.$inputValue.'" type="text" class=" required-entry validate-digits validate-number-range number-range-1-999 input-text" style="'.$display.'width:110px !important">';
29
  $html .= '<input name="'.$inputname.'_post" id="'.$inputname.'_post" type= "hidden" ></div>';
30
  return $html;
31
 
16
  $selectOption = $this->getOptions();
17
  $inputname = trim($this->getInputname());
18
  $selectValue = ($this->getSelectvalue()) ? $this->getSelectvalue() : '';
19
+ $inputValue = ($this->getInputvalue()) ? $this->getInputvalue() : '';
20
  $display = ($inputValue) ? 'display:block;' : 'display:none;';
21
+ $classInputbox = ($inputValue) ? 'required-entry validate-digits validate-number-range number-range-1-999' : '';
22
 
23
  foreach($selectOption as $value=>$label){
24
  $isSelect = ($value == $selectValue) ? 'selected="selected"' : '';
26
  }
27
 
28
  $html = '<div style = "float: left;"><select name= "'.$this->getName().'" id="'.$this->getId().'" title="'.$this->getTitle().'" class="select '.$required.'" onchange = showinputbox("'.$inputname.'",this)>'.$options.'</select></div>';
29
+ $html .= '<div id = "input_box_'.$inputname.'" style = "padding-left:15px;float: left;" class = "'.$inputname.'#'.$this->getName().'" ><input maxlength = "3" name="'.$inputname.'" id="'.$inputname.'" value="'.$inputValue.'" type="text" class="'.$classInputbox.' input-text" style="'.$display.'width:110px !important">';
30
  $html .= '<input name="'.$inputname.'_post" id="'.$inputname.'_post" type= "hidden" ></div>';
31
  return $html;
32
 
includes/src/Logicbroker_Dropship360_Block_Adminhtml_Reports_Staticemailgrid.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Adminhtml
23
+ * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Adminhtml sales report page content block
29
+ *
30
+ * @category Mage
31
+ * @package Mage_Adminhtml
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+
35
+ class Logicbroker_Dropship360_Block_Adminhtml_Reports_Staticemailgrid extends Mage_Core_Block_Template
36
+ {
37
+ public function getTemplateFile()
38
+ {
39
+ $params = array('_relative'=>true);
40
+ $area = $this->getArea();
41
+ $package = 'default';
42
+ if ($area) {
43
+ $params['_area'] = $area;
44
+ $params['_package'] = $package;
45
+ }
46
+ $templateName = Mage::getDesign()->getTemplateFilename($this->getTemplate(), $params);
47
+ return $templateName;
48
+ }
49
+
50
+ public function getPeriodToOpen($updatedat){
51
+
52
+ $currentDate = Mage::getModel('core/date')->date();
53
+ $lastUpdateDate = Mage::app()->getLocale()->date($updatedat, Varien_Date::DATETIME_INTERNAL_FORMAT);
54
+ $start_date = new DateTime($currentDate);
55
+ $since_start = $start_date->diff(new DateTime($lastUpdateDate));
56
+ return $since_start->d.' days '.$since_start->h.' hours '.$since_start->i.' minutes' ;
57
+ }
58
+ public function formatDate($date){
59
+ $format = Mage::app()->getLocale()->getDateTimeFormat(
60
+ Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM
61
+ );
62
+ $date = Mage::app()->getLocale()
63
+ ->date($date, Varien_Date::DATETIME_INTERNAL_FORMAT)->toString($format);
64
+ return $date;
65
+ }
66
+ }
includes/src/Logicbroker_Dropship360_Block_Adminhtml_Sales_Order_View_Items.php CHANGED
@@ -14,10 +14,10 @@ class Logicbroker_Dropship360_Block_Adminhtml_Sales_Order_View_Items extends Mag
14
  */
15
  public function getItemsCollection()
16
  {
17
- $id = $this->getRequest()->getParam('order_id');
18
  $collection = Mage::getResourceModel('sales/order_item_collection');
19
- $collection->getSelect()->joinLeft( array('lbs'=> Mage::getSingleton('core/resource')->getTableName('logicbroker/orderitems')), "main_table.item_id = lbs.item_id",array("lbs.lb_item_status", "lbs.lb_vendor_sku","lbs.lb_vendor_code"))->where("main_table.order_id =".$id);
20
- $collection->getSelect()->joinLeft( array('lbr'=> Mage::getSingleton('core/resource')->getTableName('logicbroker/ranking')), "lbs.lb_vendor_code = lbr.lb_vendor_code",array("lbr.lb_vendor_name"));
21
  return $collection;
22
  }
23
  }
14
  */
15
  public function getItemsCollection()
16
  {
17
+ $id = $this->getOrder()->getId();
18
  $collection = Mage::getResourceModel('sales/order_item_collection');
19
+ $collection->getSelect()->joinLeft( array('lbs'=> Mage::getSingleton('core/resource')->getTableName('dropship360/orderitems')), "main_table.item_id = lbs.item_id",array("lbs.lb_item_status", "lbs.lb_vendor_sku","lbs.lb_vendor_code"))->where("main_table.order_id =".$id);
20
+ $collection->getSelect()->joinLeft( array('lbr'=> Mage::getSingleton('core/resource')->getTableName('dropship360/ranking')), "lbs.lb_vendor_code = lbr.lb_vendor_code",array("lbr.lb_vendor_name"));
21
  return $collection;
22
  }
23
  }
includes/src/Logicbroker_Dropship360_Block_Adminhtml_Showhistory.php CHANGED
@@ -11,9 +11,9 @@ class Logicbroker_Dropship360_Block_Adminhtml_Showhistory extends Mage_Adminhtml
11
  public function __construct()
12
  {
13
  $this->_controller = 'adminhtml_ranking';
14
- $this->_blockGroup = 'logicbroker';
15
- $this->_headerText = Mage::helper('logicbroker')->__('Supplier Ranking Log');
16
- $this->__addBackButton = Mage::helper('logicbroker')->__('Back');
17
  $this->addButton('back',array(
18
  'label' => 'Back',
19
  'onclick' => 'setLocation(\'' . $this->getUrl('*/*/') .'\')',
@@ -26,7 +26,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Showhistory extends Mage_Adminhtml
26
  }
27
 
28
  public function getLogCollection(){
29
- $collection = Mage::getModel('logicbroker/rankinglog')->getCollection();
30
  $collection->getSelect()->order('created_at desc');
31
  $logtable = array();
32
  foreach($collection as $value){
11
  public function __construct()
12
  {
13
  $this->_controller = 'adminhtml_ranking';
14
+ $this->_blockGroup = 'dropship360';
15
+ $this->_headerText = Mage::helper('dropship360')->__('Supplier Ranking Log');
16
+ $this->__addBackButton = Mage::helper('dropship360')->__('Back');
17
  $this->addButton('back',array(
18
  'label' => 'Back',
19
  'onclick' => 'setLocation(\'' . $this->getUrl('*/*/') .'\')',
26
  }
27
 
28
  public function getLogCollection(){
29
+ $collection = Mage::getModel('dropship360/rankinglog')->getCollection();
30
  $collection->getSelect()->order('created_at desc');
31
  $logtable = array();
32
  foreach($collection as $value){
includes/src/Logicbroker_Dropship360_Block_Adminhtml_Sourcing.php CHANGED
@@ -11,17 +11,17 @@ class Logicbroker_Dropship360_Block_Adminhtml_Sourcing extends Mage_Adminhtml_Bl
11
  public function __construct()
12
  {
13
  $this->_controller = 'adminhtml_sourcing';
14
- $this->_blockGroup = 'logicbroker';
15
- $this->_headerText = Mage::helper('logicbroker')->__('PO Management');
16
- $this->_addButtonLabel = Mage::helper('logicbroker')->__('Add Supplier');
17
  parent::__construct();
18
  $this->removeButton('add');
19
  }
20
 
21
  public function getLbOrderItemsDetails($item){
22
 
23
- $lbItemCollection = Mage::getModel('logicbroker/orderitems')->getCollection()->addFieldTofilter('item_order_id',$item->getOrderId())->addFieldTofilter('sku',$item->getSku());
24
- $lbItemCollection->getSelect()->joinLeft( array('lbr'=> Mage::getSingleton('core/resource')->getTableName('logicbroker/ranking')), "main_table.lb_vendor_code = lbr.lb_vendor_code",array("lbr.lb_vendor_name"));
25
  return $lbItemCollection->getFirstItem ();
26
  }
27
  }
11
  public function __construct()
12
  {
13
  $this->_controller = 'adminhtml_sourcing';
14
+ $this->_blockGroup = 'dropship360';
15
+ $this->_headerText = Mage::helper('dropship360')->__('PO Management');
16
+ $this->_addButtonLabel = Mage::helper('dropship360')->__('Add Supplier');
17
  parent::__construct();
18
  $this->removeButton('add');
19
  }
20
 
21
  public function getLbOrderItemsDetails($item){
22
 
23
+ $lbItemCollection = Mage::getModel('dropship360/orderitems')->getCollection()->addFieldTofilter('item_order_id',$item->getOrderId())->addFieldTofilter('sku',$item->getSku());
24
+ $lbItemCollection->getSelect()->joinLeft( array('lbr'=> Mage::getSingleton('core/resource')->getTableName('dropship360/ranking')), "main_table.lb_vendor_code = lbr.lb_vendor_code",array("lbr.lb_vendor_name"));
25
  return $lbItemCollection->getFirstItem ();
26
  }
27
  }
includes/src/Logicbroker_Dropship360_Block_Adminhtml_Sourcing_Edit.php CHANGED
@@ -14,12 +14,12 @@ class Logicbroker_Dropship360_Block_Adminhtml_Sourcing_Edit extends Mage_Adminht
14
 
15
 
16
  $this->_objectId = 'lb_item_id';
17
- $this->_blockGroup = 'logicbroker';
18
  $this->_controller = 'adminhtml_sourcing';
19
  parent::__construct();
20
 
21
- $this->_updateButton('save', 'label', Mage::helper('logicbroker')->__('Save Sourcing'));
22
- $this->_updateButton('delete', 'label', Mage::helper('logicbroker')->__('Delete Supplier'));
23
 
24
  $this->_addButton('saveandcontinue', array(
25
  'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
@@ -58,9 +58,9 @@ class Logicbroker_Dropship360_Block_Adminhtml_Sourcing_Edit extends Mage_Adminht
58
  public function getHeaderText()
59
  {
60
  if( Mage::registry('sourcing_data') && Mage::registry('sourcing_data')->getLbItemId() ) {
61
- return Mage::helper('logicbroker')->__("Edit Item Sourcing Supplier", $this->htmlEscape(Mage::registry('sourcing_data')->getTitle()));
62
  } else {
63
- return Mage::helper('logicbroker')->__('Select Sourcing Supplier');
64
  }
65
  }
66
 
14
 
15
 
16
  $this->_objectId = 'lb_item_id';
17
+ $this->_blockGroup = 'dropship360';
18
  $this->_controller = 'adminhtml_sourcing';
19
  parent::__construct();
20
 
21
+ $this->_updateButton('save', 'label', Mage::helper('dropship360')->__('Save Sourcing'));
22
+ $this->_updateButton('delete', 'label', Mage::helper('dropship360')->__('Delete Supplier'));
23
 
24
  $this->_addButton('saveandcontinue', array(
25
  'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
58
  public function getHeaderText()
59
  {
60
  if( Mage::registry('sourcing_data') && Mage::registry('sourcing_data')->getLbItemId() ) {
61
+ return Mage::helper('dropship360')->__("Edit Item Sourcing Supplier", $this->htmlEscape(Mage::registry('sourcing_data')->getTitle()));
62
  } else {
63
+ return Mage::helper('dropship360')->__('Select Sourcing Supplier');
64
  }
65
  }
66
 
includes/src/Logicbroker_Dropship360_Block_Adminhtml_Sourcing_Edit_Tab_Form.php CHANGED
@@ -22,21 +22,21 @@ class Logicbroker_Dropship360_Block_Adminhtml_Sourcing_Edit_Tab_Form extends Mag
22
  $form = new Varien_Data_Form();
23
  $sku = Mage::registry('sourcing_data')->getData('sku');
24
  $this->setForm($form);
25
- $fieldset = $form->addFieldset('logicbroker_form', array('legend'=>Mage::helper('logicbroker')->__('Item Sourcing Information')));
26
 
27
  if(in_array(Mage::registry('sourcing_data')->getData('lb_item_status'),$this->_statusArray)){
28
  $fieldset->addField('lb_vendor_code', 'select', array(
29
- 'label' => Mage::helper('logicbroker')->__('Supplier'),
30
  'class' => 'required-entry validate-select',
31
  'required' => true,
32
  'name' => 'lb_vendor_code',
33
- 'values' => Mage::getModel('logicbroker/system_config_source_vendorlist')->vendorListSourcing(true,$sku),
34
  'default' => '',
35
  'note' => 'Select your Dropship Supplier to source this item and bypass the dropship360 sourcing rule.'
36
  ));
37
  }
38
  $fieldset->addField('lb_item_status', 'text', array(
39
- 'label' => Mage::helper('logicbroker')->__('Logicbroker Item Status'),
40
  'name' => 'lb_item_status',
41
  'note'=>'Read only filed',
42
  'readonly'=> true
@@ -44,7 +44,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Sourcing_Edit_Tab_Form extends Mag
44
 
45
 
46
  $fieldset->addField('sku', 'text', array(
47
- 'label' => Mage::helper('logicbroker')->__('Sku'),
48
  'name' => 'sku',
49
  'note'=>'Read only filed',
50
  'readonly'=> true
22
  $form = new Varien_Data_Form();
23
  $sku = Mage::registry('sourcing_data')->getData('sku');
24
  $this->setForm($form);
25
+ $fieldset = $form->addFieldset('logicbroker_form', array('legend'=>Mage::helper('dropship360')->__('Item Sourcing Information')));
26
 
27
  if(in_array(Mage::registry('sourcing_data')->getData('lb_item_status'),$this->_statusArray)){
28
  $fieldset->addField('lb_vendor_code', 'select', array(
29
+ 'label' => Mage::helper('dropship360')->__('Supplier'),
30
  'class' => 'required-entry validate-select',
31
  'required' => true,
32
  'name' => 'lb_vendor_code',
33
+ 'values' => Mage::getModel('dropship360/system_config_source_vendorlist')->vendorListSourcing(true,$sku),
34
  'default' => '',
35
  'note' => 'Select your Dropship Supplier to source this item and bypass the dropship360 sourcing rule.'
36
  ));
37
  }
38
  $fieldset->addField('lb_item_status', 'text', array(
39
+ 'label' => Mage::helper('dropship360')->__('Logicbroker Item Status'),
40
  'name' => 'lb_item_status',
41
  'note'=>'Read only filed',
42
  'readonly'=> true
44
 
45
 
46
  $fieldset->addField('sku', 'text', array(
47
+ 'label' => Mage::helper('dropship360')->__('Sku'),
48
  'name' => 'sku',
49
  'note'=>'Read only filed',
50
  'readonly'=> true
includes/src/Logicbroker_Dropship360_Block_Adminhtml_Sourcing_Edit_Tabs.php CHANGED
@@ -16,15 +16,15 @@ class Logicbroker_Dropship360_Block_Adminhtml_Sourcing_Edit_Tabs extends Mage_Ad
16
  parent::__construct();
17
  $this->setId('logicbroker_tabs');
18
  $this->setDestElementId('edit_form');
19
- $this->setTitle(Mage::helper('logicbroker')->__('Item Sourcing Information'));
20
  }
21
 
22
  protected function _beforeToHtml()
23
  {
24
  $this->addTab('form_section', array(
25
- 'label' => Mage::helper('logicbroker')->__('Item Sourcing Information'),
26
- 'title' => Mage::helper('logicbroker')->__('Item Sourcing Information'),
27
- 'content' => $this->getLayout()->createBlock('logicbroker/adminhtml_sourcing_edit_tab_form')->toHtml(),
28
  ));
29
 
30
  return parent::_beforeToHtml();
16
  parent::__construct();
17
  $this->setId('logicbroker_tabs');
18
  $this->setDestElementId('edit_form');
19
+ $this->setTitle(Mage::helper('dropship360')->__('Item Sourcing Information'));
20
  }
21
 
22
  protected function _beforeToHtml()
23
  {
24
  $this->addTab('form_section', array(
25
+ 'label' => Mage::helper('dropship360')->__('Item Sourcing Information'),
26
+ 'title' => Mage::helper('dropship360')->__('Item Sourcing Information'),
27
+ 'content' => $this->getLayout()->createBlock('dropship360/adminhtml_sourcing_edit_tab_form')->toHtml(),
28
  ));
29
 
30
  return parent::_beforeToHtml();
includes/src/Logicbroker_Dropship360_Block_Adminhtml_Sourcing_Grid.php CHANGED
@@ -27,13 +27,13 @@ class Logicbroker_Dropship360_Block_Adminhtml_Sourcing_Grid extends Mage_Adminht
27
  $collection->getSelect()->columns('if(`main_table`.`row_total` <> 0, `main_table`.`row_total`,(SELECT config.`row_total` FROM '.$tableName.' as simple INNER JOIN '.$tableName.' as config
28
  ON (simple.parent_item_id = config.item_id) where simple.item_id= `main_table`.`item_id`)) as row_total');
29
 
30
- $collection->getSelect()->join(array('lbItems'=>Mage::getSingleton('core/resource')->getTableName('logicbroker/orderitems')),
31
  'lbItems.item_id = main_table.item_id', array('item_order_id','lb_item_id'=>'id','lb_item_status','magento_sku'=>'sku','lb_vendor_code','lb_vendor_sku','vendor_cost','updated_by','updated_at'));
32
 
33
  $collection->getSelect()->join(array('salesOrder'=>Mage::getSingleton('core/resource')->getTableName('sales/order')),
34
  'salesOrder.entity_id = main_table.order_id', array('increment_id','status','created_at'));
35
 
36
- $collection->getSelect()->joinleft(array('lbRanking'=>Mage::getSingleton('core/resource')->getTableName('logicbroker/ranking')),
37
  'lbRanking.lb_vendor_code = lbItems.lb_vendor_code', array('lb_vendor_name'));
38
  $this->setCollection($collection);
39
  return parent::_prepareCollection();
@@ -47,10 +47,10 @@ ON (simple.parent_item_id = config.item_id) where simple.item_id= `main_table`.`
47
 
48
  protected function prepareOptionValue(){
49
 
50
- $itemStatus = array_merge(Mage::helper('logicbroker')->getItemStatuses(), array('Sent to Vendor'));
51
  foreach($itemStatus as $status )
52
  {
53
- $options[$status] = Mage::helper('logicbroker')->__($status);
54
  }
55
  return $options;
56
  }
@@ -58,13 +58,13 @@ ON (simple.parent_item_id = config.item_id) where simple.item_id= `main_table`.`
58
  protected function _prepareColumns()
59
  {
60
  $this->addColumn('increment_id', array(
61
- 'header' => Mage::helper('logicbroker')->__('Order #'),
62
  'align' =>'right',
63
  'width' => '50px',
64
  'index' => 'increment_id',
65
  ));
66
  $this->addColumn('created_at', array(
67
- 'header' => Mage::helper('logicbroker')->__('Order Date'),
68
  'align' =>'right',
69
  'width' => '50px',
70
  'type' => 'datetime',
@@ -72,7 +72,7 @@ ON (simple.parent_item_id = config.item_id) where simple.item_id= `main_table`.`
72
  'index' => 'created_at',
73
  ));
74
  $this->addColumn('magento_sku', array(
75
- 'header' => Mage::helper('logicbroker')->__('Product Sku'),
76
  'align' =>'right',
77
  'width' => '50px',
78
  "filter_index" => "lbItems.sku",
@@ -80,7 +80,7 @@ ON (simple.parent_item_id = config.item_id) where simple.item_id= `main_table`.`
80
  ));
81
 
82
  $this->addColumn('lb_vendor_name', array(
83
- 'header' => Mage::helper('logicbroker')->__('Supplier'),
84
  'align' =>'left',
85
  'width' => '80px',
86
  'index' => 'lb_vendor_name',
@@ -88,14 +88,14 @@ ON (simple.parent_item_id = config.item_id) where simple.item_id= `main_table`.`
88
 
89
 
90
  $this->addColumn('lb_vendor_sku', array(
91
- 'header' => Mage::helper('logicbroker')->__('Supplier Sku'),
92
  'align' =>'left',
93
  'width' => '80px',
94
  'index' => 'lb_vendor_sku',
95
  ));
96
  $store = $this->_getStore();
97
  $this->addColumn('vendor_cost', array(
98
- 'header' => Mage::helper('logicbroker')->__('Supplier Cost'),
99
  'align' =>'left',
100
  'width' => '80px',
101
  'index' => 'vendor_cost',
@@ -104,7 +104,7 @@ ON (simple.parent_item_id = config.item_id) where simple.item_id= `main_table`.`
104
  ));
105
 
106
  $this->addColumn('row_total', array(
107
- 'header' => Mage::helper('logicbroker')->__('Price'),
108
  'align' =>'left',
109
  'width' => '80px',
110
  'index' => 'row_total',
@@ -112,7 +112,7 @@ ON (simple.parent_item_id = config.item_id) where simple.item_id= `main_table`.`
112
  'currency_code' => $store->getBaseCurrency()->getCode(),
113
  ));
114
  $this->addColumn('qty_ordered', array(
115
- 'header' => Mage::helper('logicbroker')->__('Qty'),
116
  'align' =>'left',
117
  'width' => '80px',
118
  'index' => 'qty_ordered',
@@ -120,7 +120,7 @@ ON (simple.parent_item_id = config.item_id) where simple.item_id= `main_table`.`
120
 
121
 
122
  $this->addColumn('lb_item_status', array(
123
- 'header' => Mage::helper('logicbroker')->__('Drop Ship Status'),
124
  'align' =>'left',
125
  'width' => '80px',
126
  'index' => 'lb_item_status',
@@ -129,7 +129,7 @@ ON (simple.parent_item_id = config.item_id) where simple.item_id= `main_table`.`
129
  ));
130
 
131
  $this->addColumn('status', array(
132
- 'header' => Mage::helper('logicbroker')->__('Order Status'),
133
  'align' =>'left',
134
  'width' => '80px',
135
  'index' => 'status',
@@ -138,7 +138,7 @@ ON (simple.parent_item_id = config.item_id) where simple.item_id= `main_table`.`
138
  ));
139
 
140
  $this->addColumn('updated_by', array(
141
- 'header' => Mage::helper('logicbroker')->__('Last Updated By'),
142
  'align' =>'left',
143
  'width' => '80px',
144
  'index' => 'updated_by',
@@ -151,7 +151,7 @@ ON (simple.parent_item_id = config.item_id) where simple.item_id= `main_table`.`
151
  )
152
  ));
153
  $this->addColumn('updated_at', array(
154
- 'header' => Mage::helper('logicbroker')->__('Updated On'),
155
  'align' =>'right',
156
  'width' => '50px',
157
  'type' => 'datetime',
@@ -165,7 +165,7 @@ ON (simple.parent_item_id = config.item_id) where simple.item_id= `main_table`.`
165
  'header' => Mage::helper('sales')->__('Action'),
166
  'width' => '50px',
167
  'type' => 'action',
168
- 'renderer' => 'logicbroker/adminhtml_sourcing_history_renderer_action',
169
  'filter' => false,
170
  'sortable' => false,
171
  'index' => 'stores',
@@ -174,7 +174,7 @@ ON (simple.parent_item_id = config.item_id) where simple.item_id= `main_table`.`
174
 
175
  $this->addColumn('action',
176
  array(
177
- 'header' => Mage::helper('logicbroker')->__('Edit'),
178
  'width' => '100px',
179
  'type' => 'textaction',
180
  'filter' => false,
@@ -185,8 +185,8 @@ ON (simple.parent_item_id = config.item_id) where simple.item_id= `main_table`.`
185
  ));
186
 
187
 
188
- $this->addExportType('*/*/exportCsv', Mage::helper('logicbroker')->__('CSV'));
189
- $this->addExportType('*/*/exportXml', Mage::helper('logicbroker')->__('XML'));
190
  return parent::_prepareColumns();
191
  }
192
 
27
  $collection->getSelect()->columns('if(`main_table`.`row_total` <> 0, `main_table`.`row_total`,(SELECT config.`row_total` FROM '.$tableName.' as simple INNER JOIN '.$tableName.' as config
28
  ON (simple.parent_item_id = config.item_id) where simple.item_id= `main_table`.`item_id`)) as row_total');
29
 
30
+ $collection->getSelect()->join(array('lbItems'=>Mage::getSingleton('core/resource')->getTableName('dropship360/orderitems')),
31
  'lbItems.item_id = main_table.item_id', array('item_order_id','lb_item_id'=>'id','lb_item_status','magento_sku'=>'sku','lb_vendor_code','lb_vendor_sku','vendor_cost','updated_by','updated_at'));
32
 
33
  $collection->getSelect()->join(array('salesOrder'=>Mage::getSingleton('core/resource')->getTableName('sales/order')),
34
  'salesOrder.entity_id = main_table.order_id', array('increment_id','status','created_at'));
35
 
36
+ $collection->getSelect()->joinleft(array('lbRanking'=>Mage::getSingleton('core/resource')->getTableName('dropship360/ranking')),
37
  'lbRanking.lb_vendor_code = lbItems.lb_vendor_code', array('lb_vendor_name'));
38
  $this->setCollection($collection);
39
  return parent::_prepareCollection();
47
 
48
  protected function prepareOptionValue(){
49
 
50
+ $itemStatus = array_merge(Mage::helper('dropship360')->getItemStatuses(), array('Sent to Vendor'));
51
  foreach($itemStatus as $status )
52
  {
53
+ $options[$status] = Mage::helper('dropship360')->__($status);
54
  }
55
  return $options;
56
  }
58
  protected function _prepareColumns()
59
  {
60
  $this->addColumn('increment_id', array(
61
+ 'header' => Mage::helper('dropship360')->__('Order #'),
62
  'align' =>'right',
63
  'width' => '50px',
64
  'index' => 'increment_id',
65
  ));
66
  $this->addColumn('created_at', array(
67
+ 'header' => Mage::helper('dropship360')->__('Order Date'),
68
  'align' =>'right',
69
  'width' => '50px',
70
  'type' => 'datetime',
72
  'index' => 'created_at',
73
  ));
74
  $this->addColumn('magento_sku', array(
75
+ 'header' => Mage::helper('dropship360')->__('Product Sku'),
76
  'align' =>'right',
77
  'width' => '50px',
78
  "filter_index" => "lbItems.sku",
80
  ));
81
 
82
  $this->addColumn('lb_vendor_name', array(
83
+ 'header' => Mage::helper('dropship360')->__('Supplier'),
84
  'align' =>'left',
85
  'width' => '80px',
86
  'index' => 'lb_vendor_name',
88
 
89
 
90
  $this->addColumn('lb_vendor_sku', array(
91
+ 'header' => Mage::helper('dropship360')->__('Supplier Sku'),
92
  'align' =>'left',
93
  'width' => '80px',
94
  'index' => 'lb_vendor_sku',
95
  ));
96
  $store = $this->_getStore();
97
  $this->addColumn('vendor_cost', array(
98
+ 'header' => Mage::helper('dropship360')->__('Supplier Cost'),
99
  'align' =>'left',
100
  'width' => '80px',
101
  'index' => 'vendor_cost',
104
  ));
105
 
106
  $this->addColumn('row_total', array(
107
+ 'header' => Mage::helper('dropship360')->__('Price'),
108
  'align' =>'left',
109
  'width' => '80px',
110
  'index' => 'row_total',
112
  'currency_code' => $store->getBaseCurrency()->getCode(),
113
  ));
114
  $this->addColumn('qty_ordered', array(
115
+ 'header' => Mage::helper('dropship360')->__('Qty'),
116
  'align' =>'left',
117
  'width' => '80px',
118
  'index' => 'qty_ordered',
120
 
121
 
122
  $this->addColumn('lb_item_status', array(
123
+ 'header' => Mage::helper('dropship360')->__('Drop Ship Status'),
124
  'align' =>'left',
125
  'width' => '80px',
126
  'index' => 'lb_item_status',
129
  ));
130
 
131
  $this->addColumn('status', array(
132
+ 'header' => Mage::helper('dropship360')->__('Order Status'),
133
  'align' =>'left',
134
  'width' => '80px',
135
  'index' => 'status',
138
  ));
139
 
140
  $this->addColumn('updated_by', array(
141
+ 'header' => Mage::helper('dropship360')->__('Last Updated By'),
142
  'align' =>'left',
143
  'width' => '80px',
144
  'index' => 'updated_by',
151
  )
152
  ));
153
  $this->addColumn('updated_at', array(
154
+ 'header' => Mage::helper('dropship360')->__('Updated On'),
155
  'align' =>'right',
156
  'width' => '50px',
157
  'type' => 'datetime',
165
  'header' => Mage::helper('sales')->__('Action'),
166
  'width' => '50px',
167
  'type' => 'action',
168
+ 'renderer' => 'dropship360/adminhtml_sourcing_history_renderer_action',
169
  'filter' => false,
170
  'sortable' => false,
171
  'index' => 'stores',
174
 
175
  $this->addColumn('action',
176
  array(
177
+ 'header' => Mage::helper('dropship360')->__('Edit'),
178
  'width' => '100px',
179
  'type' => 'textaction',
180
  'filter' => false,
185
  ));
186
 
187
 
188
+ $this->addExportType('*/*/exportCsv', Mage::helper('dropship360')->__('CSV'));
189
+ $this->addExportType('*/*/exportXml', Mage::helper('dropship360')->__('XML'));
190
  return parent::_prepareColumns();
191
  }
192
 
includes/src/Logicbroker_Dropship360_Block_Adminhtml_Sourcing_History_View.php CHANGED
@@ -13,7 +13,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Sourcing_History_View extends Mage
13
  public function __construct()
14
  {
15
  $this->_objectId = 'lb_item_id';
16
- $this->_blockGroup = 'logicbroker';
17
  $this->_controller = 'adminhtml_sourcing_history';
18
  $this->_mode = 'view';
19
  parent::__construct();
@@ -38,7 +38,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Sourcing_History_View extends Mage
38
  public function getHeaderText()
39
  {
40
  $itemId = $this->getRequest()->getParam('lb_item_id');
41
- $orderItems = Mage::getModel('logicbroker/orderitems')->load($itemId, 'item_id');
42
  $orderId = Mage::getModel('sales/order')->load($orderItems->getItemOrderId())->getIncrementId();
43
  $createdDate = Mage::helper('core')->formatDate($orderItems->getCreatedAt(), 'medium', true);
44
  return Mage::helper('sales')->__('Item Sku %s | Order # %s | %s', $orderItems->getSku(), $orderId, $createdDate);
13
  public function __construct()
14
  {
15
  $this->_objectId = 'lb_item_id';
16
+ $this->_blockGroup = 'dropship360';
17
  $this->_controller = 'adminhtml_sourcing_history';
18
  $this->_mode = 'view';
19
  parent::__construct();
38
  public function getHeaderText()
39
  {
40
  $itemId = $this->getRequest()->getParam('lb_item_id');
41
+ $orderItems = Mage::getModel('dropship360/orderitems')->load($itemId, 'item_id');
42
  $orderId = Mage::getModel('sales/order')->load($orderItems->getItemOrderId())->getIncrementId();
43
  $createdDate = Mage::helper('core')->formatDate($orderItems->getCreatedAt(), 'medium', true);
44
  return Mage::helper('sales')->__('Item Sku %s | Order # %s | %s', $orderItems->getSku(), $orderId, $createdDate);
includes/src/Logicbroker_Dropship360_Block_Adminhtml_Sourcing_History_View_Form.php CHANGED
@@ -22,7 +22,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Sourcing_History_View_Form extends
22
  public function getHistory()
23
  {
24
  $lbItemId = Mage::app()->getRequest()->getParam('lb_item_id');
25
- $itemStatusHistory = Mage::getModel ( 'logicbroker/orderitems' )->load($lbItemId, 'item_id')->getItemStatusHistory();
26
  return unserialize($itemStatusHistory);
27
  }
28
 
22
  public function getHistory()
23
  {
24
  $lbItemId = Mage::app()->getRequest()->getParam('lb_item_id');
25
+ $itemStatusHistory = Mage::getModel ( 'dropship360/orderitems' )->load($lbItemId, 'item_id')->getItemStatusHistory();
26
  return unserialize($itemStatusHistory);
27
  }
28
 
includes/src/Logicbroker_Dropship360_Block_Adminhtml_Sourcing_History_View_Tabs.php CHANGED
@@ -13,14 +13,14 @@ class Logicbroker_Dropship360_Block_Adminhtml_Sourcing_History_View_Tabs extends
13
  parent::__construct();
14
  $this->setId('adminhtml_sourcing_history_view');
15
  $this->setDestElementId('history_view');
16
- $this->setTitle(Mage::helper('logicbroker')->__('Order Item History'));
17
  }
18
 
19
  protected function _beforeToHtml()
20
  {
21
  $this->addTab('form_section', array(
22
- 'label' => Mage::helper('logicbroker')->__('Order Item History'),
23
- 'title' => Mage::helper('logicbroker')->__('Order Item History'),
24
  ));
25
 
26
  return parent::_beforeToHtml();
13
  parent::__construct();
14
  $this->setId('adminhtml_sourcing_history_view');
15
  $this->setDestElementId('history_view');
16
+ $this->setTitle(Mage::helper('dropship360')->__('Order Item History'));
17
  }
18
 
19
  protected function _beforeToHtml()
20
  {
21
  $this->addTab('form_section', array(
22
+ 'label' => Mage::helper('dropship360')->__('Order Item History'),
23
+ 'title' => Mage::helper('dropship360')->__('Order Item History'),
24
  ));
25
 
26
  return parent::_beforeToHtml();
includes/src/Logicbroker_Dropship360_Block_Adminhtml_System_Config_Fieldset_Hint.php CHANGED
@@ -29,7 +29,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_System_Config_Fieldset_Hint
29
 
30
  public function getStoreList(){
31
 
32
- return Mage::getModel('logicbroker/system_config_source_store')->toOptionArray();
33
 
34
  }
35
 
29
 
30
  public function getStoreList(){
31
 
32
+ return Mage::getModel('dropship360/system_config_source_store')->toOptionArray();
33
 
34
  }
35
 
includes/src/Logicbroker_Dropship360_Block_Adminhtml_System_Config_Ftpconnectionbutton.php CHANGED
@@ -91,11 +91,11 @@ class Logicbroker_Dropship360_Block_Adminhtml_System_Config_Ftpconnectionbutton
91
 
92
  public function getTermsAndConditionsUrl()
93
  {
94
- return Mage::helper('logicbroker')->getConfigObject('apiconfig/termsandconditions/link');
95
  }
96
 
97
  public function getHelpUrl()
98
  {
99
- return Mage::helper('logicbroker')->getConfigObject('apiconfig/helpurl/link');
100
  }
101
  }
91
 
92
  public function getTermsAndConditionsUrl()
93
  {
94
+ return Mage::helper('dropship360')->getConfigObject('apiconfig/termsandconditions/link');
95
  }
96
 
97
  public function getHelpUrl()
98
  {
99
+ return Mage::helper('dropship360')->getConfigObject('apiconfig/helpurl/link');
100
  }
101
  }
includes/src/Logicbroker_Dropship360_Block_Adminhtml_System_Config_Helplink.php CHANGED
@@ -10,7 +10,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_System_Config_Helplink extends Mag
10
  {
11
  protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
12
  {
13
- $url = Mage::helper('logicbroker')->getConfigObject('apiconfig/helpurl/link');
14
  $html = parent::_getElementHtml($element);
15
  $html .= "<a href='{$url}' target='_blank' title='logicbroker'>Visit dropship360 Knowledge Base</a>";
16
  return $html;
10
  {
11
  protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
12
  {
13
+ $url = Mage::helper('dropship360')->getConfigObject('apiconfig/helpurl/link');
14
  $html = parent::_getElementHtml($element);
15
  $html .= "<a href='{$url}' target='_blank' title='logicbroker'>Visit dropship360 Knowledge Base</a>";
16
  return $html;
includes/src/Logicbroker_Dropship360_Block_Adminhtml_Upload.php CHANGED
@@ -64,7 +64,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Upload extends Mage_Adminhtml_Bloc
64
  protected function _construct()
65
  {
66
  parent::_construct();
67
- $this->_blockGroup = 'logicbroker';
68
  $this->_controller = 'adminhtml_upload';
69
  }
70
 
@@ -95,7 +95,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Upload extends Mage_Adminhtml_Bloc
95
  protected function getActiveRankers()
96
  {
97
  $rankersArray = array();
98
- $collection = Mage::getModel('logicbroker/ranking')->getCollection()->addFieldToFilter('is_dropship','yes');
99
  if($collection->count() > 0){
100
  foreach($collection as $data){
101
  $rankersArray[] = $data->getLbVendorCode();
64
  protected function _construct()
65
  {
66
  parent::_construct();
67
+ $this->_blockGroup = 'dropship360';
68
  $this->_controller = 'adminhtml_upload';
69
  }
70
 
95
  protected function getActiveRankers()
96
  {
97
  $rankersArray = array();
98
+ $collection = Mage::getModel('dropship360/ranking')->getCollection()->addFieldToFilter('is_dropship','yes');
99
  if($collection->count() > 0){
100
  foreach($collection as $data){
101
  $rankersArray[] = $data->getLbVendorCode();
includes/src/Logicbroker_Dropship360_Block_Adminhtml_Upload_Bulkassign.php CHANGED
@@ -36,7 +36,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Upload_Bulkassign extends Mage_Adm
36
  return $this;
37
  }
38
  $this->setShowFinished(true);
39
- $batchModel = Mage::getModel('logicbroker/uploadvendor')->prepareBulkassignmentCollection($this->getBulkVendorCode());
40
  if (count($batchModel) > 0) {
41
 
42
  $numberOfRecords = 100;
@@ -174,7 +174,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Upload_Bulkassign extends Mage_Adm
174
  protected function isManualUploadRunning(){
175
 
176
  $result = false;
177
- if(Mage::helper('logicbroker')->isProcessRunning('manual_upload')){
178
  $result = true;
179
  }
180
  return $result;
36
  return $this;
37
  }
38
  $this->setShowFinished(true);
39
+ $batchModel = Mage::getModel('dropship360/uploadvendor')->prepareBulkassignmentCollection($this->getBulkVendorCode());
40
  if (count($batchModel) > 0) {
41
 
42
  $numberOfRecords = 100;
174
  protected function isManualUploadRunning(){
175
 
176
  $result = false;
177
+ if(Mage::helper('dropship360')->isProcessRunning('manual_upload')){
178
  $result = true;
179
  }
180
  return $result;
includes/src/Logicbroker_Dropship360_Block_Adminhtml_Upload_Edit_Form.php CHANGED
@@ -24,7 +24,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Upload_Edit_Form extends Mage_Admi
24
  ));
25
  $legend = ($isProductSetupMode) ? $this->getLegendtext() : 'Import Settings';
26
  $fieldset = $form->addFieldset('base_fieldset', array('legend' => Mage::helper('importexport')->__($legend)));
27
- $isProcessContinue = Mage::helper('logicbroker')->isProcessRunning('bulk_assign');
28
  $fieldset->addField('productsetupmode', 'hidden', array(
29
  'name' => 'productsetupmode',
30
  'value' => $isProductSetupMode
@@ -35,7 +35,7 @@ class Logicbroker_Dropship360_Block_Adminhtml_Upload_Edit_Form extends Mage_Admi
35
  'title' => Mage::helper('importexport')->__('Supplier'),
36
  'label' => Mage::helper('importexport')->__('Supplier'),
37
  'required' => true,
38
- 'values' => Mage::getModel('logicbroker/system_config_source_vendorlist')->getAllVendor()
39
  ));
40
  if($isProductSetupMode){
41
  $fieldset->addType('custombutton', 'Logicbroker_Dropship360_Block_Adminhtml_Upload_Edit_Button');
24
  ));
25
  $legend = ($isProductSetupMode) ? $this->getLegendtext() : 'Import Settings';
26
  $fieldset = $form->addFieldset('base_fieldset', array('legend' => Mage::helper('importexport')->__($legend)));
27
+ $isProcessContinue = Mage::helper('dropship360')->isProcessRunning('bulk_assign');
28
  $fieldset->addField('productsetupmode', 'hidden', array(
29
  'name' => 'productsetupmode',
30
  'value' => $isProductSetupMode
35
  'title' => Mage::helper('importexport')->__('Supplier'),
36
  'label' => Mage::helper('importexport')->__('Supplier'),
37
  'required' => true,
38
+ 'values' => Mage::getModel('dropship360/system_config_source_vendorlist')->getAllVendor()
39
  ));
40
  if($isProductSetupMode){
41
  $fieldset->addType('custombutton', 'Logicbroker_Dropship360_Block_Adminhtml_Upload_Edit_Button');
includes/src/Logicbroker_Dropship360_Block_Adminhtml_Vendorproductuploadhistory.php CHANGED
@@ -8,34 +8,135 @@
8
  */
9
  class Logicbroker_Dropship360_Block_Adminhtml_Vendorproductuploadhistory extends Mage_Adminhtml_Block_Widget_Grid_Container
10
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  public function __construct()
12
  {
13
  $backButtonUrl = Mage::helper('core/http')->getHttpReferer() ? Mage::helper('core/http')->getHttpReferer() : Mage::getUrl('*/*/');
14
  $this->_controller = 'adminhtml_ranking';
15
- $this->_blockGroup = 'logicbroker';
16
- $this->_headerText = Mage::helper('logicbroker')->__('Supplier Product Upload Log');
17
- $this->__addBackButton = Mage::helper('logicbroker')->__('Back');
18
  $this->addButton('back',array(
19
  'label' => 'Back',
20
  'onclick' => 'setLocation(\'' . $backButtonUrl .'\')',
21
  'class' => 'back',
22
  )
23
  );
 
24
  parent::__construct();
25
  $this->removeButton('add');
26
 
27
  }
28
 
 
 
 
 
 
 
 
29
  public function getLogCollection(){
30
 
31
- $conn = Mage::getModel('logicbroker/uploadvendor')->getDatabaseConnection();
32
- $tableVendorImportLog = Mage::getSingleton ( 'core/resource' )->getTableName ( 'logicbroker/vendor_import_log' );
33
  $select = $conn->select()->from($tableVendorImportLog)->order('created_at DESC');
34
  $stmt = $conn->query($select);
35
  $rows = $stmt->fetchAll();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
 
 
 
 
 
 
 
 
37
 
38
- return $rows;
39
  }
40
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  }
8
  */
9
  class Logicbroker_Dropship360_Block_Adminhtml_Vendorproductuploadhistory extends Mage_Adminhtml_Block_Widget_Grid_Container
10
  {
11
+
12
+ protected $_message = array(
13
+ 'row_magento_sku'=>'Missing Data at Row(s) for Magento Sku row_num',
14
+ 'row_vendor_sku'=>'Missing Data at Row(s) for Vendor Sku row_num',
15
+ 'row_qty'=>'Bad Data for Qty at Row(s) row_num',
16
+ 'row_cost'=>'Bad Data for Cost at Row(s) row_num',
17
+ 'empty_file'=>'Sorry,we cant find the record to update inventory',
18
+ 'inventory_update_error'=>'Error in updating magento product inventory, magento_sku',
19
+ 'magento_sku_exists'=>'magento product sku not exist magento_sku',
20
+ 'inventory_add_error'=>'Error in adding magento product inventory, magento_sku',
21
+ 'combination_notexist'=>'Vendor Sku vendor_sku & Supplier code vendor_code combination does not exist',
22
+ 'already_assigned'=>'Vendor sku vendor_sku is already been assigned for this vendor',
23
+ 'duplicate_vendor_sku'=>'Vendor sku vendor_sku is duplicate in Magento Sku magento_sku for this supplier',
24
+ 'combination_exist'=> 'Vendor sku vendor_sku or Supplier code vendor_code combination already present for Magento Sku magento_sku',
25
+ 'data_notchnage'=> 'Cost & Qty for Vendor Sku vendor_sku & Supplier code vendor_code not changed',
26
+ 'lb_upc_notexist'=> 'UPC attribute missing vendor_sku',
27
+ 'lb_upc_multiple'=> 'Multiple Match found for UPC vendor_sku',
28
+ 'lb_mnp_notexist'=> 'MNP attribute missing vendor_sku',
29
+ 'lb_mnp_multiple'=> 'Multiple Match found for MNP vendor_sku',
30
+ 'sku_multiple'=> 'Multiple Match found for SKU vendor_sku',
31
+ 'attribute_notexist'=> 'Attribute assigned for Supplier code vendor_code does not exist for Vendor sku vendor_sku'
32
+ );
33
+ protected $_replace = array('magento_sku','vendor_sku','vendor_code');
34
  public function __construct()
35
  {
36
  $backButtonUrl = Mage::helper('core/http')->getHttpReferer() ? Mage::helper('core/http')->getHttpReferer() : Mage::getUrl('*/*/');
37
  $this->_controller = 'adminhtml_ranking';
38
+ $this->_blockGroup = 'dropship360';
39
+ $this->_headerText = Mage::helper('dropship360')->__('Supplier Product Upload Log');
40
+ $this->__addBackButton = Mage::helper('dropship360')->__('Back');
41
  $this->addButton('back',array(
42
  'label' => 'Back',
43
  'onclick' => 'setLocation(\'' . $backButtonUrl .'\')',
44
  'class' => 'back',
45
  )
46
  );
47
+
48
  parent::__construct();
49
  $this->removeButton('add');
50
 
51
  }
52
 
53
+ public function getMessageArray(){
54
+ return $this->_message;
55
+ }
56
+
57
+ public function getReplaceValue(){
58
+ return $this->_replace;
59
+ }
60
  public function getLogCollection(){
61
 
62
+ $conn = Mage::getModel('dropship360/uploadvendor')->getDatabaseConnection();
63
+ $tableVendorImportLog = Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship360/vendor_import_log' );
64
  $select = $conn->select()->from($tableVendorImportLog)->order('created_at DESC');
65
  $stmt = $conn->query($select);
66
  $rows = $stmt->fetchAll();
67
+ return $rows;
68
+ }
69
+
70
+ public function getLogDescriptionCollection($error_id){
71
+ $conn = Mage::getModel('dropship360/uploadvendor')->getDatabaseConnection();
72
+ $tableVendorImportLog = Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship360/vendor_import_log_desc' );
73
+ $select = $conn->select()->from($tableVendorImportLog)->where('error_id ='.$error_id);
74
+ $stmt = $conn->query($select);
75
+ $rows = $stmt->fetchAll();
76
+ return $rows;
77
+ }
78
+
79
+ public function parseDescription($data,$vendorCode){
80
+
81
+ $decodedata = $this->prepareRowData($data);
82
+ if(!is_array($decodedata) || empty($decodedata))
83
+ return empty($decodedata) ? implode('',$decodedata) : $decodedata;
84
+ $htmlStart = '<ul>';
85
+ $htmlEnd = '</ul>';
86
+ foreach($decodedata as $data){
87
+ $msg = $this->_message[$data['error_type']];
88
+
89
+ if(is_array($data['value']) && !empty($data['value'])){
90
+
91
+ $htmlStart .= $this->genrateHtml($data['value'],$msg,$vendorCode);
92
+ }else{
93
+ $htmlStart .= '<li>'.str_replace('row_num',$data['value'],$msg).'</li>';
94
+ }
95
+ }
96
+ return $htmlStart.$htmlEnd;
97
+ }
98
+
99
+ public function genrateHtml($value,$msg,$vendorCode){
100
 
101
+ $string = $msg;
102
+ $value['vendor_code'] = $vendorCode;
103
+ foreach($this->_replace as $val){
104
+
105
+ if(strstr($string,$val))
106
+ $string = str_replace($val,$value[$val],$string);
107
+ }
108
 
109
+ return '<li>'.$string.'</li>';
110
  }
111
 
112
+ public function prepareRowData($data)
113
+ {
114
+ $decodedata = array();
115
+ $dataTemp = array();
116
+ if(is_numeric($data))
117
+ {
118
+ $rowData = $this->getLogDescriptionCollection($data);
119
+ if(count($rowData) > 0)
120
+ {
121
+ foreach($rowData as $eachRow)
122
+ {
123
+ $decodedata[] = array_merge($dataTemp, $this->getDecodedJson($eachRow['description']));
124
+ }
125
+ }
126
+ }else
127
+ {
128
+ $decodedata = $this->getDecodedJson($data);
129
+ }
130
+ return $decodedata;
131
+ }
132
+ protected function getDecodedJson($data)
133
+ {
134
+ if(empty($data) || !Mage::helper('dropship360')->isJson($data)){
135
+ return $data;
136
+ }
137
+ $data = trim($data,'"');
138
+ $data = trim($data,'\'');
139
+ $decodedata = Mage::helper('core')->jsonDecode($data);
140
+ return $decodedata;
141
+ }
142
  }
includes/src/Logicbroker_Dropship360_Helper_Data.php CHANGED
@@ -17,6 +17,13 @@ class Logicbroker_Dropship360_Helper_Data extends Mage_Core_Helper_Abstract
17
  const LOGICBROKER_ITEM_STATUS_CANCELLED = 'Cancelled';
18
  const LOGICBROKER_ITEM_STATUS_NO_DROPSHIP = 'No Dropship';
19
  const LOGICBROKER_ITEM_STATUS_COMPLETED = 'Completed';
 
 
 
 
 
 
 
20
  protected $_maxtime = 60; // time in minutes
21
  public function getConfigObject($nodeName = null)
22
  {
@@ -64,11 +71,11 @@ class Logicbroker_Dropship360_Helper_Data extends Mage_Core_Helper_Abstract
64
  }
65
  /* End of LBN - 935 change */
66
 
67
- protected function getDatabaseConnection() {
68
  return Mage::getSingleton ( 'core/resource' );
69
  }
70
 
71
- protected function getTableName($name)
72
  {
73
  return $this->getDatabaseConnection()->getTableName ( $name );
74
  }
@@ -108,7 +115,7 @@ class Logicbroker_Dropship360_Helper_Data extends Mage_Core_Helper_Abstract
108
  $write = $this->getDatabaseConnection()->getConnection ( 'core_write' );
109
  $updatedAt = Mage::getModel('core/date')->gmtDate();
110
  $createAt = Mage::getModel('core/date')->gmtDate();
111
- $tmpTableName = $this->getTableName ( 'logicbroker/tmpdata' );
112
  $insert = 'insert into '.$tmpTableName.' (tmpdata,created_at,updated_at) values("'.$type.'","'.$createAt.'","'.$updatedAt.'")';
113
  $write->beginTransaction ();
114
  $write->query($insert);
@@ -125,7 +132,7 @@ class Logicbroker_Dropship360_Helper_Data extends Mage_Core_Helper_Abstract
125
 
126
  $write = $this->getDatabaseConnection()->getConnection ( 'core_write' );
127
  $updatedAt = Mage::getModel('core/date')->gmtDate();
128
- $tmpTableName = $this->getTableName ( 'logicbroker/tmpdata' );
129
  $update = 'update '.$tmpTableName.' set updated_at = '.$updatedAt.' where tmpdata = "'.$type.'"' ;
130
  $write->beginTransaction ();
131
  $write->query($update);
@@ -140,7 +147,7 @@ class Logicbroker_Dropship360_Helper_Data extends Mage_Core_Helper_Abstract
140
  protected function deleteTmpTableData($type){
141
 
142
  $write = $this->getDatabaseConnection()->getConnection ( 'core_write' );
143
- $tmpTableName = $this->getTableName ( 'logicbroker/tmpdata' );
144
  $delete = 'delete from '.$tmpTableName.' where tmpdata = "'.$type.'"' ;
145
  $write->beginTransaction ();
146
  $write->query($delete);
@@ -155,7 +162,7 @@ class Logicbroker_Dropship360_Helper_Data extends Mage_Core_Helper_Abstract
155
  public function selectTmpTableData($type){
156
 
157
  $read = $this->getDatabaseConnection()->getConnection ( 'core_read' );
158
- $tmpTableName = $this->getTableName ( 'logicbroker/tmpdata' );
159
  $select = 'Select * from '.$tmpTableName.' where tmpdata = "'.$type.'" ORDER BY id DESC limit 1';
160
  $result = $read->fetchAll($select);
161
 
@@ -212,8 +219,8 @@ class Logicbroker_Dropship360_Helper_Data extends Mage_Core_Helper_Abstract
212
  }
213
 
214
  protected function getLogCollection($params){
215
- $conn = Mage::getModel('logicbroker/uploadvendor')->getDatabaseConnection();
216
- $tableVendorImportLog = Mage::getSingleton ( 'core/resource' )->getTableName ( 'logicbroker/vendor_import_log' );
217
  $select = $conn->select()->from($tableVendorImportLog)
218
  ->where("created_at=?", $params['vdate']);
219
  $result = $conn->query($select);
@@ -228,7 +235,7 @@ class Logicbroker_Dropship360_Helper_Data extends Mage_Core_Helper_Abstract
228
  */
229
  protected function _getCsvHeaders()
230
  {
231
- $headers = array(0 => 'Date', 1 => 'Message') ;
232
  return $headers;
233
  }
234
 
@@ -236,13 +243,16 @@ class Logicbroker_Dropship360_Helper_Data extends Mage_Core_Helper_Abstract
236
  * Generates CSV file with error's list according to the collection in the $this->_list
237
  * @return array
238
  */
239
- public function generateErrorList($params)
240
  {
241
- $this->_list = $this->getLogCollection($params);
242
- $ftpError = explode('<li>', $this->_list['ftp_error_desc']);
243
- if (!is_null($this->_list)) {
244
- $items = $this->_list;
245
- if (count($items) > 0) {
 
 
 
246
  $io = new Varien_Io_File();
247
  $path = Mage::getBaseDir('var') . DS . 'export' . DS;
248
  $name = md5(microtime());
@@ -252,24 +262,66 @@ class Logicbroker_Dropship360_Helper_Data extends Mage_Core_Helper_Abstract
252
  $io->streamOpen($file, 'w+');
253
  $io->streamLock(true);
254
  $io->streamWriteCsv($this->_getCsvHeaders());
255
-
256
- $error = array();
257
- foreach( $ftpError as $ferror){
258
- if(strip_tags($ferror) != "") {
259
- $date = Mage::helper('core')->formatDate($this->_list['created_at'], 'medium', true);
260
- $error[] = array(0=>$date, 1=>strip_tags($ferror));
 
 
 
 
 
 
 
261
  }
 
 
 
 
 
 
 
 
 
 
 
262
  }
263
- foreach ($error as $e) {
264
- $io->streamWriteCsv($e);
265
  }
266
  return array(
267
  'type' => 'filename',
268
  'value' => $file,
269
- 'rm' => true
 
270
  );
271
  }
272
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
273
  }
274
 
275
  /**
@@ -301,4 +353,71 @@ class Logicbroker_Dropship360_Helper_Data extends Mage_Core_Helper_Abstract
301
  }
302
  return $serializeData;
303
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
304
  }
17
  const LOGICBROKER_ITEM_STATUS_CANCELLED = 'Cancelled';
18
  const LOGICBROKER_ITEM_STATUS_NO_DROPSHIP = 'No Dropship';
19
  const LOGICBROKER_ITEM_STATUS_COMPLETED = 'Completed';
20
+ const LOGICBROKER_PRODUCT_LINK_UPC = 'UPC';
21
+ const LOGICBROKER_PRODUCT_LINK_MNP = 'Manufacturer Part Number';
22
+ const LOGICBROKER_PRODUCT_LINK_SKU = 'Magento Sku';
23
+ const LOGICBROKER_PRODUCT_LINK_NONE = 'None';
24
+ const LOGICBROKER_PRODUCT_LINK_CODE_UPC = 'lb_upc';
25
+ const LOGICBROKER_PRODUCT_LINK_CODE_MNP = 'lb_mnp';
26
+ const LOGICBROKER_PRODUCT_LINK_CODE_SKU = 'sku';
27
  protected $_maxtime = 60; // time in minutes
28
  public function getConfigObject($nodeName = null)
29
  {
71
  }
72
  /* End of LBN - 935 change */
73
 
74
+ public function getDatabaseConnection() {
75
  return Mage::getSingleton ( 'core/resource' );
76
  }
77
 
78
+ public function getTableName($name)
79
  {
80
  return $this->getDatabaseConnection()->getTableName ( $name );
81
  }
115
  $write = $this->getDatabaseConnection()->getConnection ( 'core_write' );
116
  $updatedAt = Mage::getModel('core/date')->gmtDate();
117
  $createAt = Mage::getModel('core/date')->gmtDate();
118
+ $tmpTableName = $this->getTableName ( 'dropship360/tmpdata' );
119
  $insert = 'insert into '.$tmpTableName.' (tmpdata,created_at,updated_at) values("'.$type.'","'.$createAt.'","'.$updatedAt.'")';
120
  $write->beginTransaction ();
121
  $write->query($insert);
132
 
133
  $write = $this->getDatabaseConnection()->getConnection ( 'core_write' );
134
  $updatedAt = Mage::getModel('core/date')->gmtDate();
135
+ $tmpTableName = $this->getTableName ( 'dropship360/tmpdata' );
136
  $update = 'update '.$tmpTableName.' set updated_at = '.$updatedAt.' where tmpdata = "'.$type.'"' ;
137
  $write->beginTransaction ();
138
  $write->query($update);
147
  protected function deleteTmpTableData($type){
148
 
149
  $write = $this->getDatabaseConnection()->getConnection ( 'core_write' );
150
+ $tmpTableName = $this->getTableName ( 'dropship360/tmpdata' );
151
  $delete = 'delete from '.$tmpTableName.' where tmpdata = "'.$type.'"' ;
152
  $write->beginTransaction ();
153
  $write->query($delete);
162
  public function selectTmpTableData($type){
163
 
164
  $read = $this->getDatabaseConnection()->getConnection ( 'core_read' );
165
+ $tmpTableName = $this->getTableName ( 'dropship360/tmpdata' );
166
  $select = 'Select * from '.$tmpTableName.' where tmpdata = "'.$type.'" ORDER BY id DESC limit 1';
167
  $result = $read->fetchAll($select);
168
 
219
  }
220
 
221
  protected function getLogCollection($params){
222
+ $conn = Mage::getModel('dropship360/uploadvendor')->getDatabaseConnection();
223
+ $tableVendorImportLog = Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship360/vendor_import_log' );
224
  $select = $conn->select()->from($tableVendorImportLog)
225
  ->where("created_at=?", $params['vdate']);
226
  $result = $conn->query($select);
235
  */
236
  protected function _getCsvHeaders()
237
  {
238
+ $headers = array('Supplier Code','Supplier','Magento Sku','vendor_sku','cost','inventory','Failure Reason') ;
239
  return $headers;
240
  }
241
 
243
  * Generates CSV file with error's list according to the collection in the $this->_list
244
  * @return array
245
  */
246
+ public function generateErrorList($params,$isFtp = false)
247
  {
248
+ $ftpCollection = (!$isFtp) ? $this->getLogCollection($params) : $params;
249
+ //$ftpError = explode('<li>', $this->_list['ftp_error_desc']);
250
+ if (!empty($ftpCollection)) {
251
+ if (count($ftpCollection) > 0) {
252
+ if($ftpCollection['failure'] > 3000){
253
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship360')->__('Data size is too big for export'));
254
+ return array('error' => true);
255
+ }
256
  $io = new Varien_Io_File();
257
  $path = Mage::getBaseDir('var') . DS . 'export' . DS;
258
  $name = md5(microtime());
262
  $io->streamOpen($file, 'w+');
263
  $io->streamLock(true);
264
  $io->streamWriteCsv($this->_getCsvHeaders());
265
+ $rowData = (!is_null($ftpCollection['ftp_error_desc'])) ? $ftpCollection['ftp_error_desc'] : $ftpCollection['error_id'];
266
+ $prepareValue = $this->prepareExportVaues($rowData, $ftpCollection['lb_vendor_code']);
267
+ if(is_array($prepareValue)){
268
+ foreach($prepareValue as $value){
269
+ $csv[] = $ftpCollection['lb_vendor_code'];
270
+ $csv[] = $this->getSupplierName($ftpCollection['lb_vendor_code']);
271
+ $csv[] = $value['magento_sku'];
272
+ $csv[] = $value['vendor_sku'];
273
+ $csv[] = $value['cost'];
274
+ $csv[] = $value['qty'];
275
+ $csv[] = $value['reason'];
276
+ $io->streamWriteCsv($csv);
277
+ unset($csv);
278
  }
279
+ }else
280
+ {
281
+ $csv[] = $ftpCollection['lb_vendor_code'];
282
+ $csv[] = $this->getSupplierName($ftpCollection['lb_vendor_code']);
283
+ $csv[] = '';
284
+ $csv[] = '';
285
+ $csv[] ='';
286
+ $csv[] = '';
287
+ $csv[] = $ftpCollection['ftp_error_desc'];
288
+ $io->streamWriteCsv($csv);
289
+ unset($csv);
290
  }
 
 
291
  }
292
  return array(
293
  'type' => 'filename',
294
  'value' => $file,
295
+ 'rm' => true,
296
+ 'error'=> false
297
  );
298
  }
299
  }
300
+ public function prepareExportVaues($description,$vendorCode){
301
+ $csvData = array();
302
+ $decodedata = Mage::app()->getLayout()->createBlock('dropship360/adminhtml_vendorproductuploadhistory')->prepareRowData($description);
303
+ if(!is_array($decodedata) || empty($decodedata))
304
+ return empty($decodedata) ? implode('',$decodedata) : $decodedata;
305
+ foreach($decodedata as $data){
306
+ $msgArray = Mage::app()->getLayout()->createBlock('dropship360/adminhtml_vendorproductuploadhistory')->getMessageArray();
307
+ $msg = $msgArray[$data['error_type']];
308
+ if(is_array($data['value']) && !empty($data['value'])){
309
+ $csvData[] = array('magento_sku'=>$data['value']['magento_sku'],'vendor_sku'=>$data['value']['vendor_sku'],'cost'=>$data['value']['cost'],'qty'=>$data['value']['qty'],'reason'=> $this->genrateHtml($data['value'],$msg,$vendorCode));
310
+ }else{
311
+ $csvData[] = array('magento_sku'=>'','vendor_sku'=>'','cost'=>'','qty'=>'','reason'=> (strstr($msg,'row_num')) ? str_replace('row_num',$data['value'],$msg) : str_replace('empty_file',$data['value'],$msg) );
312
+ }
313
+ }
314
+ return $csvData;
315
+ }
316
+ public function genrateHtml($value,$msg,$vendorCode){
317
+ $replace = Mage::app()->getLayout()->createBlock('dropship360/adminhtml_vendorproductuploadhistory')->getReplaceValue();
318
+ $string = $msg;
319
+ $value['vendor_code'] = $vendorCode;
320
+ foreach($replace as $val){
321
+ if(strstr($string,$val))
322
+ $string = str_replace($val,$value[$val],$string);
323
+ }
324
+ return $string;
325
  }
326
 
327
  /**
353
  }
354
  return $serializeData;
355
  }
356
+
357
+ public function sendMail($templateObject,$email,$templateId,$attachment = null){
358
+
359
+ $result = false;
360
+
361
+ if(empty($templateId) || empty($email))
362
+ return $result;
363
+ $mailTemplate = Mage::getModel('core/email_template');
364
+ if($attachment)
365
+ {
366
+ $content = file_get_contents($attachment);
367
+ //$content = str_replace('></',">\n</",$content);
368
+ // this is for to set the file format
369
+ $at = new Zend_Mime_Part($content);
370
+ $at->type = 'application/csv'; // if u have PDF then it would like -> 'application/pdf'
371
+ $at->disposition = Zend_Mime::DISPOSITION_INLINE;
372
+ $at->encoding = Zend_Mime::ENCODING_8BIT;
373
+ $at->filename = 'outdated_productlist'.date('ymdHis').'.csv';
374
+ $mailTemplate->getMail()->addAttachment($at);
375
+ //$emailTemplate->_mail->addAttachment($at);
376
+ }
377
+ /* @var $mailTemplate Mage_Core_Model_Email_Template */
378
+ $mailTemplate->setDesignConfig(array('area' => 'backend'));
379
+ if($templateObject->getBcc())
380
+ {
381
+ $mailTemplate->addBcc($templateObject->getBcc());
382
+ }
383
+ //$mailTemplate->setTemplateSubject($subject);
384
+ $name = explode('@',$email);
385
+ $mailTemplate->sendTransactional(
386
+ $templateId,
387
+ 'general',
388
+ $email,
389
+ $name[0],
390
+ array('templatevar' => $templateObject)
391
+ );
392
+ (!$mailTemplate->getSentSuccess()) ? $result = false : $result = true;
393
+ return $result;
394
+ }
395
+
396
+ /**
397
+ * Turn on read uncommitted mode
398
+ */
399
+ public function turnOnReadUncommittedMode()
400
+ {
401
+ $this->getDatabaseConnection()->getConnection('read')->query("SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED");
402
+ }
403
+ /**
404
+ * Turn on read committed mode
405
+ */
406
+ public function turnOnReadCommittedMode()
407
+ {
408
+ $this->getDatabaseConnection()->getConnection('read')->query("SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED");
409
+ }
410
+ public function isJson($data){
411
+ $result = false;
412
+ $data = trim($data,'"');
413
+ $data = trim($data,'\'');
414
+ $data = stripslashes($data);
415
+ $decodedata = json_decode($data);
416
+ $result = (json_last_error() == JSON_ERROR_NONE) ? true : false;
417
+ return $result;
418
+ }
419
+ public function getSupplierName($vendorCode){
420
+ $vendorRankModel = Mage::getSingleton('dropship360/ranking')->load($vendorCode,'lb_vendor_code');
421
+ return $vendorRankModel->getLbVendorName();
422
+ }
423
  }
includes/src/Logicbroker_Dropship360_Model_Api2_Createroleandrule.php CHANGED
@@ -4,6 +4,7 @@
4
  *
5
  * @category Community
6
  * @package Logicbroker_Dropship360
 
7
  */
8
  class Logicbroker_Dropship360_Model_Api2_Createroleandrule
9
  {
@@ -172,12 +173,12 @@ class Logicbroker_Dropship360_Model_Api2_Createroleandrule
172
 
173
  protected function createAdminUserAndRole(){
174
 
175
- $resource = '__root__,admin/logicbroker,admin/logicbroker/integration,admin/logicbroker/order_sourcing,admin/logicbroker/vendor_ranking,admin/logicbroker/inventory,admin/logicbroker/suppliers';
176
  $roleName = 'logicbrokerds360';
177
 
178
  $role = Mage::getModel('admin/roles');
179
  $username = 'logicbrokerds360';
180
- $email = Mage::helper('logicbroker')->getConfigObject('apiconfig/email/toaddress');
181
  $user = Mage::getModel('admin/user');
182
  $user->loadByUsername($username);
183
  if(!$user->getId()){
4
  *
5
  * @category Community
6
  * @package Logicbroker_Dropship360
7
+ * No use of this class currently as Rest may be a part of future release refer lbn-1351
8
  */
9
  class Logicbroker_Dropship360_Model_Api2_Createroleandrule
10
  {
173
 
174
  protected function createAdminUserAndRole(){
175
 
176
+ $resource = '__root__,admin/logicbroker,admin/dropship360/integration,admin/dropship360/order_sourcing,admin/dropship360/vendor_ranking,admin/dropship360/inventory,admin/dropship360/suppliers';
177
  $roleName = 'logicbrokerds360';
178
 
179
  $role = Mage::getModel('admin/roles');
180
  $username = 'logicbrokerds360';
181
+ $email = Mage::helper('dropship360')->getConfigObject('apiconfig/email/toaddress');
182
  $user = Mage::getModel('admin/user');
183
  $user->loadByUsername($username);
184
  if(!$user->getId()){
includes/src/Logicbroker_Dropship360_Model_Api2_Inventory_Rest_Admin_V1.php CHANGED
@@ -10,7 +10,7 @@ class Logicbroker_Dropship360_Model_Api2_Inventory_Rest_Admin_V1 extends Logicbr
10
  {
11
  protected function _create(array $data)
12
  {
13
- if(Mage::helper('logicbroker')->isProcessRunning('bulk_assign')){
14
  $message = 'Bulk product setup is currently running hence cannot run REST import';
15
  echo $message;
16
  //Mage::log($message, null, 'logicbroker_log_report.log');
@@ -21,7 +21,7 @@ class Logicbroker_Dropship360_Model_Api2_Inventory_Rest_Admin_V1 extends Logicbr
21
  foreach($requestData as $chunkData)
22
  {
23
  $processedData['vendordata'] = $chunkData;
24
- $result[] = Mage::getModel('logicbroker/inventory')->prepareInventoryTable($processedData);
25
  }
26
 
27
  foreach($result as $row){
10
  {
11
  protected function _create(array $data)
12
  {
13
+ if(Mage::helper('dropship360')->isProcessRunning('bulk_assign')){
14
  $message = 'Bulk product setup is currently running hence cannot run REST import';
15
  echo $message;
16
  //Mage::log($message, null, 'logicbroker_log_report.log');
21
  foreach($requestData as $chunkData)
22
  {
23
  $processedData['vendordata'] = $chunkData;
24
+ $result[] = Mage::getModel('dropship360/inventory')->prepareInventoryTable($processedData);
25
  }
26
 
27
  foreach($result as $row){
includes/src/Logicbroker_Dropship360_Model_Api2_Product_Rest_Admin_V1.php CHANGED
@@ -17,7 +17,7 @@ class Logicbroker_Dropship360_Model_Api2_Product_Rest_Admin_V1 extends Logicbrok
17
  foreach($requestData as $chunkData)
18
  {
19
  $processedData['productdata'] = $chunkData;
20
- $result[] = Mage::getModel('logicbroker/productimport')->_init()->processData($processedData);
21
  }
22
  $time_end = now();
23
  echo 'Start Time = '.$time_start;
17
  foreach($requestData as $chunkData)
18
  {
19
  $processedData['productdata'] = $chunkData;
20
+ $result[] = Mage::getModel('dropship360/productimport')->_init()->processData($processedData);
21
  }
22
  $time_end = now();
23
  echo 'Start Time = '.$time_start;
includes/src/Logicbroker_Dropship360_Model_Csvparser.php ADDED
@@ -0,0 +1,266 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Logicbroker
5
+ * @category Community
6
+ * @package Logicbroker_Dropship360
7
+ */
8
+
9
+ class Logicbroker_Dropship360_Model_Csvparser
10
+ {
11
+
12
+ protected $dbConnection;
13
+ protected $tableName;
14
+ protected $vendorObject;
15
+ protected $chunksize = 50;
16
+ //protected $chnagedValue = array();
17
+ protected $ftpCSVFormat = array('vendor_code','vendor_sku','qty','cost');
18
+ protected $manualCSVFormat = array('vendor_sku','qty','cost');
19
+ protected $productSetupCSVFormat = array('magento_sku','vendor_sku');
20
+ protected $_exportHeaders = array('Supplier Code','Supplier','Magento Sku','Vendor Sku','Cost','Inventory','Last Sync Date');
21
+ protected $_indexVendorSku = 0;
22
+ protected $_indexStock = 1;
23
+ protected $_indexPrice = 2;
24
+
25
+ public function __construct(){
26
+
27
+ $this->dbConnection = Mage::helper('dropship360')->getDatabaseConnection();
28
+ $this->tableName = Mage::helper('dropship360')->getTableName('dropship360/csvtmpdata');
29
+ $this->vendorObject = Mage::getModel('dropship360/inventory');
30
+ }
31
+
32
+ // check is csv for manual or ftp other csv will not process data
33
+ protected function isProcessRequired($header)
34
+ {
35
+ $result = true;
36
+ if($header[0] == 'vendor_code')
37
+ {
38
+ $diffArray=array_diff($this->ftpCSVFormat,$header);
39
+ $result = (count($diffArray) == 0);
40
+ }else
41
+ {
42
+ $diffArray=array_diff($this->manualCSVFormat,$header);
43
+ $result = (count($diffArray) == 0);
44
+ }
45
+ //var_dump($result);
46
+ //die;
47
+ return $result;
48
+ }
49
+
50
+ protected function checkFtpHeader($header)
51
+ {
52
+ if(count($header) == 4 )
53
+ {
54
+ $this->_indexVendorSku = 1;
55
+ $this->_indexStock = 2;
56
+ $this->_indexPrice = 3;
57
+ }
58
+ }
59
+
60
+ public function getChangedValue($csvData,$vendorCode){
61
+
62
+ $parsedData = array();
63
+ if(count($csvData) <= 1 || !$this->isProcessRequired($csvData[0]))
64
+ {
65
+ return $csvData;
66
+ }
67
+ $this->emptyTable();
68
+ $this->checkFtpHeader($csvData[0]);
69
+ $insertQuery = $this->insertMultiple($csvData,$vendorCode);
70
+ if($insertQuery/*$this->executeStm($insertQuery)*/){
71
+ $parsedData = $this->prepareCsvjoin($csvData[0]);
72
+ //array_unshift($parsedData,$csvData[0]);
73
+ }
74
+ else{
75
+ $parsedData = $csvData;
76
+ }
77
+ return $parsedData;
78
+ }
79
+
80
+ protected function insertMultiple($csvData,$vendorCode){
81
+ $connection = $this->dbConnection->getConnection ( 'core_write' );
82
+ $csvArray = array();
83
+ $chunkCsvData = array_chunk($csvData,$this->chunksize);
84
+ foreach($chunkCsvData as $value)
85
+ {
86
+ foreach ($value as $key=>$data)
87
+ {
88
+ if($key == 0)
89
+ continue;
90
+ $csvArray[] = array('vendor_code'=>$vendorCode,'csv_vendor_sku'=>trim($data [$this->_indexVendorSku]),'csv_stock'=>$data [$this->_indexStock],'csv_price'=>$data [$this->_indexPrice]);
91
+ }
92
+ try {
93
+ $connection->insertOnDuplicate($this->tableName,$csvArray,array('csv_vendor_sku','csv_stock','csv_price'));
94
+ } catch (Exception $e) {
95
+ Mage::log($e->getTrace(),null,'logicbroker_debug.log');
96
+ return false;
97
+ }
98
+ $csvArray = array();
99
+ }
100
+ return true;
101
+ }
102
+
103
+ protected function executeStm($query){
104
+
105
+ $write = $this->dbConnection->getConnection ( 'core_write' );
106
+ $write->beginTransaction ();
107
+ $write->query($query);
108
+ try {
109
+ $write->commit ();
110
+ return true;
111
+ } catch ( Exception $e ) {
112
+ $write->rollBack ();
113
+ Mage::log($e->getMessage(), null, 'vendor_inventory_import_error.log');
114
+ return false;
115
+ }
116
+
117
+ }
118
+
119
+ protected function prepareCsvjoin($header){
120
+ $chnagedValue =array();
121
+ $chnagedValue[] = $header;
122
+ $collection = $this->vendorObject->getCollection()->addFieldToSelect(array('lb_vendor_code','lb_vendor_sku','stock','cost'));
123
+ $collection->getSelect()->join(array('inventory'=>$this->tableName),
124
+ 'inventory.vendor_code = main_table.lb_vendor_code and inventory.csv_vendor_sku = main_table.lb_vendor_sku')->where('inventory.csv_stock != main_table.stock or inventory.csv_price != main_table.cost');
125
+
126
+ if($collection->getSize() > 0 ){
127
+
128
+ foreach($collection as $data){
129
+ $query = 'UPDATE '.$this->tableName.' set is_processed = 1 where csv_vendor_sku = "'.$data->getCsvVendorSku().'" and vendor_code = "'.$data->getLbVendorCode().'"';
130
+ $chnagedValue[$data->getRowId()] = array($data->getCsvVendorSku(),$data->getCsvStock(),$data->getCsvPrice());
131
+ $this->executeStm($query);
132
+ }
133
+ }
134
+ return $chnagedValue;
135
+ }
136
+
137
+ public function emptyTable()
138
+ {
139
+ $write = $this->dbConnection->getConnection ( 'core_write' );
140
+ $query = 'TRUNCATE TABLE '.$this->tableName;
141
+ try {
142
+ $write->query($query);
143
+ } catch ( Exception $e ) {
144
+
145
+ Mage::log($e->getMessage(), null, 'vendor_inventory_import_error.log');
146
+ return false;
147
+ }
148
+
149
+ }
150
+ public function getCsvFile($itemObject)
151
+ {
152
+ $io = new Varien_Io_File();
153
+ $path = Mage::getBaseDir('var') . DS . 'export' . DS;
154
+ $name = md5(microtime());
155
+ $file = $path . DS . $name . '.csv';
156
+ $io->setAllowCreateFolders(true);
157
+ $io->open(array('path' => $path));
158
+ $io->streamOpen($file, 'w+');
159
+ $io->streamLock(true);
160
+ $io->streamWriteCsv($this->_exportHeaders);
161
+ $this->_exportCsvItem($itemObject,$io);
162
+ $io->streamUnlock();
163
+ $io->streamClose();
164
+ return array(
165
+ 'type' => 'filename',
166
+ 'value' => $file,
167
+ 'rm' => true // can delete file after use
168
+ );
169
+ }
170
+ protected function _exportCsvItem($itemObject, Varien_Io_File $adapter)
171
+ {
172
+ $row = array();
173
+ foreach ($itemObject as $item) {
174
+ $row[] = $item->getLbVendorCode();
175
+ $row[] = $item->getLbVendorName();
176
+ $row[] = $item->getProductSku();
177
+ $row[] = $item->getLbVendorSku();
178
+ $row[] = $item->getCost();
179
+ $row[] = $item->getStock();
180
+ $row[] = $this->formatDate($item->getUpdatedAt());
181
+ $adapter->streamWriteCsv($row);
182
+ unset($row);
183
+ }
184
+ }
185
+ public function formatDate($date){
186
+ $format = Mage::app()->getLocale()->getDateTimeFormat(
187
+ Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM
188
+ );
189
+ $date = Mage::app()->getLocale()
190
+ ->date($date, Varien_Date::DATETIME_INTERNAL_FORMAT)->toString($format);
191
+ return $date;
192
+ }
193
+ public function generateManualCsvRow($csvData,$isProductSetupMode,$lb_vendor_code)
194
+ {
195
+ $records = array();
196
+ foreach($csvData as $row => $csvRowData)
197
+ {
198
+ if($row == 0)
199
+ continue;
200
+ if(!$isProductSetupMode)
201
+ {
202
+ (count($csvRowData) <= 3) ? array_unshift($csvRowData, "") : $csvRowData;
203
+ if(is_numeric($csvRowData[2])){
204
+ /* LBN - 935 change */
205
+ $magento_sku = Mage::getModel('dropship360/uploadvendor')->getMagentoSku($lb_vendor_code, trim($csvRowData[1]));
206
+ $csvqty = (!empty($magento_sku)) ? Mage::helper('dropship360')->getIsQtyDecimal($magento_sku,$csvRowData[2]) : $csvRowData[2];;
207
+ }
208
+ else
209
+ {
210
+ $csvqty = $csvRowData[2];
211
+ }
212
+ }
213
+ if(!$isProductSetupMode)
214
+ $records[$row] = array('vendor_sku'=>trim($csvRowData[1]),'qty'=>$csvqty ,'cost'=>$csvRowData[3],'lb_vendor_code'=>$lb_vendor_code);
215
+ else
216
+ $records[$row] = array('magento_sku'=>trim($csvRowData[0]),'vendor_sku'=>trim($csvRowData[1]),'qty'=>0 ,'cost'=>0,'lb_vendor_code'=>$lb_vendor_code);
217
+ }
218
+ return $records;
219
+ }
220
+ public function generateFtpCsvRow($csvData,$vendorCode)
221
+ {
222
+ $records = array();
223
+ foreach($csvData as $row => $csvRowData)
224
+ {
225
+ if($row == 0)
226
+ continue;
227
+ //patch for backwards compatible for ftp change lbn-1070
228
+ (count($csvRowData) <= 3) ? array_unshift($csvRowData, "") : $csvRowData;
229
+ if(is_numeric($csvRowData[2]) || $csvRowData[2] > 0){
230
+ /* LBN - 935 change */
231
+ $magento_sku = Mage::getModel('dropship360/uploadvendor')->getMagentoSku($vendorCode, trim($csvRowData[1]));
232
+ (! empty ( $magento_sku )) ? $qty = Mage::helper ( 'dropship360' )->getIsQtyDecimal ( $magento_sku, $csvRowData [2] ) : $qty = $csvRowData [2];
233
+ /* End of LBN - 935 change */
234
+ }else{
235
+ $qty = $csvRowData[2];
236
+ }
237
+ $records[$row] = array('lb_vendor_code'=>$vendorCode,'vendor_sku'=>trim($csvRowData[1]),'qty'=>$qty ,'cost'=>$csvRowData[3]);
238
+ //$vendorCode = $csvRowData[0];
239
+ }
240
+ return $records;
241
+ }
242
+ public function isCsvFileEmpty()
243
+ {
244
+ return (count($this->getCsvRows()) > 0) ? false : true;
245
+ }
246
+ protected function getCsvRows()
247
+ {
248
+ $rows = array();
249
+ $conn = $this->dbConnection->getConnection ( 'core_read' );
250
+ $select = $conn->select()->from($this->tableName)->where('is_processed = 0');
251
+ $stmt = $conn->query($select);
252
+ $rows = $stmt->fetchAll();
253
+ return $rows;
254
+ }
255
+ public function getUnprocessedCsvRows($vendorCode,$isFtp){
256
+ $records = array();
257
+ $rows = $this->getCsvRows();
258
+ if(count($rows) > 0 ){
259
+ foreach($rows as $row){
260
+ $records[$row['row_id']] = array('lb_vendor_code'=>$vendorCode,'vendor_sku'=>trim($row['csv_vendor_sku']),'qty'=>$row['csv_stock'] ,'cost'=>$row['csv_price']);
261
+ }
262
+ }
263
+ return $records;
264
+ }
265
+ }
266
+
includes/src/Logicbroker_Dropship360_Model_Inventory.php CHANGED
@@ -13,9 +13,11 @@ class Logicbroker_Dropship360_Model_Inventory extends Mage_Core_Model_Abstract
13
  protected $_productInventorySubtract = 0;
14
  protected $_productInventoryUpdate = 0;
15
  protected $_stockBeforeQtyDecimalCheck = '';
 
 
16
  protected function _construct()
17
  {
18
- $this->_init("logicbroker/inventory");
19
  }
20
 
21
  public function prepareInventoryTable($restReqest)
@@ -27,7 +29,7 @@ class Logicbroker_Dropship360_Model_Inventory extends Mage_Core_Model_Abstract
27
 
28
  protected function updateProductStock()
29
  {
30
- $dataCollection = Mage::getModel('logicbroker/inventory')->getCollection();
31
  $stockData = array();
32
  if($dataCollection->count() < 0){
33
  return;
@@ -64,7 +66,7 @@ class Logicbroker_Dropship360_Model_Inventory extends Mage_Core_Model_Abstract
64
  try {
65
  $stockItem->save();
66
  } catch (Exception $e) {
67
- Mage::helper('logicbroker')->genrateLog(0,'mgento inventory update started','mgento inventory update ended','Section :Error In Setting/update magento inventory: '.$e->getMessage().' sku : '.$sku);
68
  echo $e->getMessage();
69
  }
70
  }
@@ -75,8 +77,8 @@ class Logicbroker_Dropship360_Model_Inventory extends Mage_Core_Model_Abstract
75
  protected function prepareData($restReqest)
76
  {
77
  $result = array();
78
- $buffer = Mage::getStoreConfig('logicbroker_sourcing/inventory/buffer');
79
- $vendorModel = Mage::getModel('logicbroker/ranking')->getCollection();
80
  foreach ($restReqest as $value) {
81
  foreach ($value as $key=>$val) {
82
  $result[$val['lb_vendor_code']] = $this->saveLbInventory($val, $buffer);
@@ -85,98 +87,58 @@ class Logicbroker_Dropship360_Model_Inventory extends Mage_Core_Model_Abstract
85
  return $result;
86
  }
87
 
88
- /**
89
- * This function is used to save Vendor inventory
90
- * @param array $val
91
- * @return array $msg
92
- */
93
- protected function saveLbInventory($val, $buffer)
94
  {
95
- if(!is_numeric($val['cost']) || $val['cost'] < 0){
96
- $ignoreData[]= 'cost';
 
 
 
 
97
  }
98
- if(!is_numeric($val['stock']) || $val['stock'] < 0){
99
- $ignoreData[]= 'stock';
100
  }
101
- $arrayUpdate1 = array();
102
- $arrayUpdate1['cost'] = $val['cost'];
103
- $arrayUpdate1['stock']= $val['stock'];
104
- $costFlag = true;
105
- $stockFlag = true;
106
 
107
- if(!is_numeric($val['stock']) || $val['stock'] < 0 || trim($val['stock']) == "")
108
  {
109
- $stockFlag = false;
 
 
110
  }
111
 
112
- if(!is_numeric($val['cost']) || $val['cost'] < 0 || trim($val['cost']) == "")
 
113
  {
114
- $costFlag = false;
115
- }
116
-
117
- $checkVendorCode = trim($val['lb_vendor_code']);
118
- $checkProductSku = trim($val['product_sku']);
119
- if(empty($val['product_sku']) && empty($val['lb_vendor_sku'])){
120
- return $msg = 'Please provide the Supplier SKU or Product SKU details';
121
- }
122
-
123
- if(empty($checkVendorCode)){
124
- return $msg = 'Error In Importing "lb_vendor_code" Cannot Be Empty';
125
- }
126
-
127
- if(!empty($buffer)){
128
- if($buffer > $val['stock']){
129
- $val['stock'] = 0;
130
- }else{
131
- $val['stock'] = $val['stock'] - $buffer;
132
- }
133
- }
134
-
135
- $dataCollection = Mage::getModel('logicbroker/inventory');
136
- $vendorObject = Mage::getModel('logicbroker/ranking');
137
- $vendorCollection = $vendorObject->load($val['lb_vendor_code'],'lb_vendor_code');
138
- $lb_vendor_sku = trim($val['lb_vendor_sku']);
139
  if($lb_vendor_sku != ''){
140
  $collection = $dataCollection->getCollection()->addFieldToFilter('lb_vendor_code',$val['lb_vendor_code'])->addFieldToFilter('lb_vendor_sku',$lb_vendor_sku);
141
- $cntCollection = $collection->count();
142
- if($cntCollection == 0 && $checkProductSku != ''){
143
  if(!(Mage::getModel('catalog/product')->getIdBySku($val['product_sku']))){
144
- return $msg = 'Can not import Supplier inventory for non-existing product';
 
145
  }
146
- $collection = $dataCollection->getCollection()->addFieldToFilter('lb_vendor_code',$val['lb_vendor_code'])->addFieldToFilter('product_sku',$checkProductSku);
147
  }
148
  }
149
  else{
150
- if($checkProductSku != ''){
151
  if(!(Mage::getModel('catalog/product')->getIdBySku($val['product_sku']))){
152
- return $msg = 'Can not import Supplier inventory for non-existing product';
 
153
  }
154
  $collection = $dataCollection->getCollection()->addFieldToFilter('lb_vendor_code',$val['lb_vendor_code'])->addFieldToFilter('product_sku',$val['product_sku']);
155
  } else{
156
- return $msg = 'Can not import Supplier inventory for blank product sku';
157
- }
158
- }
159
- $product_sku = $collection->getFirstItem()->getProductSku();
160
-
161
- /* LBN - 935 change */
162
- $val['stock'] = Mage::helper('logicbroker')->getIsQtyDecimal($product_sku,$val['stock']);
163
-
164
- $collectionCount = $collection->getSize();
165
- if($collectionCount >= 2 && empty($checkProductSku))
166
- {
167
- return $msg = 'Multiple records found. Please provide Product SKU';
168
  }
169
- if($collection->getSize() > 0){
170
- $collection->getFirstItem ()->setUpdatedAt(now());
171
- if($stockFlag == true){
172
- $collection->getFirstItem ()->setStock($val['stock']);
173
  }
174
 
175
- if($costFlag == true){
176
- $collection->getFirstItem ()->setCost($val['cost']);
177
- }
178
- $arrayUpdate2 = array('updated_by'=>'system','product_sku'=>$product_sku,'lb_vendor_code'=>$val['lb_vendor_code']);
179
- $arrayUpdate = array_merge($arrayUpdate1, $arrayUpdate2);
180
  if(count($ignoreData)>0){
181
  if(in_array('stock', $ignoreData)) {
182
  $msg = 'Cost Updated Successfully, Stock Ignored due to invalid data for';
@@ -195,14 +157,56 @@ class Logicbroker_Dropship360_Model_Inventory extends Mage_Core_Model_Abstract
195
  $msg = 'Cost & Stock Updated Successfully for';
196
  $type = 'update';
197
  }
198
- $this->_saveInventoryLog($type,$arrayUpdate);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
199
  if(count($ignoreData)!=2){
200
  $collection->getFirstItem ()->save();
201
  $this->_updateVendorList($vendorCollection,$val,false);
202
  }
203
- return $msg;
204
  }else{
205
- return 'Vendor Sku '.$val['lb_vendor_sku'].' and Magento SKU '.$val['product_sku'].' combination odes not exist for vendor ';
206
  }
207
  }
208
 
@@ -251,7 +255,7 @@ class Logicbroker_Dropship360_Model_Inventory extends Mage_Core_Model_Abstract
251
  //patch for unique combination keys vendor_code and vendor_sku
252
  if($this->checkCodeSkuCombination($data['lb_vendor_code'],$data['lb_vendor_sku']) > 0 )
253
  {
254
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('logicbroker')->__('Duplicate entry found for %s , %s',$data['lb_vendor_code'],$data['lb_vendor_sku']));
255
  $errorArr[] = 'yes';
256
  }else{
257
  $errorArr[] = 'no';
@@ -260,7 +264,7 @@ class Logicbroker_Dropship360_Model_Inventory extends Mage_Core_Model_Abstract
260
  $isUnique = (array_unique($arrVendorCode) == $arrVendorCode);
261
  $isEntrySame = $isUnique ? false : true;
262
  if($isEntrySame)
263
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('logicbroker')->__('Duplicate Supplier Entry'));
264
  $isUniqueCombination = in_array('yes',$errorArr);
265
  }
266
  //patch for unique combination keys vendor_code and vendor_sku
@@ -275,7 +279,7 @@ class Logicbroker_Dropship360_Model_Inventory extends Mage_Core_Model_Abstract
275
  }
276
 
277
  protected function _addNewInventoryVendor($request,$productSku){
278
- $vendorCollection = Mage::getModel('logicbroker/ranking')->load($request['lb_vendor_code'],'lb_vendor_code');
279
  $request['created_at'] = now();
280
  $request['updated_at'] = now();
281
  $request['product_sku'] = $productSku;
@@ -283,7 +287,7 @@ class Logicbroker_Dropship360_Model_Inventory extends Mage_Core_Model_Abstract
283
  $request['lb_vendor_name'] = $vendorCollection->getLbVendorName();
284
  $request['lb_vendor_sku'] = trim($request['lb_vendor_sku']);
285
  if(!empty($productSku)){
286
- $qty = Mage::helper('logicbroker')->getIsQtyDecimal($productSku, $request['stock']);
287
  }
288
  else{
289
  $qty = $request['stock'];
@@ -294,7 +298,7 @@ class Logicbroker_Dropship360_Model_Inventory extends Mage_Core_Model_Abstract
294
  $this->save();
295
  $this->_saveInventoryLog('add',$request);
296
  $this->_productInventoryAdd = $this->_productInventoryAdd + $request['stock'];
297
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('logicbroker')->__('%s Added Successfully ',$request['lb_vendor_name']));
298
  }catch(Exception $e){
299
  Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
300
  }
@@ -312,13 +316,13 @@ class Logicbroker_Dropship360_Model_Inventory extends Mage_Core_Model_Abstract
312
  $request['lb_vendor_sku'] = trim($request['lb_vendor_sku']);
313
  if(!empty($productSku)){
314
  $this->_stockBeforeQtyDecimalCheck = $request['stock'];
315
- $request['stock'] = Mage::helper('logicbroker')->getIsQtyDecimal($productSku, $request['stock']);
316
  }
317
 
318
  if($DbValues['lb_vendor_sku'] != $request['lb_vendor_sku']){
319
  //patch for unique combination keys vendor_code and vendor_sku
320
  if($this->checkCodeSkuCombination($vendorCode,$request['lb_vendor_sku']) > 0){
321
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('logicbroker')->__('Duplicate entry found for %s , %s',$vendorCode,$request['lb_vendor_sku']));
322
  return false;
323
  }
324
  }
@@ -332,7 +336,7 @@ class Logicbroker_Dropship360_Model_Inventory extends Mage_Core_Model_Abstract
332
  $this->_saveInventoryLog('update',array('updated_by'=>Mage::getSingleton('admin/session')->getUser()->getUsername(),'product_sku'=>$model->getProductSku(),'lb_vendor_code'=>$model->getLbVendorCode(),'cost'=>$model->getCost(),'stock'=>$model->getStock()));
333
  $this->_productInventoryUpdate = $this->_productInventoryUpdate + $request['stock'];
334
 
335
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('logicbroker')->__('%s Updated Successfully',$vendorName));
336
  }catch(Exception $e){
337
  Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
338
  }
@@ -345,26 +349,26 @@ class Logicbroker_Dropship360_Model_Inventory extends Mage_Core_Model_Abstract
345
  protected function _deleteInvendorVendor($vendorId){
346
  $model = $this->load($vendorId);
347
  $vendorCode = $model->getLbVendorCode();
348
- $vendorCollection = Mage::getModel('logicbroker/ranking')->load($vendorCode,'lb_vendor_code');
349
  $request = array('lb_vendor_name'=>$vendorCollection->getLbVendorName(),'updated_by'=>Mage::getSingleton('admin/session')->getUser()->getUsername(),'product_sku'=>$model->getProductSku(),'lb_vendor_code'=>$model->getLbVendorCode(),'cost'=>$model->getCost(),'stock'=>$model->getStock(),'updated_at' => now());
350
  try{
351
  $model->delete();
352
  $this->_saveInventoryLog('delete',$request);
353
  $this->_productInventorySubtract = $this->_productInventorySubtract + $request['stock'];
354
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('logicbroker')->__('%s Deleted Successfully ',$request['lb_vendor_name']));
355
  }catch(Exception $e){
356
  Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
357
  }
358
  }
359
 
360
  public function _saveInventoryLog($type,$request){
361
- $modelLog = Mage::getModel('logicbroker/inventorylog');
362
  $request['activity'] = $type;
363
  if($type=='add')
364
  $request['created_at'] = now();
365
  $request['updated_at'] = now();
366
  if(!isset($request['lb_vendor_name'])){
367
- $vendorRankModel = Mage::getModel('logicbroker/ranking')->load($request['lb_vendor_code'],'lb_vendor_code');
368
  $request['lb_vendor_name'] = $vendorRankModel->getLbVendorName();
369
  }
370
  $modelLog->setData($request);
@@ -409,6 +413,54 @@ class Logicbroker_Dropship360_Model_Inventory extends Mage_Core_Model_Abstract
409
  }
410
  return $finalStock;
411
  }
412
-
413
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
414
  }
13
  protected $_productInventorySubtract = 0;
14
  protected $_productInventoryUpdate = 0;
15
  protected $_stockBeforeQtyDecimalCheck = '';
16
+ protected $_iserror = true;
17
+ protected $_errorMsg = '';
18
  protected function _construct()
19
  {
20
+ $this->_init("dropship360/inventory");
21
  }
22
 
23
  public function prepareInventoryTable($restReqest)
29
 
30
  protected function updateProductStock()
31
  {
32
+ $dataCollection = Mage::getModel('dropship360/inventory')->getCollection();
33
  $stockData = array();
34
  if($dataCollection->count() < 0){
35
  return;
66
  try {
67
  $stockItem->save();
68
  } catch (Exception $e) {
69
+ Mage::helper('dropship360')->genrateLog(0,'mgento inventory update started','mgento inventory update ended','Section :Error In Setting/update magento inventory: '.$e->getMessage().' sku : '.$sku);
70
  echo $e->getMessage();
71
  }
72
  }
77
  protected function prepareData($restReqest)
78
  {
79
  $result = array();
80
+ $buffer = trim(Mage::getStoreConfig('logicbroker_sourcing/inventory/buffer'));
81
+ $vendorModel = Mage::getModel('dropship360/ranking')->getCollection();
82
  foreach ($restReqest as $value) {
83
  foreach ($value as $key=>$val) {
84
  $result[$val['lb_vendor_code']] = $this->saveLbInventory($val, $buffer);
87
  return $result;
88
  }
89
 
90
+ protected function validateRowData($val)
 
 
 
 
 
91
  {
92
+ if(empty($val['product_sku']) && empty($val['lb_vendor_sku'])){
93
+ $this->_errorMsg = 'Please provide the Supplier SKU or Product SKU details';
94
+ $this->_iserror = false;
95
+ }elseif(empty($val['lb_vendor_code'])){
96
+ $this->_errorMsg = 'Error In Importing "lb_vendor_code" Cannot Be Empty';
97
+ $this->_iserror = false;
98
  }
99
+ return $this->_iserror;
 
100
  }
 
 
 
 
 
101
 
102
+ protected function updateStock($val,$buffer)
103
  {
104
+ if(!empty($buffer))
105
+ ($buffer > $val['stock']) ? $val['stock'] = 0 : $val['stock'] = $val['stock'] - $buffer;
106
+ return $val['stock'];
107
  }
108
 
109
+
110
+ protected function _prepareCollection($val)
111
  {
112
+ $dataCollection = Mage::getModel('dropship360/inventory');
113
+ $collection = null;
114
+ $lb_vendor_sku = $val['lb_vendor_sku'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  if($lb_vendor_sku != ''){
116
  $collection = $dataCollection->getCollection()->addFieldToFilter('lb_vendor_code',$val['lb_vendor_code'])->addFieldToFilter('lb_vendor_sku',$lb_vendor_sku);
117
+ if($collection->getSize() == 0 && $val['product_sku'] != ''){
 
118
  if(!(Mage::getModel('catalog/product')->getIdBySku($val['product_sku']))){
119
+ $this->_errorMsg = 'Can not import Supplier inventory for non-existing product';
120
+ return $collection;
121
  }
122
+ $collection = $dataCollection->getCollection()->addFieldToFilter('lb_vendor_code',$val['lb_vendor_code'])->addFieldToFilter('product_sku',$val['product_sku']);
123
  }
124
  }
125
  else{
126
+ if($val['product_sku'] != ''){
127
  if(!(Mage::getModel('catalog/product')->getIdBySku($val['product_sku']))){
128
+ $this->_errorMsg = 'Can not import Supplier inventory for non-existing product';
129
+ return $collection;
130
  }
131
  $collection = $dataCollection->getCollection()->addFieldToFilter('lb_vendor_code',$val['lb_vendor_code'])->addFieldToFilter('product_sku',$val['product_sku']);
132
  } else{
133
+ $this->_errorMsg = 'Can not import Supplier inventory for blank product sku';
134
+ return $collection;
135
+ }
 
 
 
 
 
 
 
 
 
136
  }
137
+ return $collection;
 
 
 
138
  }
139
 
140
+ protected function getLogMsg($ignoreData)
141
+ {
 
 
 
142
  if(count($ignoreData)>0){
143
  if(in_array('stock', $ignoreData)) {
144
  $msg = 'Cost Updated Successfully, Stock Ignored due to invalid data for';
157
  $msg = 'Cost & Stock Updated Successfully for';
158
  $type = 'update';
159
  }
160
+ return array('msg'=>$msg,'type'=>$type);
161
+ }
162
+
163
+ /**
164
+ * This function is used to save Vendor inventory
165
+ * @param array $val
166
+ * @return array $msg
167
+ */
168
+ protected function saveLbInventory($rowVal, $buffer)
169
+ {
170
+ $val = array_map('trim',$rowVal);
171
+ $originalStock = $val['stock'];
172
+ $vendorObject = Mage::getModel('dropship360/ranking');
173
+ $vendorCollection = $vendorObject->load($val['lb_vendor_code'],'lb_vendor_code');
174
+ if(!$this->validateRowData($val))
175
+ {
176
+ return $this->_errorMsg;
177
+ }
178
+
179
+ $ignoreData = array();
180
+ (!is_numeric($val['cost']) || $val['cost'] < 0) ? $ignoreData[]= 'cost' : '';
181
+ (!is_numeric($val['stock']) || $val['stock'] < 0) ? $ignoreData[]= 'stock' : '';
182
+ (!is_numeric($val['stock']) || $val['stock'] < 0 || $val['stock'] == "") ? $stockFlag = false : $stockFlag = true;
183
+ (!is_numeric($val['cost']) || $val['cost'] < 0 || $val['cost'] == "") ? $costFlag = false : $costFlag = true;
184
+ $val['stock'] = $this->updateStock($val,$buffer);
185
+ $collection = $this->_prepareCollection($val);
186
+ if(is_null($collection)){
187
+ return $this->_errorMsg;
188
+ }
189
+ $product_sku = $collection->getFirstItem()->getProductSku();
190
+ /* LBN - 935 change */
191
+ $val['stock'] = Mage::helper('dropship360')->getIsQtyDecimal($product_sku,$val['stock']);
192
+ if($collection->getSize() >= 2 && empty($val['product_sku']))
193
+ {
194
+ return 'Multiple records found. Please provide Product SKU';
195
+ }
196
+ if($collection->getSize() > 0){
197
+ $collection->getFirstItem ()->setUpdatedAt(now());
198
+ ($stockFlag == true) ? $collection->getFirstItem ()->setStock($val['stock']) : '';
199
+ ($costFlag == true) ? $collection->getFirstItem ()->setCost($val['cost']) : '';
200
+ $arrayUpdate = array('updated_by'=>'system','product_sku'=>$product_sku,'lb_vendor_code'=>$val['lb_vendor_code'],'cost'=>$val['cost'],'stock'=>$originalStock);
201
+ $logDetail = $this->getLogMsg($ignoreData);
202
+ $this->_saveInventoryLog($logDetail['type'],$arrayUpdate);
203
  if(count($ignoreData)!=2){
204
  $collection->getFirstItem ()->save();
205
  $this->_updateVendorList($vendorCollection,$val,false);
206
  }
207
+ return $logDetail['msg'];
208
  }else{
209
+ return 'Vendor Sku "'.$val['lb_vendor_sku'].'" and Magento SKU "'.$val['product_sku'].'" combination does not exist for vendor ';
210
  }
211
  }
212
 
255
  //patch for unique combination keys vendor_code and vendor_sku
256
  if($this->checkCodeSkuCombination($data['lb_vendor_code'],$data['lb_vendor_sku']) > 0 )
257
  {
258
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship360')->__('Duplicate entry found for %s , %s',$data['lb_vendor_code'],$data['lb_vendor_sku']));
259
  $errorArr[] = 'yes';
260
  }else{
261
  $errorArr[] = 'no';
264
  $isUnique = (array_unique($arrVendorCode) == $arrVendorCode);
265
  $isEntrySame = $isUnique ? false : true;
266
  if($isEntrySame)
267
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship360')->__('Duplicate Supplier Entry'));
268
  $isUniqueCombination = in_array('yes',$errorArr);
269
  }
270
  //patch for unique combination keys vendor_code and vendor_sku
279
  }
280
 
281
  protected function _addNewInventoryVendor($request,$productSku){
282
+ $vendorCollection = Mage::getModel('dropship360/ranking')->load($request['lb_vendor_code'],'lb_vendor_code');
283
  $request['created_at'] = now();
284
  $request['updated_at'] = now();
285
  $request['product_sku'] = $productSku;
287
  $request['lb_vendor_name'] = $vendorCollection->getLbVendorName();
288
  $request['lb_vendor_sku'] = trim($request['lb_vendor_sku']);
289
  if(!empty($productSku)){
290
+ $qty = Mage::helper('dropship360')->getIsQtyDecimal($productSku, $request['stock']);
291
  }
292
  else{
293
  $qty = $request['stock'];
298
  $this->save();
299
  $this->_saveInventoryLog('add',$request);
300
  $this->_productInventoryAdd = $this->_productInventoryAdd + $request['stock'];
301
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('dropship360')->__('%s Added Successfully ',$request['lb_vendor_name']));
302
  }catch(Exception $e){
303
  Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
304
  }
316
  $request['lb_vendor_sku'] = trim($request['lb_vendor_sku']);
317
  if(!empty($productSku)){
318
  $this->_stockBeforeQtyDecimalCheck = $request['stock'];
319
+ $request['stock'] = Mage::helper('dropship360')->getIsQtyDecimal($productSku, $request['stock']);
320
  }
321
 
322
  if($DbValues['lb_vendor_sku'] != $request['lb_vendor_sku']){
323
  //patch for unique combination keys vendor_code and vendor_sku
324
  if($this->checkCodeSkuCombination($vendorCode,$request['lb_vendor_sku']) > 0){
325
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship360')->__('Duplicate entry found for %s , %s',$vendorCode,$request['lb_vendor_sku']));
326
  return false;
327
  }
328
  }
336
  $this->_saveInventoryLog('update',array('updated_by'=>Mage::getSingleton('admin/session')->getUser()->getUsername(),'product_sku'=>$model->getProductSku(),'lb_vendor_code'=>$model->getLbVendorCode(),'cost'=>$model->getCost(),'stock'=>$model->getStock()));
337
  $this->_productInventoryUpdate = $this->_productInventoryUpdate + $request['stock'];
338
 
339
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('dropship360')->__('%s Updated Successfully',$vendorName));
340
  }catch(Exception $e){
341
  Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
342
  }
349
  protected function _deleteInvendorVendor($vendorId){
350
  $model = $this->load($vendorId);
351
  $vendorCode = $model->getLbVendorCode();
352
+ $vendorCollection = Mage::getModel('dropship360/ranking')->load($vendorCode,'lb_vendor_code');
353
  $request = array('lb_vendor_name'=>$vendorCollection->getLbVendorName(),'updated_by'=>Mage::getSingleton('admin/session')->getUser()->getUsername(),'product_sku'=>$model->getProductSku(),'lb_vendor_code'=>$model->getLbVendorCode(),'cost'=>$model->getCost(),'stock'=>$model->getStock(),'updated_at' => now());
354
  try{
355
  $model->delete();
356
  $this->_saveInventoryLog('delete',$request);
357
  $this->_productInventorySubtract = $this->_productInventorySubtract + $request['stock'];
358
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('dropship360')->__('%s Deleted Successfully ',$request['lb_vendor_name']));
359
  }catch(Exception $e){
360
  Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
361
  }
362
  }
363
 
364
  public function _saveInventoryLog($type,$request){
365
+ $modelLog = Mage::getModel('dropship360/inventorylog');
366
  $request['activity'] = $type;
367
  if($type=='add')
368
  $request['created_at'] = now();
369
  $request['updated_at'] = now();
370
  if(!isset($request['lb_vendor_name'])){
371
+ $vendorRankModel = Mage::getModel('dropship360/ranking')->load($request['lb_vendor_code'],'lb_vendor_code');
372
  $request['lb_vendor_name'] = $vendorRankModel->getLbVendorName();
373
  }
374
  $modelLog->setData($request);
413
  }
414
  return $finalStock;
415
  }
416
+ /* method use to send email notification to logicbroker
417
+ * that first vendor has been added to logicbroker_vendor_inventory
418
+ */
419
+ protected function _afterSave()
420
+ {
421
+ $colSize = $this->getCollection()->getSize();
422
+ $notifyVs = Mage::getStoreConfigFlag('logicbroker/notification/vendor_setup');
423
+ if($colSize == 1 && !$notifyVs)
424
+ {
425
+ $this->sendVendorNotification();
426
+ Mage::getModel('dropship360/logicbroker')->saveNotificationValue(1,'logicbroker/notification/vendor_setup');
427
+ }
428
+ parent::_afterSave();
429
+ return;
430
+ }
431
+
432
+ protected function sendVendorNotification(){
433
+
434
+ try {
435
+ $fieldsetData['subject'] = 'DS360 Product Setup completed on Magento';
436
+ $postObject = new Varien_Object();
437
+ $postObject->setData($fieldsetData);
438
+ $templateId = 'logicbroker_productsetup_notification';
439
+ $email = Mage::helper('dropship360')->getConfigObject('apiconfig/email/toaddress');
440
+ $isMailSent = Mage::helper('dropship360')->sendMail($postObject,$email,$templateId);
441
+ if (!$isMailSent) {
442
+ Mage::helper('dropship360')->genrateLog(0,'Order notification started','Order notification ended','First product setup complete successfully but email sending failed');
443
+ }
444
+ return true;
445
+ } catch (Exception $e) {
446
+ return false;//$e->getMassage();
447
+ }
448
+ }
449
+ public function upDateVendorName($vendor){
450
+ if(empty($vendor['code']) || empty($vendor['name']))
451
+ {
452
+ return;
453
+ }
454
+ $table = Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship360/inventory' );
455
+ $update = 'UPDATE '.$table.' SET lb_vendor_name = "'.$vendor['name'].'" WHERE lb_vendor_code = "'.$vendor['code'].'"';
456
+ $conObj = Mage::getSingleton ( 'core/resource' )->getConnection('core_write');
457
+ $conObj->beginTransaction();
458
+ $conObj->query($update);
459
+ try {
460
+ $conObj->commit ();
461
+ } catch ( Exception $e ) {
462
+ $conObj->rollBack ();
463
+ Mage::getSingleton ( 'adminhtml/session' )->addError($e->getMessage ());
464
+ }
465
+ }
466
  }
includes/src/Logicbroker_Dropship360_Model_Inventorylog.php CHANGED
@@ -11,7 +11,7 @@ class Logicbroker_Dropship360_Model_Inventorylog extends Mage_Core_Model_Abstrac
11
  {
12
  protected function _construct(){
13
 
14
- $this->_init("logicbroker/inventorylog");
15
  }
16
  }
17
 
11
  {
12
  protected function _construct(){
13
 
14
+ $this->_init("dropship360/inventorylog");
15
  }
16
  }
17
 
includes/src/Logicbroker_Dropship360_Model_Logicbroker.php CHANGED
@@ -16,13 +16,15 @@ class Logicbroker_Dropship360_Model_Logicbroker {
16
  $roleName = 'logicbroker';
17
  $parentId = '';
18
  $roleType = 'G';
19
- $ruleNodes = array();
 
20
 
21
  if (!is_array($fieldsetData)) {
22
  return false;
23
  }
24
  $role->load($roleName, 'role_name');
25
- $ruleNodes = array('all');
 
26
  try {
27
  $role = $role->setName($roleName)
28
  ->setPid($parentId)
@@ -157,28 +159,75 @@ class Logicbroker_Dropship360_Model_Logicbroker {
157
 
158
  public function send($attachment = null,$fieldsetData) {
159
  try {
160
-
161
- $fieldsetData['isnewreg'] = true;
162
- $postObject = new Varien_Object();
163
- $postObject->setData($fieldsetData);
164
- $mailTemplate = Mage::getModel('core/email_template');
165
- /* @var $mailTemplate Mage_Core_Model_Email_Template */
166
- $mailTemplate->setDesignConfig(array('area' => 'frontend'))
167
- ->sendTransactional(
168
- 'logicbroker_email_email_template',
169
- 'general',
170
- Mage::helper('logicbroker')->getConfigObject('apiconfig/email/toaddress'),
171
- Mage::helper('logicbroker')->getConfigObject('apiconfig/email/toname'),
172
- array('templatevar' => $postObject)
173
- );
174
- if (!$mailTemplate->getSentSuccess()) {
175
- Mage::helper('logicbroker')->genrateLog(0,'Installation notification started','Installation notification ended','Module installation notifiaction mail sending failed');
176
- return false;
177
- }
178
- return true;
179
  } catch (Exception $e) {
180
  return false;//$e->getMassage();
181
  }
182
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183
 
184
  }
16
  $roleName = 'logicbroker';
17
  $parentId = '';
18
  $roleType = 'G';
19
+ $definedRole = Mage::helper('dropship360')->getConfigObject('apiconfig/soap_role');
20
+ $ruleNodes = (!empty($definedRole)) ? explode(',',$definedRole) : array('all');
21
 
22
  if (!is_array($fieldsetData)) {
23
  return false;
24
  }
25
  $role->load($roleName, 'role_name');
26
+ //$ruleNodes = array('all');
27
+ //$ruleNodes = $definedRole;
28
  try {
29
  $role = $role->setName($roleName)
30
  ->setPid($parentId)
159
 
160
  public function send($attachment = null,$fieldsetData) {
161
  try {
162
+ $fieldsetData['isnewreg'] = true;
163
+ $version = Mage::helper('dropship360')->getConfigObject('default/logicbroker_integration/integration/ds360_version');
164
+ $fieldsetData['subject'] = 'New DS360 Package Extension version '.$version.' was installed';
165
+ $postObject = new Varien_Object();
166
+ $postObject->setData($fieldsetData);
167
+ $templateId = 'logicbroker_email_email_template';
168
+ $email = Mage::helper('dropship360')->getConfigObject('apiconfig/email/toaddress');
169
+ $isMailSent = Mage::helper('dropship360')->sendMail($postObject,$email,$templateId);
170
+ if (!$isMailSent) {
171
+ Mage::helper('dropship360')->genrateLog(0,'Installation notification started','Installation notification ended','Module installation notifiaction mail sending failed');
172
+ }
173
+ Mage::getSingleton('adminhtml/session')->unsNotification();
174
+ return true;
 
 
 
 
 
 
175
  } catch (Exception $e) {
176
  return false;//$e->getMassage();
177
  }
178
  }
179
+
180
+ public function prepareNotification($object,$orderId){
181
+ if($object == null || $orderId == null)
182
+ return;
183
+ $collection = $object->getCollection();
184
+ if($collection->getSize() == 0 )
185
+ $this->saveNotificationValue($orderId,'logicbroker/setup_notification/order');
186
+ }
187
+ public function saveNotificationValue($value = null,$path){
188
+ $data = array(
189
+ 'scope' => 'default',
190
+ 'scope_id' => '0',
191
+ 'path' => $path,
192
+ 'value' => $value,
193
+ );
194
+ try{
195
+ Mage::getModel('core/config_data')->load($data['path'],'path');
196
+ Mage::getModel('core/config_data')->setData($data)->save();
197
+ }catch(Exception $e){
198
+ return false;
199
+ }
200
+ }
201
+
202
+ public function setupNotification()
203
+ {
204
+ $order = Mage::getStoreConfig('logicbroker/setup_notification/order');
205
+
206
+ if($order)
207
+ {
208
+ $inventory = Mage::getModel('dropship360/orderitems')->getCollection()->addFieldToFilter('item_order_id',$order)->addFieldToFilter('lb_item_status','Transmitting');
209
+ if($inventory->getSize() > 0){
210
+
211
+ try {
212
+ $fieldsetData['order'] = Mage::getModel('sales/order')->load($order);
213
+ $fieldsetData['subject'] = 'DS360 Order has been Placed on Magento';
214
+ $postObject = new Varien_Object();
215
+ $postObject->setData($fieldsetData);
216
+ $templateId = 'logicbroker_order_notification';
217
+ $email = Mage::helper('dropship360')->getConfigObject('apiconfig/email/toaddress');
218
+ $isMailSent = Mage::helper('dropship360')->sendMail($postObject,$email,$templateId);
219
+ if (!$isMailSent) {
220
+ Mage::helper('dropship360')->genrateLog(0,'Order notification started','Order notification ended','First order goes to transmitting successfully email sending failed');
221
+ }
222
+ $this->saveNotificationValue(null,'logicbroker/setup_notification/order');
223
+ return true;
224
+ } catch (Exception $e) {
225
+ return false;//$e->getMassage();
226
+ }
227
+
228
+ }
229
+
230
+ }
231
+ }
232
 
233
  }
includes/src/Logicbroker_Dropship360_Model_Observer.php CHANGED
@@ -13,9 +13,12 @@ class Logicbroker_Dropship360_Model_Observer {
13
  const XML_PATH_LOGICBROKER_ORDER_BEGIN_SOURCING_STATUS = 'Reprocess';
14
  const XML_PATH_LOGICBROKER_ORDER_BACKORDERED = 'Backorder';
15
  const XML_PATH_LOGICBROKER_EMAIL_SHIPMENT = 'logicbroker_sourcing/rank/email_shipment';
16
- const STATUS_RUNNING = 'running';
17
- const STATUS_SUCCESS = 'success';
 
 
18
  protected $_orderStatus;
 
19
 
20
  public static function getWorkingDir()
21
  {
@@ -31,18 +34,19 @@ class Logicbroker_Dropship360_Model_Observer {
31
  if(in_array($item->getProductType(),array('simple','grouped')) ){
32
  $started = 0;
33
  $ended = 1;
34
- $logMsg = 'Item inserted @'.Mage::getSingleton ( 'core/resource' )->getTableName ( 'logicbroker/orderitems' ). ' sku : '.$item->getSku().','.$object->getOrder()->getIncrementId();
35
- Mage::helper('logicbroker')->genrateLog(++$started,'Order Item Inserted Started',null,$logMsg);
36
  $this->getOrderSourcing($item, $object);
37
- Mage::helper('logicbroker')->genrateLog(++$ended,null,'Order Item Inserted Ended',null);
38
  }
39
  }
40
  }
41
 
42
  protected function getOrderSourcing($item, $object){
43
- $orderSourcingInstance = Mage::getModel ( 'logicbroker/orderitems' );
 
44
  $orderStatus = $object->getOrder()->getStatus();
45
- $itemStatusHistory = Mage::helper('logicbroker')->getSerialisedData($orderSourcingInstance, 'Sourcing', $orderStatus);
46
  $orderSourcingInstance->setSku ( $item->getSku() );
47
  $orderSourcingInstance->setItemId ( $item->getItemId() );
48
  $orderSourcingInstance->setItemOrderId ( $object->getOrder()->getEntityId() );
@@ -53,37 +57,55 @@ class Logicbroker_Dropship360_Model_Observer {
53
  try {
54
  $orderSourcingInstance->save ();
55
  } catch ( Execption $e ) {
56
- Mage::helper('logicbroker')->genrateLog(0,null,null,'Section : order item inserted Error: '.$e->getMessage().' sku : '.$item->getSku());
57
  echo $e->getMessage();
58
  }
59
 
60
- //As item get saved in logicbroker_sales_orders_items we run our sourcing logic
61
- $assigned = $this->assignToVendor($item);
62
-
 
 
 
63
  }
64
 
65
  public function logicbrokerSourcing() {
 
66
  if(!Mage::getStoreConfig(self::CRON_STRING_PATH_SOURCING)) {
67
- Mage::helper('logicbroker')->genrateLog(0,'Sourcing started','Sourcing started','Sourcing can not be started as cron time not set');
 
 
 
 
 
68
  return;
69
  }
70
- Mage::helper('logicbroker')->genrateLog(1,'Sourcing Started for '.Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_REPROCESS.' Item status',null,null);
71
- $this->setLbVendorRanking (Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_REPROCESS);
 
72
  $this->addCronStatus('logicbroker_sourcing/cron_settings/dispaly_sourcing_updated_time', Mage::helper('core')->formatDate(now(), 'medium', true));
73
- Mage::helper('logicbroker')->genrateLog(2,null,'Sourcing Ended for ' .Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_REPROCESS.' Item status',null);
 
74
  return;
75
  }
76
 
77
  public function logicbrokerBackorder()
78
  {
 
79
  if(!Mage::getStoreConfig(self::CRON_STRING_PATH_BACKORDER)) {
80
- Mage::helper('logicbroker')->genrateLog(0,'Backorder sourcing started','Backorder sourcing ended','Backorder Sourcing can not be started as cron time not set');
81
  return;
82
  }
83
- Mage::helper('logicbroker')->genrateLog(1,'Backorder Sourcing Started for '.Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_BACKORDER . ' item status',null,null);
84
- $this->setLbVendorRanking (Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_BACKORDER,true);
 
 
 
 
 
85
  $this->addCronStatus('logicbroker_sourcing/cron_settings/display_backorder_updated_time', Mage::helper('core')->formatDate(now(), 'medium', true));
86
- Mage::helper('logicbroker')->genrateLog(1,'Backorder Sourcing Ended for '.Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_BACKORDER .' item status',null,null);
 
87
  return;
88
  }
89
 
@@ -99,45 +121,38 @@ class Logicbroker_Dropship360_Model_Observer {
99
  return;
100
  }
101
 
102
- protected function setLbVendorRanking($crontype,$isBackorderedCron = false)
103
  {
104
  $reprocess = Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_REPROCESS;
105
- $lbOrderInstances = Mage::getModel('logicbroker/ordersourcing');
106
- $collection = $lbOrderInstances->prepareItemCollection($crontype);
107
- if($collection->count() > 0 ){
108
- foreach ( $collection as $orderData ) {
109
- $orderCollection = Mage::getModel('sales/order')->Load($orderData->getItemOrderId());
110
-
111
- Mage::helper('logicbroker')->genrateLog(0,null,null,'<---->Item Processing Started : '.$orderData->getSku());
112
-
 
 
 
 
 
113
  if ($crontype == Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_REPROCESS) {
114
-
115
- //Patch : skip sourcing process if order is deleted
116
- if (! $orderCollection->getEntityId ()) {
117
- Mage::helper ( 'logicbroker' )->genrateLog ( 0, null, null, 'Order not exists for => order_id: ' . $orderData->getItemOrderId () . ' hence cannot continue' );
118
- continue;
119
- }
120
- $this->_orderStatus = $orderCollection->getStatus();
121
  $assigned = $this->assignToVendor(Mage::getModel('sales/order_item')->Load($orderData->getItemId()));
122
- $orderCollection->addStatusHistoryComment($orderData->getSku().': Item status changed to '.$assigned);
123
-
124
  }else
125
- {
126
- $orderItems = Mage::getModel ( 'logicbroker/orderitems' )->load($orderData->getItemId(),'item_id');
127
- $itemStatusHistory = Mage::helper('logicbroker')->getSerialisedData($orderItems, $reprocess, $orderCollection->getStatus());
128
- $orderItems->setLbItemStatus ($reprocess)
129
- ->setitemStatusHistory($itemStatusHistory)
130
- ->save();
131
- $orderCollection->addStatusHistoryComment($orderData->getSku().': Item status changed to '.$reprocess);
132
-
133
  }
134
- $orderCollection->save();
135
- Mage::helper('logicbroker')->genrateLog(0,null,null,'####### Item Processing ended : '.$orderData->getSku());
136
 
137
-
 
 
138
  }
139
  }else {
140
- Mage::helper('logicbroker')->genrateLog(0,null,null,'Order collection is empty for => Cron_type: '.$crontype.' hence cannot continue');
141
  return;
142
  }
143
  }
@@ -152,10 +167,11 @@ class Logicbroker_Dropship360_Model_Observer {
152
  $vendorCode = '';
153
  $inventoryStock = '';
154
  $defaultVendor = (Mage::getStoreConfig('logicbroker_sourcing/rank/defaultbackorder') == 'none') ? '' : Mage::getStoreConfig('logicbroker_sourcing/rank/defaultbackorder');
155
- $orderItemInstance = Mage::getModel ( 'logicbroker/orderitems' );
156
  $orderItemInstance->load ( $itemId, 'item_id' );
157
  $collectionVendor = $orderItemInstance->prepareOrderItemData($item);
158
  $arrDefaultVendorDetails = array();
 
159
 
160
  if ($collectionVendor->count () > 0) {
161
  if($collectionVendor->count () >= 1){
@@ -205,31 +221,69 @@ class Logicbroker_Dropship360_Model_Observer {
205
 
206
  if(!empty($vendorCode)){
207
  if ($vendorCode && $inventoryStock >= $qtyInvoiced) {
208
-
209
- $itemStatus = 'Transmitting';
210
- $itemStatusHistory = Mage::helper('logicbroker')->getSerialisedData($orderItemInstance, $itemStatus, $this->_orderStatus);
211
- $orderItemInstance->setItemData($orderItemInstance,$itemStatusComplete,$item,$vendorCode,$vendorCost*$qtyInvoiced,$vendorSku,$itemStatusHistory);
212
- $orderItemInstance->updateLbVendorInvenory ( $vendorCode, $productSku,$qtyInvoiced );
213
- Mage::helper('logicbroker')->genrateLog(0,null,null,'@@@@@@@@ Sourcing Details==> stock('.$inventoryStock.') >= qtyinvoiced('.$qtyInvoiced.'),vendor_code ->'.$vendorCode.', item-status->'.$itemStatus);
 
 
 
 
 
 
 
 
 
214
  return $itemStatusComplete;
215
  }
216
  if ($isDefaultVendor && $inventoryStock <= $qtyInvoiced && !empty($defaultVendor) && in_array($defaultVendor,$arrVendorAvailable)) {
217
- $itemStatusHistory = Mage::helper('logicbroker')->getSerialisedData($orderItemInstance, 'Transmitting', $this->_orderStatus);
218
- $orderItemInstance->setItemData($orderItemInstance,$itemStatusComplete,$item,$defaultVendor,$arrDefaultVendorDetails['cost']*$qtyInvoiced,$arrDefaultVendorDetails['lb_vendor_sku'],$itemStatusHistory);
219
- Mage::helper('logicbroker')->genrateLog(0,null,null,'@@@@@@@@ Sourcing Details Default vendor set ==>stock('.$inventoryStock.') >= qtyinvoiced('.$qtyInvoiced.'),vendor_code ->'.$vendorCode.', item-status->Transmitting');
 
 
 
 
 
 
 
 
 
 
220
  return $itemStatusComplete;
221
  }
222
  if ($vendorCode && $inventoryStock <= $qtyInvoiced) {
223
- $itemStatus = 'Backorder';
224
- $itemStatusHistory =Mage::helper('logicbroker')->getSerialisedData($orderItemInstance, $itemStatus, $this->_orderStatus);
225
- $orderItemInstance->setItemData($orderItemInstance,$itemStatusBackorder,$item,$vendorCode,$vendorCost*$qtyInvoiced,$vendorSku,$itemStatusHistory);
226
- Mage::helper('logicbroker')->genrateLog(0,null,null,'@@@@@@@@ Sourcing Details==>stock('.$inventoryStock.') <= qtyinvoiced('.$qtyInvoiced.'),vendor_code ->'.$vendorCode.', item-status->'.$itemStatus);
 
 
 
 
 
 
 
 
 
227
  return $itemStatusBackorder;
228
  }
229
  }else{
230
- $itemStatusHistory = Mage::helper('logicbroker')->getSerialisedData($orderItemInstance,'No Dropship', $this->_orderStatus);
231
- $orderItemInstance->setItemData($orderItemInstance,'No Dropship',$item,$vendorCode,$qtyInvoiced,"",$itemStatusHistory);
232
- Mage::helper('logicbroker')->genrateLog(0,null,null,'@@@@@@@@ Sourcing Details==> No vendor Set ,vendor_code ->'.$vendorCode.', item-status->No Dropship');
 
 
 
 
 
 
 
 
 
 
233
  return $itemStatusNoDropShip;
234
  }
235
  }
@@ -259,14 +313,14 @@ class Logicbroker_Dropship360_Model_Observer {
259
  *
260
  */
261
  $customFieldValue = $this->_getRequest()->getPost('product');
262
- $result = Mage::getModel('logicbroker/inventory')->saveTabVendorData($customFieldValue);
263
 
264
  /**
265
  * Uncomment the line below to save the product
266
  *
267
  */
268
  //if(!$result)
269
- //Mage::getSingleton('adminhtml/session')->addError(Mage::helper('logicbroker')->__('Vendor Data Cannot be saved'));
270
 
271
  //$product->save();
272
 
@@ -287,7 +341,7 @@ class Logicbroker_Dropship360_Model_Observer {
287
  }
288
 
289
  $finalStock = $result['inventory'];
290
- $finalStock = Mage::helper('logicbroker')->getIsQtyDecimal($sku, $finalStock);
291
  $conn = Mage::getSingleton ( 'core/resource' )->getConnection ( 'core_write' );
292
 
293
  $tableNameStatus = Mage::getSingleton ( 'core/resource' )->getTableName ( 'cataloginventory/stock_status' );
@@ -405,11 +459,11 @@ class Logicbroker_Dropship360_Model_Observer {
405
  public function catalogProductDeleteAfter(Varien_Event_Observer $observer)
406
  {
407
  $deletedProductSku = $observer->getEvent()->getProduct()->getSku();
408
- $orderItem = Mage::getModel ('logicbroker/inventory')->getCollection()->addFieldToFilter('product_sku', $deletedProductSku);
409
  if($orderItem->getSize() > 0){
410
  foreach($orderItem as $data){
411
  try {
412
- Mage::getModel ('logicbroker/inventory')->load($data->getId())->delete();
413
  } catch (Exception $e) {
414
  Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
415
  }
@@ -417,4 +471,30 @@ class Logicbroker_Dropship360_Model_Observer {
417
  }
418
  return $this;
419
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
420
  }
13
  const XML_PATH_LOGICBROKER_ORDER_BEGIN_SOURCING_STATUS = 'Reprocess';
14
  const XML_PATH_LOGICBROKER_ORDER_BACKORDERED = 'Backorder';
15
  const XML_PATH_LOGICBROKER_EMAIL_SHIPMENT = 'logicbroker_sourcing/rank/email_shipment';
16
+ const XML_PATH_INVENTORY_NOTIFICATION_EMAIL = 'logicbroker_sourcing/inventory_notification/email';
17
+ const XML_PATH_INVENTORY_NOTIFICATION_EMAIL_ENABLED = 'logicbroker_sourcing/inventory_notification/enabled';
18
+ const XML_PATH_INVENTORY_NOTIFICATION_DAYS = 'logicbroker_sourcing/inventory_notification/days';
19
+ const XML_PATH_LOGICSOURCING_SOURCING_TYPE = 'logicbroker_sourcing/rank/sourcing_type';
20
  protected $_orderStatus;
21
+ protected $_itemData = array();
22
 
23
  public static function getWorkingDir()
24
  {
34
  if(in_array($item->getProductType(),array('simple','grouped')) ){
35
  $started = 0;
36
  $ended = 1;
37
+ $logMsg = 'Item inserted @'.Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship360/orderitems' ). ' sku : '.$item->getSku().','.$object->getOrder()->getIncrementId();
38
+ Mage::helper('dropship360')->genrateLog(++$started,'Order Item Inserted Started',null,$logMsg);
39
  $this->getOrderSourcing($item, $object);
40
+ Mage::helper('dropship360')->genrateLog(++$ended,null,'Order Item Inserted Ended',null);
41
  }
42
  }
43
  }
44
 
45
  protected function getOrderSourcing($item, $object){
46
+ $orderSourcingInstance = Mage::getModel ( 'dropship360/orderitems' );
47
+ Mage::getModel('dropship360/logicbroker')->prepareNotification($orderSourcingInstance,$object->getOrder()->getEntityId());
48
  $orderStatus = $object->getOrder()->getStatus();
49
+ $itemStatusHistory = Mage::helper('dropship360')->getSerialisedData($orderSourcingInstance, 'Sourcing', $orderStatus);
50
  $orderSourcingInstance->setSku ( $item->getSku() );
51
  $orderSourcingInstance->setItemId ( $item->getItemId() );
52
  $orderSourcingInstance->setItemOrderId ( $object->getOrder()->getEntityId() );
57
  try {
58
  $orderSourcingInstance->save ();
59
  } catch ( Execption $e ) {
60
+ Mage::helper('dropship360')->genrateLog(0,null,null,'Section : order item inserted Error: '.$e->getMessage().' sku : '.$item->getSku());
61
  echo $e->getMessage();
62
  }
63
 
64
+ //As item get saved in logicbroker_sales_orders_items we run our sourcing logic
65
+ if(Mage::getStoreConfigFlag(self::XML_PATH_LOGICSOURCING_SOURCING_TYPE)){
66
+ $this->assignToVendor($item);
67
+ Mage::getResourceModel('dropship360/orderitems')->saveOrderItems($this->_itemData,$object->getOrder());
68
+ $this->_itemData = array();
69
+ }
70
  }
71
 
72
  public function logicbrokerSourcing() {
73
+ $sourcingObj = Mage::getModel('dropship360/ordersourcing');
74
  if(!Mage::getStoreConfig(self::CRON_STRING_PATH_SOURCING)) {
75
+ Mage::helper('dropship360')->genrateLog(0,'Sourcing started','Sourcing started','Sourcing can not be started as cron time not set');
76
+ return;
77
+ }
78
+ if($sourcingObj->checkRunningStatus('sourcing')){
79
+
80
+ Mage::helper('dropship360')->genrateLog(0,'Sourcing started','Sourcing started','Sourcing can not be started as process already running');
81
  return;
82
  }
83
+ Mage::helper('dropship360')->genrateLog(1,'Sourcing Started for '.Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_REPROCESS.' Item status',null,null);
84
+ $sourcingObj->sourcingStarted(Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_SOURCING);
85
+ $this->setLbVendorRanking (Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_REPROCESS,true);
86
  $this->addCronStatus('logicbroker_sourcing/cron_settings/dispaly_sourcing_updated_time', Mage::helper('core')->formatDate(now(), 'medium', true));
87
+ $sourcingObj->sourcingCompleted(Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_SOURCING);
88
+ Mage::helper('dropship360')->genrateLog(2,null,'Sourcing Ended for ' .Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_REPROCESS.' Item status',null);
89
  return;
90
  }
91
 
92
  public function logicbrokerBackorder()
93
  {
94
+ $sourcingObj = Mage::getModel('dropship360/ordersourcing');
95
  if(!Mage::getStoreConfig(self::CRON_STRING_PATH_BACKORDER)) {
96
+ Mage::helper('dropship360')->genrateLog(0,'Backorder sourcing started','Backorder sourcing ended','Backorder Sourcing can not be started as cron time not set');
97
  return;
98
  }
99
+ if($sourcingObj->checkRunningStatus(Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_BACKORDER)){
100
+ Mage::helper('dropship360')->genrateLog(0,'Backorder sourcing started','Backorder sourcing ended','Backorder Sourcing can not be started process already running');
101
+ return;
102
+ }
103
+ Mage::helper('dropship360')->genrateLog(1,'Backorder Sourcing Started for '.Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_BACKORDER . ' item status',null,null);
104
+ $sourcingObj->sourcingStarted(Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_BACKORDER);
105
+ $this->setLbVendorRanking (Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_BACKORDER);
106
  $this->addCronStatus('logicbroker_sourcing/cron_settings/display_backorder_updated_time', Mage::helper('core')->formatDate(now(), 'medium', true));
107
+ $sourcingObj->sourcingCompleted(Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_BACKORDER);
108
+ Mage::helper('dropship360')->genrateLog(1,'Backorder Sourcing Ended for '.Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_BACKORDER .' item status',null,null);
109
  return;
110
  }
111
 
121
  return;
122
  }
123
 
124
+ protected function setLbVendorRanking($crontype,$isCronSourcing = false)
125
  {
126
  $reprocess = Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_REPROCESS;
127
+ $lbOrderInstances = Mage::getModel('dropship360/ordersourcing');
128
+ $collection = $lbOrderInstances->prepareItemCollection($crontype,$isCronSourcing);
129
+ if(count($collection) > 0 ){
130
+ foreach ( $collection as $orderID => $orderCollectionData ) {
131
+ $orderCollection = Mage::getModel('sales/order')->Load($orderID);
132
+ //Patch : skip sourcing process if order is deleted
133
+ if (! $orderCollection->getEntityId ()) {
134
+ Mage::helper ( 'dropship360' )->genrateLog ( 0, null, null, 'Order not exists for => order_id: ' . $orderID . ' hence cannot continue' );
135
+ continue;
136
+ }
137
+ $this->_orderStatus = $orderCollection->getStatus();
138
+ foreach ($orderCollectionData as $orderData ){
139
+ Mage::helper('dropship360')->genrateLog(0,null,null,'<---->Item Processing Started : '.$orderData->getSku());
140
  if ($crontype == Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_REPROCESS) {
 
 
 
 
 
 
 
141
  $assigned = $this->assignToVendor(Mage::getModel('sales/order_item')->Load($orderData->getItemId()));
 
 
142
  }else
143
+ {
144
+ $orderItems = Mage::getModel( 'dropship360/orderitems' )->load($orderData->getItemId(), 'item_id');
145
+ $itemStatusHistory = Mage::helper('dropship360')->getSerialisedData($orderItems, $reprocess, $this->_orderStatus);
146
+ $this->_itemData[$orderData->getItemId()] = array('lb_item_status'=>$reprocess,'item_status_history'=>$itemStatusHistory);
 
 
 
 
147
  }
148
+ Mage::helper('dropship360')->genrateLog(0,null,null,'####### Item Processing ended : '.$orderData->getSku());
 
149
 
150
+ }
151
+ Mage::getResourceModel('dropship360/orderitems')->saveOrderItems($this->_itemData,$orderCollection,$crontype);
152
+ $this->_itemData = array();
153
  }
154
  }else {
155
+ Mage::helper('dropship360')->genrateLog(0,null,null,'Order collection is empty for => Cron_type: '.$crontype.' hence cannot continue');
156
  return;
157
  }
158
  }
167
  $vendorCode = '';
168
  $inventoryStock = '';
169
  $defaultVendor = (Mage::getStoreConfig('logicbroker_sourcing/rank/defaultbackorder') == 'none') ? '' : Mage::getStoreConfig('logicbroker_sourcing/rank/defaultbackorder');
170
+ $orderItemInstance = Mage::getModel ( 'dropship360/orderitems' );
171
  $orderItemInstance->load ( $itemId, 'item_id' );
172
  $collectionVendor = $orderItemInstance->prepareOrderItemData($item);
173
  $arrDefaultVendorDetails = array();
174
+ $vendorCost = 0;
175
 
176
  if ($collectionVendor->count () > 0) {
177
  if($collectionVendor->count () >= 1){
221
 
222
  if(!empty($vendorCode)){
223
  if ($vendorCode && $inventoryStock >= $qtyInvoiced) {
224
+ $itemStatusHistory = Mage::helper('dropship360')->getSerialisedData($orderItemInstance, $itemStatusComplete, $this->_orderStatus);
225
+ Mage::helper('dropship360')->genrateLog(0,null,null,'@@@@@@@@ Sourcing Details==> stock('.$inventoryStock.') >= qtyinvoiced('.$qtyInvoiced.'),vendor_code ->'.$vendorCode.', item-status->'.$itemStatusComplete);
226
+ Mage::getModel('dropship360/logicbroker')->setupNotification();
227
+ $this->_itemData [$item->getItemId ()] = array (
228
+ 'updateInventory' => true,
229
+ 'qtyInvoiced' =>$qtyInvoiced,
230
+ 'updated_at' => now (),
231
+ 'sku' => $item->getSku (),
232
+ 'updated_by' => 'Cron',
233
+ 'lb_item_status' => $itemStatusComplete,
234
+ 'lb_vendor_code' => $vendorCode,
235
+ 'vendor_cost' => $vendorCost * $qtyInvoiced,
236
+ 'lb_vendor_sku' => $vendorSku,
237
+ 'item_status_history' => $itemStatusHistory
238
+ );
239
  return $itemStatusComplete;
240
  }
241
  if ($isDefaultVendor && $inventoryStock <= $qtyInvoiced && !empty($defaultVendor) && in_array($defaultVendor,$arrVendorAvailable)) {
242
+ $itemStatusHistory = Mage::helper('dropship360')->getSerialisedData($orderItemInstance, $itemStatusComplete, $this->_orderStatus);
243
+ Mage::helper('dropship360')->genrateLog(0,null,null,'@@@@@@@@ Sourcing Details Default vendor set ==>stock('.$inventoryStock.') >= qtyinvoiced('.$qtyInvoiced.'),vendor_code ->'.$vendorCode.', item-status->Transmitting');
244
+ $this->_itemData [$item->getItemId ()] = array (
245
+ 'updateInventory' => false,
246
+ 'updated_at' => now (),
247
+ 'sku' => $item->getSku (),
248
+ 'updated_by' => 'Cron',
249
+ 'lb_item_status' => $itemStatusComplete,
250
+ 'lb_vendor_code' => $defaultVendor,
251
+ 'vendor_cost' => $arrDefaultVendorDetails ['cost'] * $qtyInvoiced,
252
+ 'lb_vendor_sku' => $arrDefaultVendorDetails ['lb_vendor_sku'],
253
+ 'item_status_history' => $itemStatusHistory
254
+ );
255
  return $itemStatusComplete;
256
  }
257
  if ($vendorCode && $inventoryStock <= $qtyInvoiced) {
258
+ $itemStatusHistory =Mage::helper('dropship360')->getSerialisedData($orderItemInstance, $itemStatusBackorder, $this->_orderStatus);
259
+ Mage::helper('dropship360')->genrateLog(0,null,null,'@@@@@@@@ Sourcing Details==>stock('.$inventoryStock.') <= qtyinvoiced('.$qtyInvoiced.'),vendor_code ->'.$vendorCode.', item-status->'.$itemStatusBackorder);
260
+ $this->_itemData [$item->getItemId ()] = array (
261
+ 'updateInventory' => false,
262
+ 'updated_at' => now (),
263
+ 'sku' => $item->getSku (),
264
+ 'updated_by' => 'Cron',
265
+ 'lb_item_status' => $itemStatusBackorder,
266
+ 'lb_vendor_code' => $vendorCode,
267
+ 'vendor_cost' => $vendorCost * $qtyInvoiced,
268
+ 'lb_vendor_sku' => $vendorSku,
269
+ 'item_status_history' => $itemStatusHistory
270
+ );
271
  return $itemStatusBackorder;
272
  }
273
  }else{
274
+ $itemStatusHistory = Mage::helper('dropship360')->getSerialisedData($orderItemInstance,$itemStatusNoDropShip, $this->_orderStatus);
275
+ Mage::helper('dropship360')->genrateLog(0,null,null,'@@@@@@@@ Sourcing Details==> No vendor Set ,vendor_code ->'.$vendorCode.', item-status->No Dropship');
276
+ $this->_itemData [$item->getItemId ()] = array (
277
+ 'updateInventory' => false,
278
+ 'updated_at' => now (),
279
+ 'sku' => $item->getSku (),
280
+ 'updated_by' => 'Cron',
281
+ 'lb_item_status' => $itemStatusNoDropShip,
282
+ 'lb_vendor_code' => $vendorCode,
283
+ 'vendor_cost' => $vendorCost * $qtyInvoiced,
284
+ 'lb_vendor_sku' => '',
285
+ 'item_status_history' => $itemStatusHistory
286
+ );
287
  return $itemStatusNoDropShip;
288
  }
289
  }
313
  *
314
  */
315
  $customFieldValue = $this->_getRequest()->getPost('product');
316
+ $result = Mage::getModel('dropship360/inventory')->saveTabVendorData($customFieldValue);
317
 
318
  /**
319
  * Uncomment the line below to save the product
320
  *
321
  */
322
  //if(!$result)
323
+ //Mage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship360')->__('Vendor Data Cannot be saved'));
324
 
325
  //$product->save();
326
 
341
  }
342
 
343
  $finalStock = $result['inventory'];
344
+ $finalStock = Mage::helper('dropship360')->getIsQtyDecimal($sku, $finalStock);
345
  $conn = Mage::getSingleton ( 'core/resource' )->getConnection ( 'core_write' );
346
 
347
  $tableNameStatus = Mage::getSingleton ( 'core/resource' )->getTableName ( 'cataloginventory/stock_status' );
459
  public function catalogProductDeleteAfter(Varien_Event_Observer $observer)
460
  {
461
  $deletedProductSku = $observer->getEvent()->getProduct()->getSku();
462
+ $orderItem = Mage::getModel ('dropship360/inventory')->getCollection()->addFieldToFilter('product_sku', $deletedProductSku);
463
  if($orderItem->getSize() > 0){
464
  foreach($orderItem as $data){
465
  try {
466
+ Mage::getModel ('dropship360/inventory')->load($data->getId())->delete();
467
  } catch (Exception $e) {
468
  Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
469
  }
471
  }
472
  return $this;
473
  }
474
+ //@function : notify cutomer for oudated product inventory through email,initiated by cron
475
+ public function notifyForProductUpdateInventory(){
476
+ if (!Mage::getStoreConfigFlag (self::XML_PATH_INVENTORY_NOTIFICATION_EMAIL_ENABLED) || !Mage::getStoreConfigFlag (self::XML_PATH_INVENTORY_NOTIFICATION_DAYS) || !Mage::getStoreConfigFlag (self::XML_PATH_INVENTORY_NOTIFICATION_EMAIL)) {
477
+ return $this;
478
+ }
479
+ $itemObject;
480
+ $fileInfo = array();
481
+ $ioAdapter = new Varien_Io_File();
482
+ $open_monitor_from = Date('Y-m-d h:i:s', strtotime('-'.Mage::getStoreConfig(self::XML_PATH_INVENTORY_NOTIFICATION_DAYS).' day'));
483
+ $open_monitor_to = Mage::getModel('core/date')->gmtDate();
484
+ $itemObject = Mage::getModel('dropship360/inventory')->getCollection()->addFieldTofilter('updated_at', array('from' => $open_monitor_from,'to' => $open_monitor_to));
485
+ if($itemObject->getSize() <= 0){
486
+ Mage::log('cannot send outdated product inventory email collection is empty for form :'.$open_monitor_from.' to :'.$open_monitor_to, null, 'notification_error.log');
487
+ return $this;
488
+ }
489
+ $fileInfo = Mage::getModel('dropship360/csvparser')->getCsvFile($itemObject);
490
+ $mailData['days'] = Mage::getStoreConfig(self::XML_PATH_INVENTORY_NOTIFICATION_DAYS);
491
+ $mailData['subject'] = 'dropship360 list of outdated product inventory';
492
+ $postObject = new Varien_Object();
493
+ $postObject->setData($mailData);
494
+ $email = trim(Mage::getStoreConfig(self::XML_PATH_INVENTORY_NOTIFICATION_EMAIL));
495
+ $templateId = 'logicbroker_outdated_product_inventory';
496
+ $isMailSent = Mage::helper('dropship360')->sendMail($postObject,$email,$templateId,$fileInfo['value']);
497
+ $ioAdapter->rm($fileInfo['value']);
498
+ return $this;
499
+ }
500
  }
includes/src/Logicbroker_Dropship360_Model_Order_Api.php CHANGED
@@ -82,7 +82,7 @@ class Logicbroker_Dropship360_Model_Order_Api extends Mage_Sales_Model_Order_Api
82
  protected function isDropshipItemReady($order)
83
  {
84
  $result = false;
85
- $lbItemCollection = Mage::getModel('logicbroker/orderitems')->getCollection()->addFieldToFilter('lb_item_status',$this->_itemStatusTansmitting)->addFieldToFilter('item_order_id',$order->getEntityId());
86
  if($lbItemCollection->count() > 0)
87
  $result = true;
88
  return $result;
@@ -90,7 +90,7 @@ class Logicbroker_Dropship360_Model_Order_Api extends Mage_Sales_Model_Order_Api
90
 
91
  protected function addItemDetails($order){
92
  $result = array();
93
- $lbItemCollection = Mage::getModel('logicbroker/orderitems')->getCollection()->addFieldToFilter('item_order_id',$order->getEntityId());
94
  if($lbItemCollection->count() > 0){
95
  unset($result);
96
  foreach($lbItemCollection as $item)
@@ -152,7 +152,7 @@ class Logicbroker_Dropship360_Model_Order_Api extends Mage_Sales_Model_Order_Api
152
  }
153
  $productItems = array();
154
  $productItems = $this->_getAttributes($item, 'order_item');
155
- $lbItems = Mage::getModel('logicbroker/orderitems')->getCollection()
156
  ->addFieldToSelect(array('sku', 'lb_vendor_sku', 'lb_item_status', 'lb_vendor_code', 'item_id'))
157
  ->addFieldToFilter('item_order_id',array('eq'=>$order->getId()))
158
  ->addFieldToFilter('item_id', array('eq'=>$productItems['item_id']))
@@ -189,7 +189,7 @@ class Logicbroker_Dropship360_Model_Order_Api extends Mage_Sales_Model_Order_Api
189
  if(!$status){
190
  $status = Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_SENT_TO_SUPPLIER;
191
  }
192
- if($itemIdArr && in_array(ucfirst($status),Mage::helper('logicbroker')->getItemStatuses())){
193
  foreach($itemIdArr as $itemId){
194
  $result = $this->saveLbStatus($itemId, $status);
195
  }
@@ -208,17 +208,17 @@ class Logicbroker_Dropship360_Model_Order_Api extends Mage_Sales_Model_Order_Api
208
  * @return bool
209
  */
210
  protected function saveLbStatus($itemId, $status){
211
- $lbStatus = Mage::getModel('logicbroker/orderitems')->load($itemId, 'item_id');
212
  $orderCollection = Mage::getModel('sales/order')->load($lbStatus->getItemOrderId());
213
  $orderStatus = $orderCollection->getStatus();
214
- $itemStatusHistory = Mage::helper('logicbroker')->getSerialisedData($lbStatus, ucfirst($status), $orderStatus);
215
  if($lbStatus->getId()){
216
  $lbStatus->setLbItemStatus(ucfirst($status))
217
  ->setUpdatedBy('logicbroker')
218
  ->setItemStatusHistory($itemStatusHistory)
219
  ->setUpdatedAt(Mage::getModel('core/date')->gmtDate())
220
  ->save();
221
- Mage::helper('logicbroker')->genrateLog(0,'API Item Update started','API Item Update ended','Item Status updated by Logicbroker API item-status->'.$status.' ,sku->'.$lbStatus->getSku().' ,orderId->'.$lbStatus->getItemOrderId());
222
  return true;
223
  }
224
  }
@@ -239,7 +239,7 @@ class Logicbroker_Dropship360_Model_Order_Api extends Mage_Sales_Model_Order_Api
239
  $orderItemsdDetails = array();
240
  try{
241
 
242
- $orderCollection = Mage::getModel('logicbroker/orderitems')->getCollection();
243
  $orderCollection->addFieldToFilter('lb_item_status',$orderItemStatus);
244
  $orderCollection->getSelect()->join(array('salesOrder'=>Mage::getSingleton('core/resource')->getTableName('sales/order')),
245
  'salesOrder.entity_id = main_table.item_order_id', array('increment_id','store_id'))->where('store_id = ?', (int)$store_id);
@@ -271,7 +271,7 @@ class Logicbroker_Dropship360_Model_Order_Api extends Mage_Sales_Model_Order_Api
271
  $itemId = array();
272
  $itemOrderId = $order->getEntityId();
273
  $result = false;
274
- $orderCollection = Mage::getModel('logicbroker/orderitems')->getCollection();
275
  $orderCollection->addFieldToFilter('lb_item_status','Transmitting');
276
  $orderCollection->addFieldToFilter('item_order_id',$itemOrderId);
277
 
@@ -290,7 +290,7 @@ class Logicbroker_Dropship360_Model_Order_Api extends Mage_Sales_Model_Order_Api
290
  $itemStatus = Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_SENT_TO_SUPPLIER;
291
  }
292
 
293
- if(!empty($itemId) && in_array(ucfirst($itemStatus),Mage::helper('logicbroker')->getItemStatuses())){
294
  foreach($itemId as $itemId){
295
  $result = $this->saveLbStatus($itemId, $itemStatus);
296
  }
82
  protected function isDropshipItemReady($order)
83
  {
84
  $result = false;
85
+ $lbItemCollection = Mage::getModel('dropship360/orderitems')->getCollection()->addFieldToFilter('lb_item_status',$this->_itemStatusTansmitting)->addFieldToFilter('item_order_id',$order->getEntityId());
86
  if($lbItemCollection->count() > 0)
87
  $result = true;
88
  return $result;
90
 
91
  protected function addItemDetails($order){
92
  $result = array();
93
+ $lbItemCollection = Mage::getModel('dropship360/orderitems')->getCollection()->addFieldToFilter('item_order_id',$order->getEntityId());
94
  if($lbItemCollection->count() > 0){
95
  unset($result);
96
  foreach($lbItemCollection as $item)
152
  }
153
  $productItems = array();
154
  $productItems = $this->_getAttributes($item, 'order_item');
155
+ $lbItems = Mage::getModel('dropship360/orderitems')->getCollection()
156
  ->addFieldToSelect(array('sku', 'lb_vendor_sku', 'lb_item_status', 'lb_vendor_code', 'item_id'))
157
  ->addFieldToFilter('item_order_id',array('eq'=>$order->getId()))
158
  ->addFieldToFilter('item_id', array('eq'=>$productItems['item_id']))
189
  if(!$status){
190
  $status = Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_SENT_TO_SUPPLIER;
191
  }
192
+ if($itemIdArr && in_array(ucfirst($status),Mage::helper('dropship360')->getItemStatuses())){
193
  foreach($itemIdArr as $itemId){
194
  $result = $this->saveLbStatus($itemId, $status);
195
  }
208
  * @return bool
209
  */
210
  protected function saveLbStatus($itemId, $status){
211
+ $lbStatus = Mage::getModel('dropship360/orderitems')->load($itemId, 'item_id');
212
  $orderCollection = Mage::getModel('sales/order')->load($lbStatus->getItemOrderId());
213
  $orderStatus = $orderCollection->getStatus();
214
+ $itemStatusHistory = Mage::helper('dropship360')->getSerialisedData($lbStatus, ucfirst($status), $orderStatus);
215
  if($lbStatus->getId()){
216
  $lbStatus->setLbItemStatus(ucfirst($status))
217
  ->setUpdatedBy('logicbroker')
218
  ->setItemStatusHistory($itemStatusHistory)
219
  ->setUpdatedAt(Mage::getModel('core/date')->gmtDate())
220
  ->save();
221
+ Mage::helper('dropship360')->genrateLog(0,'API Item Update started','API Item Update ended','Item Status updated by Logicbroker API item-status->'.$status.' ,sku->'.$lbStatus->getSku().' ,orderId->'.$lbStatus->getItemOrderId());
222
  return true;
223
  }
224
  }
239
  $orderItemsdDetails = array();
240
  try{
241
 
242
+ $orderCollection = Mage::getModel('dropship360/orderitems')->getCollection();
243
  $orderCollection->addFieldToFilter('lb_item_status',$orderItemStatus);
244
  $orderCollection->getSelect()->join(array('salesOrder'=>Mage::getSingleton('core/resource')->getTableName('sales/order')),
245
  'salesOrder.entity_id = main_table.item_order_id', array('increment_id','store_id'))->where('store_id = ?', (int)$store_id);
271
  $itemId = array();
272
  $itemOrderId = $order->getEntityId();
273
  $result = false;
274
+ $orderCollection = Mage::getModel('dropship360/orderitems')->getCollection();
275
  $orderCollection->addFieldToFilter('lb_item_status','Transmitting');
276
  $orderCollection->addFieldToFilter('item_order_id',$itemOrderId);
277
 
290
  $itemStatus = Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_SENT_TO_SUPPLIER;
291
  }
292
 
293
+ if(!empty($itemId) && in_array(ucfirst($itemStatus),Mage::helper('dropship360')->getItemStatuses())){
294
  foreach($itemId as $itemId){
295
  $result = $this->saveLbStatus($itemId, $itemStatus);
296
  }
includes/src/Logicbroker_Dropship360_Model_Orderitems.php CHANGED
@@ -10,7 +10,7 @@
10
  class Logicbroker_Dropship360_Model_Orderitems extends Mage_Core_Model_Abstract
11
  {
12
  protected function _construct(){
13
- $this->_init("logicbroker/orderitems");
14
  }
15
 
16
  public function prepareOrderItemData($item){
@@ -23,8 +23,8 @@ class Logicbroker_Dropship360_Model_Orderitems extends Mage_Core_Model_Abstract
23
  else
24
  $orderBy = 'cost ASC';
25
 
26
- $collectionVendor = Mage::getModel ( 'logicbroker/inventory' )->getCollection ()->addFieldToFilter ( 'product_sku', $productSku );
27
- $collectionVendor->getSelect ()->joinleft ( array ('lbRanking' => Mage::getSingleton ( 'core/resource' )->getTableName ( 'logicbroker/ranking' )), 'lbRanking.lb_vendor_code = main_table.lb_vendor_code', array ('*') )->where('lbRanking.is_dropship = "yes" and lbRanking.is_active = "yes"');
28
  $collectionVendor->getSelect ()->order ( $orderBy );
29
  return $collectionVendor;
30
  }
@@ -32,7 +32,7 @@ class Logicbroker_Dropship360_Model_Orderitems extends Mage_Core_Model_Abstract
32
 
33
  public function isVendorCollectionAvailable()
34
  {
35
- if (Mage::getModel ( 'logicbroker/inventory' )->getCollection ()->count() > 0 )
36
  return true;
37
  else
38
  return false;
@@ -56,13 +56,13 @@ class Logicbroker_Dropship360_Model_Orderitems extends Mage_Core_Model_Abstract
56
  try {
57
  $orderItemInstance->save ();
58
  } catch ( Exception $e ) {
59
- Mage::helper('logicbroker')->genrateLog(0,null,null,'Section :Error In Setting order item data: '.$e->getMessage().' sku : '.$item->getSku().','.$item->getOrderId ());
60
  echo $e->getMessage ();
61
  }
62
  }
63
  public function updateLbVendorInvenory($vendorCode,$productSku,$qtyInvoiced)
64
  {
65
- $inventory = Mage::getModel ( 'logicbroker/inventory' )->getCollection()
66
  ->addFieldToFilter('lb_vendor_code',$vendorCode)->addFieldToFilter('product_sku',$productSku);
67
  $filedData = $inventory->getFirstItem()->getData();
68
  $LbInventoryStock = $filedData['stock'];
@@ -70,7 +70,7 @@ class Logicbroker_Dropship360_Model_Orderitems extends Mage_Core_Model_Abstract
70
  $inventory->getFirstItem()->setStock ( ($finalStock > 0) ? $finalStock : 0 );
71
  try {
72
  $inventory->getFirstItem()->save ();
73
- Mage::getModel('logicbroker/inventory')->_saveInventoryLog('update',array('lb_vendor_name'=>$filedData['lb_vendor_name'],'updated_by'=>'system','product_sku'=>$productSku,'lb_vendor_code'=>$vendorCode,'cost'=>$filedData['cost'],'stock'=>($finalStock > 0) ? $finalStock : 0));
74
  } catch ( Exception $e ) {
75
  echo $e->getMessage ();
76
  }
@@ -79,7 +79,7 @@ class Logicbroker_Dropship360_Model_Orderitems extends Mage_Core_Model_Abstract
79
  public function updateSourcingByUser($request)
80
  {
81
  $arrData = array();
82
- $inventoryModel = Mage::getModel('logicbroker/inventory')->getCollection()->addFieldToFilter('lb_vendor_code',$request['lb_vendor_code'])->addFieldToFilter('product_sku',$request['product_sku']);
83
  $arrData['lb_vendor_code'] = $request['lb_vendor_code'];
84
  $arrData['lb_item_status'] = Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_TRANSMITTING;
85
  $arrData['updated_by'] = 'User';
10
  class Logicbroker_Dropship360_Model_Orderitems extends Mage_Core_Model_Abstract
11
  {
12
  protected function _construct(){
13
+ $this->_init("dropship360/orderitems");
14
  }
15
 
16
  public function prepareOrderItemData($item){
23
  else
24
  $orderBy = 'cost ASC';
25
 
26
+ $collectionVendor = Mage::getModel ( 'dropship360/inventory' )->getCollection ()->addFieldToFilter ( 'product_sku', $productSku );
27
+ $collectionVendor->getSelect ()->joinleft ( array ('lbRanking' => Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship360/ranking' )), 'lbRanking.lb_vendor_code = main_table.lb_vendor_code', array ('*') )->where('lbRanking.is_dropship = "yes" and lbRanking.is_active = "yes"');
28
  $collectionVendor->getSelect ()->order ( $orderBy );
29
  return $collectionVendor;
30
  }
32
 
33
  public function isVendorCollectionAvailable()
34
  {
35
+ if (Mage::getModel ( 'dropship360/inventory' )->getCollection ()->count() > 0 )
36
  return true;
37
  else
38
  return false;
56
  try {
57
  $orderItemInstance->save ();
58
  } catch ( Exception $e ) {
59
+ Mage::helper('dropship360')->genrateLog(0,null,null,'Section :Error In Setting order item data: '.$e->getMessage().' sku : '.$item->getSku().','.$item->getOrderId ());
60
  echo $e->getMessage ();
61
  }
62
  }
63
  public function updateLbVendorInvenory($vendorCode,$productSku,$qtyInvoiced)
64
  {
65
+ $inventory = Mage::getModel ( 'dropship360/inventory' )->getCollection()
66
  ->addFieldToFilter('lb_vendor_code',$vendorCode)->addFieldToFilter('product_sku',$productSku);
67
  $filedData = $inventory->getFirstItem()->getData();
68
  $LbInventoryStock = $filedData['stock'];
70
  $inventory->getFirstItem()->setStock ( ($finalStock > 0) ? $finalStock : 0 );
71
  try {
72
  $inventory->getFirstItem()->save ();
73
+ Mage::getModel('dropship360/inventory')->_saveInventoryLog('update',array('lb_vendor_name'=>$filedData['lb_vendor_name'],'updated_by'=>'system','product_sku'=>$productSku,'lb_vendor_code'=>$vendorCode,'cost'=>$filedData['cost'],'stock'=>($finalStock > 0) ? $finalStock : 0));
74
  } catch ( Exception $e ) {
75
  echo $e->getMessage ();
76
  }
79
  public function updateSourcingByUser($request)
80
  {
81
  $arrData = array();
82
+ $inventoryModel = Mage::getModel('dropship360/inventory')->getCollection()->addFieldToFilter('lb_vendor_code',$request['lb_vendor_code'])->addFieldToFilter('product_sku',$request['product_sku']);
83
  $arrData['lb_vendor_code'] = $request['lb_vendor_code'];
84
  $arrData['lb_item_status'] = Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_TRANSMITTING;
85
  $arrData['updated_by'] = 'User';
includes/src/Logicbroker_Dropship360_Model_Ordersourcing.php CHANGED
@@ -9,23 +9,82 @@
9
 
10
  class Logicbroker_Dropship360_Model_Ordersourcing extends Mage_Core_Model_Abstract
11
  {
12
- protected function _construct()
13
- {
14
- $this->_init("logicbroker/ordersourcing");
 
 
 
 
15
  }
16
-
17
- public function prepareOrderCollection($crontype)
18
- {
19
- $processingOrders = Mage::getModel('sales/order')->getCollection()->addFieldToFilter('status',$crontype);
20
- $processingOrders->getSelect()->limit('20');
21
- return $processingOrders;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  }
23
- public function prepareItemCollection($crontype)
24
  {
25
- $processingItem = Mage::getModel('logicbroker/orderitems')->getCollection()->addFieldToFilter('lb_item_status',$crontype);
26
- $processingItem->getSelect()->limit('20');
27
- return $processingItem;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  }
29
-
30
- }
31
-
9
 
10
  class Logicbroker_Dropship360_Model_Ordersourcing extends Mage_Core_Model_Abstract
11
  {
12
+ protected $_pathSourcingStart = 'logicbroker/sourcing_cron/start_time';
13
+ protected $_pathSourcingComp = 'logicbroker/sourcing_cron/comp_time';
14
+ protected $_pathBackorderStart = 'logicbroker/backorder_cron/start_time';
15
+ protected $_pathBackorderComp = 'logicbroker/backorder_cron/comp_time';
16
+ protected $_waitTIme = 30; //min
17
+ protected function _construct(){
18
+ $this->_init("dropship360/ordersourcing");
19
  }
20
+ public function prepareItemCollection($crontype,$isCronSourcing = false){
21
+ $orderItemColletion = array();
22
+ $rowObj = new Varien_Object();
23
+ $condition = ($isCronSourcing) ? array($crontype,Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_SOURCING) : array($crontype);
24
+ //$orders = $this->getOrderForProcess($condition);
25
+ $processingItem = Mage::getModel('dropship360/orderitems')->getCollection();
26
+ $processingItem->getSelect()->join(array('salesOrder'=>Mage::getSingleton('core/resource')->getTableName('sales/order')),'salesOrder.entity_id = main_table.item_order_id',array('state'));
27
+ $processingItem->addFieldToFilter('state','processing');
28
+ $processingItem->addFieldToFilter('lb_item_status',array('in'=>$condition));
29
+ if($processingItem->getSize() > 0){
30
+ foreach ($processingItem as $item){
31
+ $var = array (
32
+ 'id' => $item->getId (),
33
+ 'item_id' => $item->getItemId (),
34
+ 'item_order_id' => $item->getItemOrderId (),
35
+ 'sku' => $item->getSku (),
36
+ 'lb_vendor_sku' => $item->getLbVendorSku (),
37
+ 'vendor_cost' => $item->getVendorCost (),
38
+ 'lb_item_status' => $item->getLbItemStatus (),
39
+ 'lb_vendor_code' => $item->getLbVendorCode (),
40
+ 'updated_by' => $item->getUpdatedBy (),
41
+ 'item_status_history' => $item->getItemStatusHistory (),
42
+ 'updated_at' => $item->getUpdatedAt ()
43
+ );
44
+ $rowObj = new Varien_Object();
45
+ $orderItemColletion[$item->getItemOrderId()][] = $rowObj->setData($var);
46
+ }
47
+ }
48
+ return $orderItemColletion;
49
+ }
50
+ protected function getOrderForProcess($condition){
51
+ $orderIds = array();
52
+ $processingItem = Mage::getModel('dropship360/orderitems')->getCollection();
53
+ $processingItem->getSelect()->join(array('salesOrder'=>Mage::getSingleton('core/resource')->getTableName('sales/order')),'salesOrder.entity_id = main_table.item_order_id',array('state'));
54
+ $processingItem->addFieldToFilter('state','processing');
55
+ $processingItem->addFieldToFilter('lb_item_status',array('in'=>$condition));
56
+ $processingItem->getSelect()->group('item_order_id');
57
+ //$processingItem->getSelect()->limit('200');
58
+ $processingItem->getSelect()->order('id asc');
59
+ if($processingItem->getSize() > 0){
60
+ foreach ($processingItem as $item){
61
+ $orderIds[] = $item->getItemOrderId();
62
+ }
63
+ }
64
+ return $orderIds;
65
  }
66
+ public function checkRunningStatus($type)
67
  {
68
+ $path = ($type == Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_BACKORDER) ? $this->_pathBackorderStart : $this->_pathSourcingStart;
69
+ if(!Mage::getStoreConfigFlag($path)){
70
+ return false;//job not running
71
+ }
72
+ $now = time() - ($this->_waitTIme * 60);
73
+ $time = strtotime(Mage::getStoreConfig($path));
74
+ /*if ($time < $now) {
75
+ return false;//insert forcefully
76
+ }*/
77
+ return true;
78
+ }
79
+ public function sourcingStarted($type){
80
+ $path = ($type == Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_BACKORDER) ? $this->_pathBackorderStart : $this->_pathSourcingStart;
81
+ $value = strftime('%Y-%m-%d %H:%M:00', time());
82
+ Mage::getResourceModel('dropship360/ordersourcing')->saveConfig($path, $value);
83
+ }
84
+ public function sourcingCompleted($type){
85
+ //$path = ($type == 'backorder') ? $this->_pathBackorderComp : $this->_pathSourcingComp;
86
+ $path = ($type == Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_BACKORDER) ? $this->_pathBackorderStart : $this->_pathSourcingStart;
87
+ $value = '';//strftime('%Y-%m-%d %H:%M:00', time());
88
+ Mage::getResourceModel('dropship360/ordersourcing')->saveConfig($path, $value);
89
  }
90
+ }
 
 
includes/src/Logicbroker_Dropship360_Model_Ranking.php CHANGED
@@ -11,11 +11,11 @@ class Logicbroker_Dropship360_Model_Ranking extends Mage_Core_Model_Abstract
11
  {
12
  protected function _construct(){
13
 
14
- $this->_init("logicbroker/ranking");
15
  }
16
  public function rearrangeRank($value, $rank){
17
  if($rank > 0 && $rank < $value->getRanking() ){
18
- $rankData = Mage::getModel('logicbroker/ranking')->load($value->getId());
19
  $rankData->setRanking($rank);
20
  $rankData->save();
21
  $rank++;
@@ -29,7 +29,7 @@ class Logicbroker_Dropship360_Model_Ranking extends Mage_Core_Model_Abstract
29
  $arrVendor = array();
30
  if($vendorCollection->count() > 0 ){
31
  foreach ($vendorCollection as $vendor) {
32
- $arrVendor[] = array('name'=>$vendor->getLbVendorName(),'code'=>$vendor->getLbVendorCode());
33
  }
34
  }
35
  return $arrVendor;
@@ -49,7 +49,7 @@ class Logicbroker_Dropship360_Model_Ranking extends Mage_Core_Model_Abstract
49
  }
50
 
51
  protected function saveVendorDetails($value){
52
- $vendorDetail = Mage::getModel('logicbroker/ranking')->load($value['lb_vendor_code'],'lb_vendor_code');
53
  if(!$vendorDetail->getId()){
54
  $vendorDetail->setLbVendorCode($value['lb_vendor_code']);
55
  $vendorDetail->setLbVendorName($value['lb_vendor_name']);
11
  {
12
  protected function _construct(){
13
 
14
+ $this->_init("dropship360/ranking");
15
  }
16
  public function rearrangeRank($value, $rank){
17
  if($rank > 0 && $rank < $value->getRanking() ){
18
+ $rankData = Mage::getModel('dropship360/ranking')->load($value->getId());
19
  $rankData->setRanking($rank);
20
  $rankData->save();
21
  $rank++;
29
  $arrVendor = array();
30
  if($vendorCollection->count() > 0 ){
31
  foreach ($vendorCollection as $vendor) {
32
+ $arrVendor[] = array('name'=>$vendor->getLbVendorName(),'code'=>$vendor->getLbVendorCode(),'link'=>is_null($vendor->getLinkingAttribute()) ? '' : $vendor->getLinkingAttribute());
33
  }
34
  }
35
  return $arrVendor;
49
  }
50
 
51
  protected function saveVendorDetails($value){
52
+ $vendorDetail = Mage::getModel('dropship360/ranking')->load($value['lb_vendor_code'],'lb_vendor_code');
53
  if(!$vendorDetail->getId()){
54
  $vendorDetail->setLbVendorCode($value['lb_vendor_code']);
55
  $vendorDetail->setLbVendorName($value['lb_vendor_name']);
includes/src/Logicbroker_Dropship360_Model_Rankinglog.php CHANGED
@@ -11,7 +11,7 @@ class Logicbroker_Dropship360_Model_Rankinglog extends Mage_Core_Model_Abstract
11
  {
12
  protected function _construct(){
13
 
14
- $this->_init("logicbroker/Rankinglog");
15
  }
16
 
17
  }
11
  {
12
  protected function _construct(){
13
 
14
+ $this->_init("dropship360/Rankinglog");
15
  }
16
 
17
  }
includes/src/Logicbroker_Dropship360_Model_Report.php CHANGED
@@ -106,7 +106,7 @@ class Logicbroker_Dropship360_Model_Report
106
 
107
  protected function genrateQueryInput($data){
108
 
109
- $this->_queryInput = array('dropshipStatus'=> $data['dropshipstatus'],'monitor_order'=> $data['input_monitor_order_post'],'open_monitor'=> $data['input_open_monitor_post']);
110
  return $this->_queryInput;
111
  }
112
 
@@ -129,7 +129,7 @@ class Logicbroker_Dropship360_Model_Report
129
  $collectionLbItem = $this->getOrderItemsCollection($open_monitor_from,$open_monitor_to,$orderId,$queryInputs['dropshipStatus']);
130
 
131
  $collectionLbItem->getSelect()->joinleft(array('salesOrder'=>Mage::getSingleton('core/resource')->getTableName('sales/order')),'salesOrder.entity_id = main_table.item_order_id', array('increment_id'));
132
- $collectionLbItem->getSelect()->joinleft(array('lbRanking'=>Mage::getSingleton('core/resource')->getTableName('logicbroker/ranking')),'lbRanking.lb_vendor_code = main_table.lb_vendor_code', array('lb_vendor_name'));
133
  $collectionLbItem->getSelect()->joinLeft(array('prod' => Mage::getSingleton('core/resource')->getTableName('catalog/product')),'prod.sku = main_table.sku',array('magento_pro_id'=>'entity_id'));
134
  $collectionLbItem->getSelect()->joinLeft(array('cpev' => Mage::getSingleton('core/resource')->getTableName('catalog/product').'_varchar'),'cpev.entity_id=prod.entity_id AND cpev.attribute_id='.$prodNameAttrId.'',array('product_name' => 'value'));
135
  $collectionLbItem->setOrder('updated_at', 'desc');
@@ -143,9 +143,10 @@ class Logicbroker_Dropship360_Model_Report
143
  return $this;
144
  }
145
 
 
146
  protected function getOrderItemsCollection($open_monitor_from = null,$open_monitor_to =null,$orderId,$status =null,$includeTime = true)
147
  {
148
- $collectionLbItem = Mage::getModel('logicbroker/orderitems')->getCollection()->addFieldTofilter('item_order_id ', array('in' => $orderId));
149
 
150
  if(!empty($status))
151
  {
@@ -187,65 +188,73 @@ class Logicbroker_Dropship360_Model_Report
187
  return $this;
188
  }
189
 
 
190
  $reportData = $this->getActivityReportData();
 
191
  $otherStatus = $this->calculateNotificationForOtherStatus($reportData);
192
- $helper = Mage::helper('logicbroker');
193
- foreach($otherStatus as $key=>$status){
194
- $reportData['dropshipstatus'] = $key;
195
- $reportData['notificationPer'] = $status;
196
- if($key == $helper::LOGICBROKER_ITEM_STATUS_TRANSMITTING){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
197
  if(!empty($reportData['notification_transmitting']))
198
- ($status >= $reportData['notification_transmitting']) ? $this->sendEmail($reportData) : '';
199
- }
200
- if($key == $helper::LOGICBROKER_ITEM_STATUS_BACKORDER){
201
- if(!empty($reportData['notification_backorder']))
202
- ($status >= $reportData['notification_backorder']) ? $this->sendEmail($reportData) : '';
203
- }
204
- if($key == $helper::LOGICBROKER_ITEM_STATUS_SENT_TO_SUPPLIER){
205
  if(!empty( $reportData['notification_sent_to_supplier']))
206
- ($status >= $reportData['notification_sent_to_supplier']) ? $this->sendEmail($reportData) : '';
207
- }
208
  }
209
- return;
210
  }
211
 
212
-
213
  protected function sendEmail($reportData){
214
 
215
  try {
216
-
217
- $reportData['isnewreg'] = false;
218
- $reportData['emailbody'] = $reportData['dropshipstatus']. ' Status has reached '.$reportData['notificationPer']. '%';
219
- $postObject = new Varien_Object();
220
- $postObject->setData($reportData);
221
- $mailTemplate = Mage::getModel('core/email_template');
222
-
223
- /* @var $mailTemplate Mage_Core_Model_Email_Template */
224
- $mailTemplate->setDesignConfig(array('area' => 'frontend'));
225
- $emails = explode(',',$reportData['email']);
226
-
227
- foreach($emails as $email)
 
 
 
 
 
 
228
  {
229
- $name = explode('@',$email);
230
- $mailTemplate->sendTransactional(
231
- 'logicbroker_email_email_template',
232
- 'general',
233
- $email,
234
- $name[0],
235
- array('templatevar' => $postObject)
236
- );
237
- }
238
- if (!$mailTemplate->getSentSuccess()) {
239
- Mage::helper('logicbroker')->genrateLog(0,'Installation notification started','Installation notification ended','Module installation notifiaction mail sending failed');
240
- return false;
241
-
242
  }
243
-
244
  return true;
245
  } catch (Exception $e) {
246
  return false;
247
  }
248
-
249
  }
250
 
251
  protected function calculateNotificationForOtherStatus($reportData){
@@ -253,22 +262,56 @@ class Logicbroker_Dropship360_Model_Report
253
  $queryInputs = $this->genrateQueryInput($reportData);
254
  $orderId = $this->getOrderIds($queryInputs);
255
  $statusPercent = array();
256
-
257
  $timeStringOpenMonitor = $this->getTimePeriod($queryInputs['open_monitor']);
258
- $open_monitor_from = Date('Y-m-d h:i:s', strtotime($timeStringOpenMonitor));
 
 
 
 
 
 
 
 
 
 
 
259
  $open_monitor_to = Mage::getModel('core/date')->gmtDate();
 
 
 
 
 
 
 
 
 
 
260
 
261
- $otherStatus = array('Transmitting','Backorder','Sent to Supplier');
 
 
 
 
 
 
 
 
 
 
 
262
 
263
- foreach($otherStatus as $data){
264
-
265
- $allItemOrder = $this->getOrderItemsCollection(null,null,$orderId,null,false)->getSize();
266
- $allItemWithtime = $this->getOrderItemsCollection($open_monitor_from,$open_monitor_to,$orderId,$data,true)->getSize();
267
- $statusPercent[$data] = round(($allItemWithtime / $allItemOrder) * $this->_percent);
268
-
269
- }
270
 
271
- return $statusPercent;
 
 
 
 
 
 
 
 
272
  }
273
  }
274
 
106
 
107
  protected function genrateQueryInput($data){
108
 
109
+ $this->_queryInput = array('dropshipStatus'=> $data['dropshipstatus'],'monitor_order'=> isset($data['input_monitor_order_post']) ? $data['input_monitor_order_post'] : '0-day','open_monitor'=> isset($data['input_open_monitor_post']) ? $data['input_open_monitor_post'] : '0-day','transmitting_time'=>isset($data['input_transmitting_filter_post']) ? $data['input_transmitting_filter_post'] : '0-day','sts_time'=>(isset($data['input_sentosup_filter_post']) ? $data['input_sentosup_filter_post'] : '0-day'));
110
  return $this->_queryInput;
111
  }
112
 
129
  $collectionLbItem = $this->getOrderItemsCollection($open_monitor_from,$open_monitor_to,$orderId,$queryInputs['dropshipStatus']);
130
 
131
  $collectionLbItem->getSelect()->joinleft(array('salesOrder'=>Mage::getSingleton('core/resource')->getTableName('sales/order')),'salesOrder.entity_id = main_table.item_order_id', array('increment_id'));
132
+ $collectionLbItem->getSelect()->joinleft(array('lbRanking'=>Mage::getSingleton('core/resource')->getTableName('dropship360/ranking')),'lbRanking.lb_vendor_code = main_table.lb_vendor_code', array('lb_vendor_name'));
133
  $collectionLbItem->getSelect()->joinLeft(array('prod' => Mage::getSingleton('core/resource')->getTableName('catalog/product')),'prod.sku = main_table.sku',array('magento_pro_id'=>'entity_id'));
134
  $collectionLbItem->getSelect()->joinLeft(array('cpev' => Mage::getSingleton('core/resource')->getTableName('catalog/product').'_varchar'),'cpev.entity_id=prod.entity_id AND cpev.attribute_id='.$prodNameAttrId.'',array('product_name' => 'value'));
135
  $collectionLbItem->setOrder('updated_at', 'desc');
143
  return $this;
144
  }
145
 
146
+
147
  protected function getOrderItemsCollection($open_monitor_from = null,$open_monitor_to =null,$orderId,$status =null,$includeTime = true)
148
  {
149
+ $collectionLbItem = Mage::getModel('dropship360/orderitems')->getCollection()->addFieldTofilter('item_order_id', array('in' => $orderId));
150
 
151
  if(!empty($status))
152
  {
188
  return $this;
189
  }
190
 
191
+
192
  $reportData = $this->getActivityReportData();
193
+
194
  $otherStatus = $this->calculateNotificationForOtherStatus($reportData);
195
+ $helper = Mage::helper('dropship360');
196
+ foreach($otherStatus['statusPercent'] as $itemStatus=>$percentage){
197
+ $reportData['dropshipstatus'] = $itemStatus;
198
+ $reportData['notificationPer'] = $percentage;
199
+ $reportData['filter'] = false;
200
+ $this->_selectStatus($itemStatus,$reportData,$percentage);
201
+
202
+ }
203
+ if(!empty($reportData['input_transmitting_filter']) || !empty($reportData['input_sentosup_filter']))
204
+ $this->sendStaticStatusMail($otherStatus['orderid'],$otherStatus['queryInput'],$reportData);
205
+ return $this;
206
+ }
207
+
208
+ protected function _selectStatus($itemStatus,$reportData,$perctange)
209
+ {
210
+ $helper = Mage::helper('dropship360');
211
+ switch($itemStatus)
212
+ {
213
+ case $helper::LOGICBROKER_ITEM_STATUS_TRANSMITTING :
214
  if(!empty($reportData['notification_transmitting']))
215
+ ($perctange >= $reportData['notification_transmitting']) ? $this->sendEmail($reportData) : '';
216
+ break;
217
+ case $helper::LOGICBROKER_ITEM_STATUS_BACKORDER :
218
+ if(!empty($reportData['notification_backorder']))
219
+ ($perctange >= $reportData['notification_backorder']) ? $this->sendEmail($reportData) : '';
220
+ break;
221
+ case $helper::LOGICBROKER_ITEM_STATUS_SENT_TO_SUPPLIER:
222
  if(!empty( $reportData['notification_sent_to_supplier']))
223
+ ($perctange >= $reportData['notification_sent_to_supplier']) ? $this->sendEmail($reportData) : '';
224
+ break;
225
  }
 
226
  }
227
 
 
228
  protected function sendEmail($reportData){
229
 
230
  try {
231
+ if($reportData['filter']){
232
+
233
+ $reportData['subject'] = 'dropship360 has overdue orders sitting in '.$reportData['type'].' Status';
234
+ $postObject = new Varien_Object();
235
+ $postObject->setData($reportData);
236
+ //$emails = explode(',',$reportData['email']);
237
+ $templateId = 'logicbroker_activty_report_staticstatus';
238
+
239
+ }else{
240
+ $reportData['isnewreg'] = false;
241
+ $reportData['emailbody'] = $reportData['dropshipstatus']. ' Status has reached '.$reportData['notificationPer']. '%';
242
+ $reportData['subject'] = 'Activity monitor report data';
243
+ $postObject = new Varien_Object();
244
+ $postObject->setData($reportData);
245
+ $templateId = 'logicbroker_email_email_template';
246
+ }
247
+ $emails = explode(',',$reportData['email']);
248
+ foreach($emails as $email)
249
  {
250
+ $isMailSent = Mage::helper('dropship360')->sendMail($postObject,$email,$templateId);
251
+ if(!$isMailSent)
252
+ Mage::log('Activity report email not sent to :'.$email, null, 'logicbroker_debug.log');
 
 
 
 
 
 
 
 
 
 
253
  }
 
254
  return true;
255
  } catch (Exception $e) {
256
  return false;
257
  }
 
258
  }
259
 
260
  protected function calculateNotificationForOtherStatus($reportData){
262
  $queryInputs = $this->genrateQueryInput($reportData);
263
  $orderId = $this->getOrderIds($queryInputs);
264
  $statusPercent = array();
265
+ $helper = Mage::helper('dropship360');
266
  $timeStringOpenMonitor = $this->getTimePeriod($queryInputs['open_monitor']);
267
+ $otherStatus = array($helper::LOGICBROKER_ITEM_STATUS_TRANSMITTING,$helper::LOGICBROKER_ITEM_STATUS_BACKORDER,$helper::LOGICBROKER_ITEM_STATUS_SENT_TO_SUPPLIER);
268
+
269
+ foreach($otherStatus as $statusType){
270
+ $statusPercent[$statusType] = $this->calculatePer($orderId,$statusType,$timeStringOpenMonitor);
271
+ }
272
+
273
+ return array('statusPercent'=>$statusPercent,'queryInput'=>$queryInputs,'orderid'=>$orderId);
274
+ }
275
+
276
+ protected function calculatePer($orderId,$statusType,$openMonitorTime){
277
+
278
+ $open_monitor_from = Date('Y-m-d h:i:s', strtotime($openMonitorTime));
279
  $open_monitor_to = Mage::getModel('core/date')->gmtDate();
280
+ $allItemOrder = $this->getOrderItemsCollection(null,null,$orderId,null,false)->getSize();
281
+ $allItemWithtime = $this->getOrderItemsCollection($open_monitor_from,$open_monitor_to,$orderId,$statusType,true)->getSize();
282
+ return round(($allItemWithtime / $allItemOrder) * $this->_percent);
283
+ }
284
+
285
+ protected function sendStaticStatusMail($orderId,$queryInputs,$reportData)
286
+ {
287
+ $helper = Mage::helper('dropship360');
288
+ $this->generateMailData($reportData,$orderId,$this->getTimePeriod($queryInputs['transmitting_time']),$helper::LOGICBROKER_ITEM_STATUS_TRANSMITTING);
289
+ $this->generateMailData($reportData,$orderId,$this->getTimePeriod($queryInputs['sts_time']),$helper::LOGICBROKER_ITEM_STATUS_SENT_TO_SUPPLIER);
290
 
291
+ }
292
+
293
+ protected function generateMailData($reportData,$orderId,$time,$statusType)
294
+ {
295
+ $open_monitor_from = Date('Y-m-d h:i:s', strtotime($time));
296
+ $open_monitor_to = Mage::getModel('core/date')->gmtDate();
297
+ $reportData['itemOject'] = $this->prepareMailGridData($this->getOrderItemsCollection($open_monitor_from,$open_monitor_to,$orderId,$statusType,true));
298
+ $percentage = $this->calculatePer($orderId,$statusType,$time);
299
+ $reportData['filter'] = true;
300
+ $reportData['type'] = $statusType;
301
+ $reportData['canshow'] = ($statusType == 'Transmitting') ? true : false;
302
+ $this->_selectStatus($statusType,$reportData,$percentage);
303
 
304
+ }
 
 
 
 
 
 
305
 
306
+ protected function prepareMailGridData($collectionLbItem){
307
+ $entityTypeId = Mage::getModel ( 'eav/config' )->getEntityType ( 'catalog_product' )->getEntityTypeId ();
308
+ $prodNameAttrId = Mage::getModel('eav/entity_attribute')->loadByCode($entityTypeId, 'name')->getAttributeId();
309
+ $collectionLbItem->getSelect()->joinleft(array('salesOrder'=>Mage::getSingleton('core/resource')->getTableName('sales/order')),'salesOrder.entity_id = main_table.item_order_id', array('increment_id'));
310
+ $collectionLbItem->getSelect()->joinleft(array('lbRanking'=>Mage::getSingleton('core/resource')->getTableName('dropship360/ranking')),'lbRanking.lb_vendor_code = main_table.lb_vendor_code', array('lb_vendor_name'));
311
+ $collectionLbItem->getSelect()->joinLeft(array('prod' => Mage::getSingleton('core/resource')->getTableName('catalog/product')),'prod.sku = main_table.sku',array('magento_pro_id'=>'entity_id'));
312
+ $collectionLbItem->getSelect()->joinLeft(array('cpev' => Mage::getSingleton('core/resource')->getTableName('catalog/product').'_varchar'),'cpev.entity_id=prod.entity_id AND cpev.attribute_id='.$prodNameAttrId.'',array('product_name' => 'value'));
313
+ $collectionLbItem->setOrder('updated_at', 'desc');
314
+ return $collectionLbItem;
315
  }
316
  }
317
 
includes/src/Logicbroker_Dropship360_Model_Resource_Inventory.php CHANGED
@@ -11,6 +11,6 @@ class Logicbroker_Dropship360_Model_Resource_Inventory extends Mage_Core_Model_M
11
  {
12
  protected function _construct()
13
  {
14
- $this->_init("logicbroker/inventory", "id");
15
  }
16
  }
11
  {
12
  protected function _construct()
13
  {
14
+ $this->_init("dropship360/inventory", "id");
15
  }
16
  }
includes/src/Logicbroker_Dropship360_Model_Resource_Inventory_Collection.php CHANGED
@@ -11,7 +11,7 @@
11
  {
12
 
13
  public function _construct(){
14
- $this->_init("logicbroker/inventory");
15
  }
16
 
17
 
11
  {
12
 
13
  public function _construct(){
14
+ $this->_init("dropship360/inventory");
15
  }
16
 
17
 
includes/src/Logicbroker_Dropship360_Model_Resource_Inventorylog.php CHANGED
@@ -11,6 +11,6 @@ class Logicbroker_Dropship360_Model_Resource_Inventorylog extends Mage_Core_Mode
11
  {
12
  protected function _construct()
13
  {
14
- $this->_init("logicbroker/inventorylog", "id");
15
  }
16
  }
11
  {
12
  protected function _construct()
13
  {
14
+ $this->_init("dropship360/inventorylog", "id");
15
  }
16
  }
includes/src/Logicbroker_Dropship360_Model_Resource_Inventorylog_Collection.php CHANGED
@@ -11,7 +11,7 @@
11
  {
12
 
13
  public function _construct(){
14
- $this->_init("logicbroker/inventorylog");
15
  }
16
 
17
 
11
  {
12
 
13
  public function _construct(){
14
+ $this->_init("dropship360/inventorylog");
15
  }
16
 
17
 
includes/src/Logicbroker_Dropship360_Model_Resource_Orderitems.php CHANGED
@@ -11,6 +11,48 @@ class Logicbroker_Dropship360_Model_Resource_Orderitems extends Mage_Core_Model_
11
  {
12
  protected function _construct()
13
  {
14
- $this->_init("logicbroker/orderitems", "id");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  }
16
  }
11
  {
12
  protected function _construct()
13
  {
14
+ $this->_init("dropship360/orderitems", "id");
15
+ }
16
+ public function saveOrderItems($itemData,$orderObj,$crontype)
17
+ {
18
+ try {
19
+ $adapter = $this->_getWriteAdapter();
20
+ $adapter->beginTransaction();
21
+ foreach ($itemData as $key => $item) {
22
+ $condition = array(
23
+ 'item_id = ?' => (int) $key,
24
+ );
25
+ unset($item['updateInventory']);
26
+ unset($item['qtyInvoiced']);
27
+ $adapter->update($this->getMainTable(),$item,$condition);
28
+ }
29
+ $adapter->commit();
30
+ foreach ($itemData as $key => $item) {
31
+ if($item ['updateInventory'])
32
+ Mage::getModel ( 'dropship360/orderitems' )->updateLbVendorInvenory ( $item['lb_vendor_code'],$item['sku'], $item['qtyInvoiced']);
33
+ if ($item['lb_item_status'] == Logicbroker_Dropship360_Helper_Data::LOGICBROKER_ITEM_STATUS_TRANSMITTING)
34
+ Mage::getModel('dropship360/logicbroker')->setupNotification();;
35
+ $this->saveOrderItemsComments($item,$orderObj);
36
+ }
37
+ } catch (Mage_Core_Exception $e) {
38
+ $adapter->rollBack();
39
+ throw $e;
40
+ } catch (Exception $e){
41
+ $adapter->rollBack();
42
+ Mage::logException($e);
43
+ Mage::helper('dropship360')->genrateLog(0,null,null,'Section :Error In saving order item data: '.$e->getMessage().' for orderid : '.$orderObj->getEntityId());
44
+ Mage::getModel('dropship360/ordersourcing')->sourcingCompleted($crontype);
45
+ }
46
+ }
47
+
48
+ protected function saveOrderItemsComments($itemData,$orderObj){
49
+ try {
50
+
51
+ $orderObj->addStatusHistoryComment($itemData['sku'].': Item status changed to '.$itemData['lb_item_status']);
52
+ $orderObj->save();
53
+ } catch (Exception $e) {
54
+ throw $e;
55
+ }
56
+
57
  }
58
  }
includes/src/Logicbroker_Dropship360_Model_Resource_Orderitems_Collection.php CHANGED
@@ -11,7 +11,7 @@
11
  {
12
 
13
  public function _construct(){
14
- $this->_init("logicbroker/orderitems");
15
  }
16
 
17
 
11
  {
12
 
13
  public function _construct(){
14
+ $this->_init("dropship360/orderitems");
15
  }
16
 
17
 
includes/src/Logicbroker_Dropship360_Model_Resource_Ordersourcing.php CHANGED
@@ -9,8 +9,44 @@
9
 
10
  class Logicbroker_Dropship360_Model_Resource_Ordersourcing extends Mage_Core_Model_Mysql4_Abstract
11
  {
 
12
  protected function _construct()
13
  {
14
- $this->_init("logicbroker/ordersourcing", "id");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  }
16
  }
9
 
10
  class Logicbroker_Dropship360_Model_Resource_Ordersourcing extends Mage_Core_Model_Mysql4_Abstract
11
  {
12
+
13
  protected function _construct()
14
  {
15
+ $this->_init("dropship360/ordersourcing", "id");
16
+ }
17
+
18
+ public function saveConfig($path, $value, $scope = 'default', $scopeId = 0)
19
+ {
20
+ try {
21
+
22
+ $writeAdapter = $this->_getWriteAdapter();
23
+ $select = $writeAdapter->select()
24
+ ->from( $this->getTable('core/config_data'))
25
+ ->where('path = ?', $path)
26
+ ->where('scope = ?', $scope)
27
+ ->where('scope_id = ?', $scopeId);
28
+ $row = $writeAdapter->fetchRow($select);
29
+
30
+ $newData = array(
31
+ 'scope' => $scope,
32
+ 'scope_id' => $scopeId,
33
+ 'path' => $path,
34
+ 'value' => $value
35
+ );
36
+ $writeAdapter->beginTransaction();
37
+ if ($row) {
38
+ $whereCondition = array('config_id =?' => $row['config_id']);
39
+ $writeAdapter->update($this->getTable('core/config_data'), $newData, $whereCondition);
40
+ } else {
41
+ $writeAdapter->insert($this->getTable('core/config_data'), $newData);
42
+ }
43
+ $writeAdapter->commit();
44
+ } catch (Mage_Core_Exception $e) {
45
+ $writeAdapter->rollBack();
46
+ throw $e;
47
+ } catch (Exception $e){
48
+ $adapter->rollBack();
49
+ Mage::logException($e);
50
+ }
51
  }
52
  }
includes/src/Logicbroker_Dropship360_Model_Resource_Ordersourcing_Collection.php CHANGED
@@ -11,7 +11,7 @@
11
  {
12
 
13
  public function _construct(){
14
- $this->_init("logicbroker/ordersourcing");
15
  }
16
 
17
 
11
  {
12
 
13
  public function _construct(){
14
+ $this->_init("dropship360/ordersourcing");
15
  }
16
 
17
 
includes/src/Logicbroker_Dropship360_Model_Resource_Ranking.php CHANGED
@@ -11,6 +11,6 @@ class Logicbroker_Dropship360_Model_Resource_Ranking extends Mage_Core_Model_Mys
11
  {
12
  protected function _construct()
13
  {
14
- $this->_init("logicbroker/ranking", "id");
15
  }
16
  }
11
  {
12
  protected function _construct()
13
  {
14
+ $this->_init("dropship360/ranking", "id");
15
  }
16
  }
includes/src/Logicbroker_Dropship360_Model_Resource_Ranking_Collection.php CHANGED
@@ -11,7 +11,7 @@
11
  {
12
 
13
  public function _construct(){
14
- $this->_init("logicbroker/ranking");
15
  }
16
 
17
 
11
  {
12
 
13
  public function _construct(){
14
+ $this->_init("dropship360/ranking");
15
  }
16
 
17
 
includes/src/Logicbroker_Dropship360_Model_Resource_Rankinglog.php CHANGED
@@ -11,6 +11,6 @@ class Logicbroker_Dropship360_Model_Resource_Rankinglog extends Mage_Core_Model_
11
  {
12
  protected function _construct()
13
  {
14
- $this->_init("logicbroker/rankinglog", "id");
15
  }
16
  }
11
  {
12
  protected function _construct()
13
  {
14
+ $this->_init("dropship360/rankinglog", "id");
15
  }
16
  }
includes/src/Logicbroker_Dropship360_Model_Resource_Rankinglog_Collection.php CHANGED
@@ -11,7 +11,7 @@
11
  {
12
 
13
  public function _construct(){
14
- $this->_init("logicbroker/rankinglog");
15
  }
16
 
17
 
11
  {
12
 
13
  public function _construct(){
14
+ $this->_init("dropship360/rankinglog");
15
  }
16
 
17
 
includes/src/Logicbroker_Dropship360_Model_Resource_Uploadvendor.php CHANGED
@@ -11,6 +11,6 @@ class Logicbroker_Dropship360_Model_Resource_Uploadvendor extends Mage_Core_Mode
11
  {
12
  protected function _construct()
13
  {
14
- $this->_init("logicbroker/uploadvendor", "file_id");
15
  }
16
  }
11
  {
12
  protected function _construct()
13
  {
14
+ $this->_init("dropship360/uploadvendor", "file_id");
15
  }
16
  }
includes/src/Logicbroker_Dropship360_Model_Resource_Uploadvendor_Collection.php CHANGED
@@ -11,7 +11,7 @@
11
  {
12
 
13
  public function _construct(){
14
- $this->_init("logicbroker/uploadvendor");
15
  }
16
 
17
 
11
  {
12
 
13
  public function _construct(){
14
+ $this->_init("dropship360/uploadvendor");
15
  }
16
 
17
 
includes/src/Logicbroker_Dropship360_Model_Resource_Vendorimportlog.php CHANGED
@@ -19,7 +19,7 @@ class Logicbroker_Dropship360_Model_Resource_Vendorimportlog
19
 
20
  public function insertLog($lb_vendor_code = null,$updated_by = null,$success = 0,$failure = 0,$ftp_error =null,$ftp_error_desc = null)
21
  {
22
- $this->_tableVendorImportLog = Mage::getSingleton ( 'core/resource' )->getTableName ( 'logicbroker/vendor_import_log' );
23
  $this->conn = $this->getDatabaseConnection();
24
  $this->conn->beginTransaction ();
25
  $created_at = now();
19
 
20
  public function insertLog($lb_vendor_code = null,$updated_by = null,$success = 0,$failure = 0,$ftp_error =null,$ftp_error_desc = null)
21
  {
22
+ $this->_tableVendorImportLog = Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship360/vendor_import_log' );
23
  $this->conn = $this->getDatabaseConnection();
24
  $this->conn->beginTransaction ();
25
  $created_at = now();
includes/src/Logicbroker_Dropship360_Model_System_Config_Backend_Oudatedinventory_Email.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+
4
+
5
+ * Logicbroker
6
+ *
7
+ * @category Community
8
+ * @package Logicbroker_Dropship360
9
+ */
10
+ class Logicbroker_Dropship360_Model_System_Config_Backend_Oudatedinventory_Email extends Mage_Core_Model_Config_Data
11
+ {
12
+ const CRON_STRING_PATH = 'crontab/jobs/logicbroker_oudated_product_inventory_cron/schedule/cron_expr';
13
+ const CRON_MODEL_PATH = 'crontab/jobs/logicbroker_oudated_product_inventory_cron/run/model';
14
+
15
+ /**
16
+ * Cron settings after save
17
+ *
18
+ * @return Mage_Adminhtml_Model_System_Config_Backend_Log_Cron
19
+ */
20
+ protected function _afterSave()
21
+ {
22
+ $enabled = $this->getData('groups/inventory_notification/fields/enabled/value');
23
+ $time = $this->getData('groups/inventory_notification/fields/cron_setting/value');
24
+ $cronExprString = '';
25
+ if ($enabled) {
26
+ if($time[0] == -2){
27
+ $cronExprArray = array(
28
+ ($time[1] == -1) ? '*' : '*/'.intval($time[1]),
29
+ '*',
30
+ '*', # Day of the Month
31
+ '*', # Month of the Year
32
+ '*', # Day of the Week
33
+ );
34
+ }else{
35
+ $cronExprArray = array(
36
+ ($time[1] == -1) ? '*' : intval($time[1]), # Minute
37
+ ($time[0] == -1) ? '*' : intval($time[0]), # Hour
38
+ '*', # Day of the Month
39
+ '*', # Month of the Year
40
+ '*', # Day of the Week
41
+ );
42
+ }
43
+ $cronExprString = join(' ', $cronExprArray);
44
+ }
45
+ try {
46
+ Mage::getModel('core/config_data')
47
+ ->load(self::CRON_STRING_PATH, 'path')
48
+ ->setValue($cronExprString)
49
+ ->setPath(self::CRON_STRING_PATH)
50
+ ->save();
51
+
52
+ Mage::getModel('core/config_data')
53
+ ->load(self::CRON_MODEL_PATH, 'path')
54
+ ->setValue((string) Mage::getConfig()->getNode(self::CRON_MODEL_PATH))
55
+ ->setPath(self::CRON_MODEL_PATH)
56
+ ->save();
57
+ } catch (Exception $e) {
58
+ Mage::throwException(Mage::helper('adminhtml')->__('Unable to save the cron expression.'));
59
+ }
60
+ }
61
+ }
includes/src/Logicbroker_Dropship360_Model_System_Config_Source_Attributecodes.php CHANGED
@@ -12,7 +12,7 @@ class Logicbroker_Dropship360_Model_System_Config_Source_Attributecodes extends
12
  {
13
  public function getAllOptions()
14
  {
15
- $vendorModel = Mage::getModel('logicbroker/ranking')->getCollection();
16
  $options = array();
17
  if($vendorModel->count() > 0 ){
18
  foreach ($vendorModel as $vendor) {
@@ -22,7 +22,7 @@ class Logicbroker_Dropship360_Model_System_Config_Source_Attributecodes extends
22
  );
23
  }
24
  }
25
- array_unshift($options,array('value' => '', 'label' => Mage::helper('logicbroker')->__('--Please Select--'))
26
  );
27
 
28
  if (!$this->_options) {
12
  {
13
  public function getAllOptions()
14
  {
15
+ $vendorModel = Mage::getModel('dropship360/ranking')->getCollection();
16
  $options = array();
17
  if($vendorModel->count() > 0 ){
18
  foreach ($vendorModel as $vendor) {
22
  );
23
  }
24
  }
25
+ array_unshift($options,array('value' => '', 'label' => Mage::helper('dropship360')->__('--Please Select--'))
26
  );
27
 
28
  if (!$this->_options) {
includes/src/Logicbroker_Dropship360_Model_System_Config_Source_Category.php CHANGED
@@ -24,7 +24,7 @@ class Logicbroker_Dropship360_Model_System_Config_Source_Category
24
  );
25
  }
26
 
27
- array_unshift($options,array('value' => '', 'label' => Mage::helper('logicbroker')->__('--Please Select--'))
28
  );
29
 
30
  return $options;
24
  );
25
  }
26
 
27
+ array_unshift($options,array('value' => '', 'label' => Mage::helper('dropship360')->__('--Please Select--'))
28
  );
29
 
30
  return $options;
includes/src/Logicbroker_Dropship360_Model_System_Config_Source_Ediqualifier.php CHANGED
@@ -13,45 +13,45 @@ class Logicbroker_Dropship360_Model_System_Config_Source_Ediqualifier {
13
  public function toOptionArray()
14
  {
15
  return array(
16
- array('value' => '', 'label' => Mage::helper('logicbroker')->__('--Please Select--')),
17
- array('value' => Mage::helper('logicbroker')->__('01 Duns (Dun & Bradstreet)'), 'label' => Mage::helper('logicbroker')->__('01 Duns (Dun & Bradstreet)')),
18
- array('value' => Mage::helper('logicbroker')->__('02 SCAC (Standard Carrier Alpha Code)'), 'label' => Mage::helper('logicbroker')->__('02 SCAC (Standard Carrier Alpha Code)')),
19
- array('value' => Mage::helper('logicbroker')->__('03 FMC (Federal Maritime Commission)'), 'label' => Mage::helper('logicbroker')->__('03 FMC (Federal Maritime Commission)')),
20
- array('value' => Mage::helper('logicbroker')->__('04 IATA (International Air Transport Association)'), 'label' => Mage::helper('logicbroker')->__('04 IATA (International Air Transport Association)')),
21
- array('value' => Mage::helper('logicbroker')->__('08 UCC EDI Communications ID (Comm ID)'), 'label' => Mage::helper('logicbroker')->__('08 UCC EDI Communications ID (Comm ID)')),
22
- array('value' => Mage::helper('logicbroker')->__('09 X.121 (CCITT)'), 'label' => Mage::helper('logicbroker')->__('09 X.121 (CCITT)')),
23
- array('value' => Mage::helper('logicbroker')->__('10 Department of Defence (DoD) Activity Address Code'), 'label' => Mage::helper('logicbroker')->__('10 Department of Defence (DoD) Activity Address Code')),
24
- array('value' => Mage::helper('logicbroker')->__('11 DEA (Drug Enforcement Administration)'), 'label' => Mage::helper('logicbroker')->__('11 DEA (Drug Enforcement Administration)')),
25
- array('value' => Mage::helper('logicbroker')->__('12 Phone (Telephone Companies)'), 'label' => Mage::helper('logicbroker')->__('12 Phone (Telephone Companies)')),
26
- array('value' => Mage::helper('logicbroker')->__('13 UCS Code (UCS Code is a Code is Used for UCS Transmissions, it includes the Area Code and Telephone Number of Modem, it Does Not Include Punctuation, Blanks or Access Code )'), 'label' => Mage::helper('logicbroker')->__('13 UCS Code (UCS Code is a Code is Used for UCS Transmissions, it includes the Area Code and Telephone Number of Modem, it Does Not Include Punctuation, Blanks or Access Code )')),
27
- array('value' => Mage::helper('logicbroker')->__('14 Duns Plus Suffix'), 'label' => Mage::helper('logicbroker')->__('14 Duns Plus Suffix')),
28
- array('value' => Mage::helper('logicbroker')->__('15 Petroleum Accountants Society Of Canada Company Code'), 'label' => Mage::helper('logicbroker')->__('15 Petroleum Accountants Society Of Canada Company Code')),
29
- array('value' => Mage::helper('logicbroker')->__('16 Duns Number With 4-Character Suffix'), 'label' => Mage::helper('logicbroker')->__('16 Duns Number With 4-Character Suffix')),
30
- array('value' => Mage::helper('logicbroker')->__('17 American Bankers Association (ABA) Transit Routing Number (Including check digit, 9-digit )'), 'label' => Mage::helper('logicbroker')->__('17 American Bankers Association (ABA) Transit Routing Number (Including check digit, 9-digit )')),
31
- array('value' => Mage::helper('logicbroker')->__('18 Association of American Railroads (AAR) Standard Distribution Code'), 'label' => Mage::helper('logicbroker')->__('18 Association of American Railroads (AAR) Standard Distribution Code')),
32
- array('value' => Mage::helper('logicbroker')->__('19 EDI Council of Australia (EDICA) Communications ID Number (COMM ID)'), 'label' => Mage::helper('logicbroker')->__('19 EDI Council of Australia (EDICA) Communications ID Number (COMM ID)')),
33
- array('value' => Mage::helper('logicbroker')->__('20 Health Industry Number (HIN)'), 'label' => Mage::helper('logicbroker')->__('20 Health Industry Number (HIN)')),
34
- array('value' => Mage::helper('logicbroker')->__('21 Integrated Postsecondary Education Data system, or (IPEDS)'), 'label' => Mage::helper('logicbroker')->__('21 Integrated Postsecondary Education Data system, or (IPEDS)')),
35
- array('value' => Mage::helper('logicbroker')->__('22 Federal Interagency Commision on Education, or FICE'), 'label' => Mage::helper('logicbroker')->__('22 Federal Interagency Commision on Education, or FICE')),
36
- array('value' => Mage::helper('logicbroker')->__('23 National Center for Education Statistics Common Core Of Data 12-Digit Number For Pre-K-Grade 12 Institutes, or NCES'), 'label' => Mage::helper('logicbroker')->__('23 National Center for Education Statistics Common Core Of Data 12-Digit Number For Pre-K-Grade 12 Institutes, or NCES')),
37
- array('value' => Mage::helper('logicbroker')->__('24 The College Board`s Admission Testing Program 4-Digit Code Of Postsecondary Institutes, or ATP'), 'label' => Mage::helper('logicbroker')->__('24 The College Board`s Admission Testing Program 4-Digit Code Of Postsecondary Institutes, or ATP')),
38
- array('value' => Mage::helper('logicbroker')->__('25 American College Testing Program 4-Digit code Of Postsecondary Institutions, or ACT'), 'label' => Mage::helper('logicbroker')->__('25 American College Testing Program 4-Digit code Of Postsecondary Institutions, or ACT')),
39
- array('value' => Mage::helper('logicbroker')->__('26 Statistics of Canada List Of Postsecondary Institutions'), 'label' => Mage::helper('logicbroker')->__('26 Statistics of Canada List Of Postsecondary Institutions')),
40
- array('value' => Mage::helper('logicbroker')->__('27 Carrier Identification Number as assigned by Health Care Financing Administration (HCFA)'), 'label' => Mage::helper('logicbroker')->__('27 Carrier Identification Number as assigned by Health Care Financing Administration (HCFA)')),
41
- array('value' => Mage::helper('logicbroker')->__('28 Fiscal Intermediary Identification Number as assigned by Health Care Financing Administration (HCFA)'), 'label' => Mage::helper('logicbroker')->__('28 Fiscal Intermediary Identification Number as assigned by Health Care Financing Administration (HCFA)')),
42
- array('value' => Mage::helper('logicbroker')->__('29 Medicare Provider and Supplier Identification Number as assigned by Health Care Financing Administration (HCFA)'), 'label' => Mage::helper('logicbroker')->__('29 Medicare Provider and Supplier Identification Number as assigned by Health Care Financing Administration (HCFA)')),
43
- array('value' => Mage::helper('logicbroker')->__('30 U.S. Federal Tax Identification Number'), 'label' => Mage::helper('logicbroker')->__('30 U.S. Federal Tax Identification Number')),
44
- array('value' => Mage::helper('logicbroker')->__('31 Jurisdiction Identification Number Plus 4 as assigned by the International Association Of Industrial Accident Boards and Commissions (IAIABC)'), 'label' => Mage::helper('logicbroker')->__('31 Jurisdiction Identification Number Plus 4 as assigned by the International Association Of Industrial Accident Boards and Commissions (IAIABC)')),
45
- array('value' => Mage::helper('logicbroker')->__('32 U.S. Federal Employer Identification Number (FEIN)'), 'label' => Mage::helper('logicbroker')->__('32 U.S. Federal Employer Identification Number (FEIN)')),
46
- array('value' => Mage::helper('logicbroker')->__('33 National Association Of Insurance Commissioners Company Code (NAIC)'), 'label' => Mage::helper('logicbroker')->__('33 National Association Of Insurance Commissioners Company Code (NAIC)')),
47
- array('value' => Mage::helper('logicbroker')->__('34 Medicaid Provider and Supplier Identification Number as assigned by individual State Medicaid Agencies in conjunction with Health Care Financing Administration (HCFA)'), 'label' => Mage::helper('logicbroker')->__('34 Medicaid Provider and Supplier Identification Number as assigned by individual State Medicaid Agencies in Conjunction with Health Care Financing Administration (HCFA)')),
48
- array('value' => Mage::helper('logicbroker')->__('35 Statistics Canada Canadian College Student Information System Institution Codes'), 'label' => Mage::helper('logicbroker')->__('35 Statistics Canada Canadian College Student Information System Institution Codes')),
49
- array('value' => Mage::helper('logicbroker')->__('36 Statistics Canada University Student Information System Institution codes'), 'label' => Mage::helper('logicbroker')->__('36 Statistics Canada University Student Information System Institution codes')),
50
- array('value' => Mage::helper('logicbroker')->__('37 Society of Property Information Compilers and Analysts'), 'label' => Mage::helper('logicbroker')->__('37 Society of Property Information Compilers and Analysts')),
51
- array('value' => Mage::helper('logicbroker')->__('AM Association Mexicana del Codigo de Producto (AMECOP) Communication ID'), 'label' => Mage::helper('logicbroker')->__('AM Association Mexicana del Codigo de Producto (AMECOP) Communication ID')),
52
- array('value' => Mage::helper('logicbroker')->__('NR National Retail Merchants Association (NRMA) - Assigned'), 'label' => Mage::helper('logicbroker')->__('NR National Retail Merchants Association (NRMA) - Assigned')),
53
- array('value' => Mage::helper('logicbroker')->__('SN Standard Address Number'), 'label' => Mage::helper('logicbroker')->__('SN Standard Address Number')),
54
- array('value' => Mage::helper('logicbroker')->__('ZZ Mutually Defined'), 'label' => Mage::helper('logicbroker')->__('ZZ Mutually Defined')),
55
  );
56
  }
57
 
13
  public function toOptionArray()
14
  {
15
  return array(
16
+ array('value' => '', 'label' => Mage::helper('dropship360')->__('--Please Select--')),
17
+ array('value' => Mage::helper('dropship360')->__('01 Duns (Dun & Bradstreet)'), 'label' => Mage::helper('dropship360')->__('01 Duns (Dun & Bradstreet)')),
18
+ array('value' => Mage::helper('dropship360')->__('02 SCAC (Standard Carrier Alpha Code)'), 'label' => Mage::helper('dropship360')->__('02 SCAC (Standard Carrier Alpha Code)')),
19
+ array('value' => Mage::helper('dropship360')->__('03 FMC (Federal Maritime Commission)'), 'label' => Mage::helper('dropship360')->__('03 FMC (Federal Maritime Commission)')),
20
+ array('value' => Mage::helper('dropship360')->__('04 IATA (International Air Transport Association)'), 'label' => Mage::helper('dropship360')->__('04 IATA (International Air Transport Association)')),
21
+ array('value' => Mage::helper('dropship360')->__('08 UCC EDI Communications ID (Comm ID)'), 'label' => Mage::helper('dropship360')->__('08 UCC EDI Communications ID (Comm ID)')),
22
+ array('value' => Mage::helper('dropship360')->__('09 X.121 (CCITT)'), 'label' => Mage::helper('dropship360')->__('09 X.121 (CCITT)')),
23
+ array('value' => Mage::helper('dropship360')->__('10 Department of Defence (DoD) Activity Address Code'), 'label' => Mage::helper('dropship360')->__('10 Department of Defence (DoD) Activity Address Code')),
24
+ array('value' => Mage::helper('dropship360')->__('11 DEA (Drug Enforcement Administration)'), 'label' => Mage::helper('dropship360')->__('11 DEA (Drug Enforcement Administration)')),
25
+ array('value' => Mage::helper('dropship360')->__('12 Phone (Telephone Companies)'), 'label' => Mage::helper('dropship360')->__('12 Phone (Telephone Companies)')),
26
+ array('value' => Mage::helper('dropship360')->__('13 UCS Code (UCS Code is a Code is Used for UCS Transmissions, it includes the Area Code and Telephone Number of Modem, it Does Not Include Punctuation, Blanks or Access Code )'), 'label' => Mage::helper('dropship360')->__('13 UCS Code (UCS Code is a Code is Used for UCS Transmissions, it includes the Area Code and Telephone Number of Modem, it Does Not Include Punctuation, Blanks or Access Code )')),
27
+ array('value' => Mage::helper('dropship360')->__('14 Duns Plus Suffix'), 'label' => Mage::helper('dropship360')->__('14 Duns Plus Suffix')),
28
+ array('value' => Mage::helper('dropship360')->__('15 Petroleum Accountants Society Of Canada Company Code'), 'label' => Mage::helper('dropship360')->__('15 Petroleum Accountants Society Of Canada Company Code')),
29
+ array('value' => Mage::helper('dropship360')->__('16 Duns Number With 4-Character Suffix'), 'label' => Mage::helper('dropship360')->__('16 Duns Number With 4-Character Suffix')),
30
+ array('value' => Mage::helper('dropship360')->__('17 American Bankers Association (ABA) Transit Routing Number (Including check digit, 9-digit )'), 'label' => Mage::helper('dropship360')->__('17 American Bankers Association (ABA) Transit Routing Number (Including check digit, 9-digit )')),
31
+ array('value' => Mage::helper('dropship360')->__('18 Association of American Railroads (AAR) Standard Distribution Code'), 'label' => Mage::helper('dropship360')->__('18 Association of American Railroads (AAR) Standard Distribution Code')),
32
+ array('value' => Mage::helper('dropship360')->__('19 EDI Council of Australia (EDICA) Communications ID Number (COMM ID)'), 'label' => Mage::helper('dropship360')->__('19 EDI Council of Australia (EDICA) Communications ID Number (COMM ID)')),
33
+ array('value' => Mage::helper('dropship360')->__('20 Health Industry Number (HIN)'), 'label' => Mage::helper('dropship360')->__('20 Health Industry Number (HIN)')),
34
+ array('value' => Mage::helper('dropship360')->__('21 Integrated Postsecondary Education Data system, or (IPEDS)'), 'label' => Mage::helper('dropship360')->__('21 Integrated Postsecondary Education Data system, or (IPEDS)')),
35
+ array('value' => Mage::helper('dropship360')->__('22 Federal Interagency Commision on Education, or FICE'), 'label' => Mage::helper('dropship360')->__('22 Federal Interagency Commision on Education, or FICE')),
36
+ array('value' => Mage::helper('dropship360')->__('23 National Center for Education Statistics Common Core Of Data 12-Digit Number For Pre-K-Grade 12 Institutes, or NCES'), 'label' => Mage::helper('dropship360')->__('23 National Center for Education Statistics Common Core Of Data 12-Digit Number For Pre-K-Grade 12 Institutes, or NCES')),
37
+ array('value' => Mage::helper('dropship360')->__('24 The College Board`s Admission Testing Program 4-Digit Code Of Postsecondary Institutes, or ATP'), 'label' => Mage::helper('dropship360')->__('24 The College Board`s Admission Testing Program 4-Digit Code Of Postsecondary Institutes, or ATP')),
38
+ array('value' => Mage::helper('dropship360')->__('25 American College Testing Program 4-Digit code Of Postsecondary Institutions, or ACT'), 'label' => Mage::helper('dropship360')->__('25 American College Testing Program 4-Digit code Of Postsecondary Institutions, or ACT')),
39
+ array('value' => Mage::helper('dropship360')->__('26 Statistics of Canada List Of Postsecondary Institutions'), 'label' => Mage::helper('dropship360')->__('26 Statistics of Canada List Of Postsecondary Institutions')),
40
+ array('value' => Mage::helper('dropship360')->__('27 Carrier Identification Number as assigned by Health Care Financing Administration (HCFA)'), 'label' => Mage::helper('dropship360')->__('27 Carrier Identification Number as assigned by Health Care Financing Administration (HCFA)')),
41
+ array('value' => Mage::helper('dropship360')->__('28 Fiscal Intermediary Identification Number as assigned by Health Care Financing Administration (HCFA)'), 'label' => Mage::helper('dropship360')->__('28 Fiscal Intermediary Identification Number as assigned by Health Care Financing Administration (HCFA)')),
42
+ array('value' => Mage::helper('dropship360')->__('29 Medicare Provider and Supplier Identification Number as assigned by Health Care Financing Administration (HCFA)'), 'label' => Mage::helper('dropship360')->__('29 Medicare Provider and Supplier Identification Number as assigned by Health Care Financing Administration (HCFA)')),
43
+ array('value' => Mage::helper('dropship360')->__('30 U.S. Federal Tax Identification Number'), 'label' => Mage::helper('dropship360')->__('30 U.S. Federal Tax Identification Number')),
44
+ array('value' => Mage::helper('dropship360')->__('31 Jurisdiction Identification Number Plus 4 as assigned by the International Association Of Industrial Accident Boards and Commissions (IAIABC)'), 'label' => Mage::helper('dropship360')->__('31 Jurisdiction Identification Number Plus 4 as assigned by the International Association Of Industrial Accident Boards and Commissions (IAIABC)')),
45
+ array('value' => Mage::helper('dropship360')->__('32 U.S. Federal Employer Identification Number (FEIN)'), 'label' => Mage::helper('dropship360')->__('32 U.S. Federal Employer Identification Number (FEIN)')),
46
+ array('value' => Mage::helper('dropship360')->__('33 National Association Of Insurance Commissioners Company Code (NAIC)'), 'label' => Mage::helper('dropship360')->__('33 National Association Of Insurance Commissioners Company Code (NAIC)')),
47
+ array('value' => Mage::helper('dropship360')->__('34 Medicaid Provider and Supplier Identification Number as assigned by individual State Medicaid Agencies in conjunction with Health Care Financing Administration (HCFA)'), 'label' => Mage::helper('dropship360')->__('34 Medicaid Provider and Supplier Identification Number as assigned by individual State Medicaid Agencies in Conjunction with Health Care Financing Administration (HCFA)')),
48
+ array('value' => Mage::helper('dropship360')->__('35 Statistics Canada Canadian College Student Information System Institution Codes'), 'label' => Mage::helper('dropship360')->__('35 Statistics Canada Canadian College Student Information System Institution Codes')),
49
+ array('value' => Mage::helper('dropship360')->__('36 Statistics Canada University Student Information System Institution codes'), 'label' => Mage::helper('dropship360')->__('36 Statistics Canada University Student Information System Institution codes')),
50
+ array('value' => Mage::helper('dropship360')->__('37 Society of Property Information Compilers and Analysts'), 'label' => Mage::helper('dropship360')->__('37 Society of Property Information Compilers and Analysts')),
51
+ array('value' => Mage::helper('dropship360')->__('AM Association Mexicana del Codigo de Producto (AMECOP) Communication ID'), 'label' => Mage::helper('dropship360')->__('AM Association Mexicana del Codigo de Producto (AMECOP) Communication ID')),
52
+ array('value' => Mage::helper('dropship360')->__('NR National Retail Merchants Association (NRMA) - Assigned'), 'label' => Mage::helper('dropship360')->__('NR National Retail Merchants Association (NRMA) - Assigned')),
53
+ array('value' => Mage::helper('dropship360')->__('SN Standard Address Number'), 'label' => Mage::helper('dropship360')->__('SN Standard Address Number')),
54
+ array('value' => Mage::helper('dropship360')->__('ZZ Mutually Defined'), 'label' => Mage::helper('dropship360')->__('ZZ Mutually Defined')),
55
  );
56
  }
57
 
includes/src/Logicbroker_Dropship360_Model_System_Config_Source_Ftptype.php CHANGED
@@ -12,8 +12,8 @@ class Logicbroker_Dropship360_Model_System_Config_Source_Ftptype
12
  {
13
 
14
  return array(
15
- array('value' => '', 'label' => Mage::helper('logicbroker')->__('--Please Select--')),
16
- array('value' => 'ftp', 'label' => Mage::helper('logicbroker')->__('FTP'))
17
  );
18
  }
19
  }
12
  {
13
 
14
  return array(
15
+ array('value' => '', 'label' => Mage::helper('dropship360')->__('--Please Select--')),
16
+ array('value' => 'ftp', 'label' => Mage::helper('dropship360')->__('FTP'))
17
  );
18
  }
19
  }
includes/src/Logicbroker_Dropship360_Model_System_Config_Source_Optionvalues.php CHANGED
@@ -15,13 +15,13 @@ class Logicbroker_Dropship360_Model_System_Config_Source_Optionvalues {
15
 
16
  $optionsArray = $this->getOptionValue();
17
  if(is_array($optionsArray)){
18
- array_unshift($optionsArray,array('value' => '', 'label' => Mage::helper('logicbroker')->__('--Please Select--')));
19
- array_push($optionsArray,array('value' => 'addnew', 'label' => Mage::helper('logicbroker')->__('Add new code')));
20
  }
21
  else
22
  {
23
- $optionsArray = array(array('value' => '', 'label' => Mage::helper('logicbroker')->__('--Please Select--')),
24
- array('value' => 'addnew', 'label' => Mage::helper('logicbroker')->__('Add new code')));
25
  }
26
  // echo '<pre>';
27
  // print_r($optionsArray);
@@ -33,7 +33,7 @@ class Logicbroker_Dropship360_Model_System_Config_Source_Optionvalues {
33
  public function getOptionValue()
34
  {
35
  $integration = Mage::getStoreConfig('logicbroker_integration/integration/supplier_attribute');
36
- $logicbrokerCollection = Mage::getModel('logicbroker/supplier')->getCollection();
37
  $attributeArray = array();
38
  if($integration != null && $integration)
39
  {
@@ -41,7 +41,7 @@ class Logicbroker_Dropship360_Model_System_Config_Source_Optionvalues {
41
  $options = $attributeDetails->getSource()->getAllOptions(false);
42
  foreach ($options as $option) {
43
 
44
- $attributeArray[] = array('value'=>$option["label"],'label' => Mage::helper('logicbroker')->__(strtolower($option["label"])));
45
  }
46
  }else
47
  {
@@ -50,7 +50,7 @@ class Logicbroker_Dropship360_Model_System_Config_Source_Optionvalues {
50
  $comapnyIds = $logicbrokerCollection->getData();
51
  if (count($comapnyIds) > 0) {
52
  foreach ($comapnyIds as $key=>$value) {
53
- $attributeArray[] = array('value'=>$value['magento_vendor_code'],'label' => Mage::helper('logicbroker')->__(strtolower($value['magento_vendor_code'])));
54
  }
55
  }
56
  }
15
 
16
  $optionsArray = $this->getOptionValue();
17
  if(is_array($optionsArray)){
18
+ array_unshift($optionsArray,array('value' => '', 'label' => Mage::helper('dropship360')->__('--Please Select--')));
19
+ array_push($optionsArray,array('value' => 'addnew', 'label' => Mage::helper('dropship360')->__('Add new code')));
20
  }
21
  else
22
  {
23
+ $optionsArray = array(array('value' => '', 'label' => Mage::helper('dropship360')->__('--Please Select--')),
24
+ array('value' => 'addnew', 'label' => Mage::helper('dropship360')->__('Add new code')));
25
  }
26
  // echo '<pre>';
27
  // print_r($optionsArray);
33
  public function getOptionValue()
34
  {
35
  $integration = Mage::getStoreConfig('logicbroker_integration/integration/supplier_attribute');
36
+ $logicbrokerCollection = Mage::getModel('dropship360/supplier')->getCollection();
37
  $attributeArray = array();
38
  if($integration != null && $integration)
39
  {
41
  $options = $attributeDetails->getSource()->getAllOptions(false);
42
  foreach ($options as $option) {
43
 
44
+ $attributeArray[] = array('value'=>$option["label"],'label' => Mage::helper('dropship360')->__(strtolower($option["label"])));
45
  }
46
  }else
47
  {
50
  $comapnyIds = $logicbrokerCollection->getData();
51
  if (count($comapnyIds) > 0) {
52
  foreach ($comapnyIds as $key=>$value) {
53
+ $attributeArray[] = array('value'=>$value['magento_vendor_code'],'label' => Mage::helper('dropship360')->__(strtolower($value['magento_vendor_code'])));
54
  }
55
  }
56
  }
includes/src/Logicbroker_Dropship360_Model_System_Config_Source_Ranktype.php CHANGED
@@ -12,9 +12,9 @@ class Logicbroker_Dropship360_Model_System_Config_Source_Ranktype
12
  {
13
 
14
  return array(
15
- array('value' => '', 'label' => Mage::helper('logicbroker')->__('--Please Select--')),
16
- array('value' => 'default', 'label' => Mage::helper('logicbroker')->__('Ranked Based')),
17
- array('value' => 'cost', 'label' => Mage::helper('logicbroker')->__('Cost Based'))
18
 
19
  );
20
  }
12
  {
13
 
14
  return array(
15
+ array('value' => '', 'label' => Mage::helper('dropship360')->__('--Please Select--')),
16
+ array('value' => 'default', 'label' => Mage::helper('dropship360')->__('Ranked Based')),
17
+ array('value' => 'cost', 'label' => Mage::helper('dropship360')->__('Cost Based'))
18
 
19
  );
20
  }
includes/src/Logicbroker_Dropship360_Model_System_Config_Source_Vendorlist.php CHANGED
@@ -11,11 +11,11 @@ class Logicbroker_Dropship360_Model_System_Config_Source_Vendorlist
11
  public function toOptionArray($addEmpty = true)
12
  {
13
  $options =array();
14
- $collectionVendor = Mage::getModel ( 'logicbroker/inventory' )->getCollection ();
15
 
16
 
17
  $collectionVendor->getSelect ()->joinleft ( array (
18
- 'lbRanking' => Mage::getSingleton ( 'core/resource' )->getTableName ( 'logicbroker/ranking' )
19
  ), 'lbRanking.lb_vendor_code = main_table.lb_vendor_code', array (
20
  '*'
21
  ) )->where('lbRanking.is_dropship = ?','yes');
@@ -29,14 +29,14 @@ class Logicbroker_Dropship360_Model_System_Config_Source_Vendorlist
29
  );
30
  }
31
  }
32
- array_unshift($options,array('value' => '', 'label' => Mage::helper('logicbroker')->__('--Please Select--')),array('value' => 'none', 'label' => Mage::helper('logicbroker')->__('None')));
33
  return $options;
34
  }
35
 
36
  public function vendorList($addEmpty = true,$sku)
37
  {
38
- $vendorModel = Mage::getModel('logicbroker/ranking')->getCollection();
39
- $vendorModel->getSelect ()->where('main_table.lb_vendor_code not in (select lb_vendor_code from '.Mage::getSingleton ( 'core/resource' )->getTableName ( 'logicbroker/inventory' ).' where product_sku = ?)',$sku);
40
  $options = array();
41
  if($vendorModel->count() > 0 ){
42
  foreach ($vendorModel as $vendor) {
@@ -46,7 +46,7 @@ class Logicbroker_Dropship360_Model_System_Config_Source_Vendorlist
46
  );
47
  }
48
  }
49
- array_unshift($options,array('value' => '', 'label' => Mage::helper('logicbroker')->__('--Please Select--'))
50
  );
51
  return $options;
52
  }
@@ -54,9 +54,9 @@ class Logicbroker_Dropship360_Model_System_Config_Source_Vendorlist
54
  public function vendorListSourcing($addEmpty = true,$sku)
55
  {
56
  $options =array();
57
- $collectionVendor = Mage::getModel ( 'logicbroker/inventory' )->getCollection ()->addFieldToFilter('product_sku',$sku);
58
  $collectionVendor->getSelect ()->joinleft ( array (
59
- 'lbRanking' => Mage::getSingleton ( 'core/resource' )->getTableName ( 'logicbroker/ranking' )
60
  ), 'lbRanking.lb_vendor_code = main_table.lb_vendor_code', array (
61
  '*'
62
  ) )->where('lbRanking.is_dropship = ?','yes');
@@ -71,14 +71,14 @@ class Logicbroker_Dropship360_Model_System_Config_Source_Vendorlist
71
  );
72
  }
73
  }
74
- array_unshift($options,array('value' => '', 'label' => Mage::helper('logicbroker')->__('--Please Select--')));
75
  return $options;
76
  }
77
 
78
  public function getAllVendor($addEmpty = true)
79
  {
80
  $options =array();
81
- $collectionVendor = Mage::getModel ( 'logicbroker/ranking' )->getCollection ();
82
 
83
  if($collectionVendor->count() > 0){
84
  foreach ($collectionVendor as $vendor) {
@@ -88,7 +88,7 @@ class Logicbroker_Dropship360_Model_System_Config_Source_Vendorlist
88
  );
89
  }
90
  }
91
- array_unshift($options,array('value' => '', 'label' => Mage::helper('logicbroker')->__('--Please Select--')));
92
  return $options;
93
  }
94
  }
11
  public function toOptionArray($addEmpty = true)
12
  {
13
  $options =array();
14
+ $collectionVendor = Mage::getModel ( 'dropship360/inventory' )->getCollection ();
15
 
16
 
17
  $collectionVendor->getSelect ()->joinleft ( array (
18
+ 'lbRanking' => Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship360/ranking' )
19
  ), 'lbRanking.lb_vendor_code = main_table.lb_vendor_code', array (
20
  '*'
21
  ) )->where('lbRanking.is_dropship = ?','yes');
29
  );
30
  }
31
  }
32
+ array_unshift($options,array('value' => '', 'label' => Mage::helper('dropship360')->__('--Please Select--')),array('value' => 'none', 'label' => Mage::helper('dropship360')->__('None')));
33
  return $options;
34
  }
35
 
36
  public function vendorList($addEmpty = true,$sku)
37
  {
38
+ $vendorModel = Mage::getModel('dropship360/ranking')->getCollection();
39
+ $vendorModel->getSelect ()->where('main_table.lb_vendor_code not in (select lb_vendor_code from '.Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship360/inventory' ).' where product_sku = ?)',$sku);
40
  $options = array();
41
  if($vendorModel->count() > 0 ){
42
  foreach ($vendorModel as $vendor) {
46
  );
47
  }
48
  }
49
+ array_unshift($options,array('value' => '', 'label' => Mage::helper('dropship360')->__('--Please Select--'))
50
  );
51
  return $options;
52
  }
54
  public function vendorListSourcing($addEmpty = true,$sku)
55
  {
56
  $options =array();
57
+ $collectionVendor = Mage::getModel ( 'dropship360/inventory' )->getCollection ()->addFieldToFilter('product_sku',$sku);
58
  $collectionVendor->getSelect ()->joinleft ( array (
59
+ 'lbRanking' => Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship360/ranking' )
60
  ), 'lbRanking.lb_vendor_code = main_table.lb_vendor_code', array (
61
  '*'
62
  ) )->where('lbRanking.is_dropship = ?','yes');
71
  );
72
  }
73
  }
74
+ array_unshift($options,array('value' => '', 'label' => Mage::helper('dropship360')->__('--Please Select--')));
75
  return $options;
76
  }
77
 
78
  public function getAllVendor($addEmpty = true)
79
  {
80
  $options =array();
81
+ $collectionVendor = Mage::getModel ( 'dropship360/ranking' )->getCollection ();
82
 
83
  if($collectionVendor->count() > 0){
84
  foreach ($collectionVendor as $vendor) {
88
  );
89
  }
90
  }
91
+ array_unshift($options,array('value' => '', 'label' => Mage::helper('dropship360')->__('--Please Select--')));
92
  return $options;
93
  }
94
  }
includes/src/Logicbroker_Dropship360_Model_Uploadvendor.php CHANGED
@@ -12,12 +12,14 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
12
 
13
  const FIELD_NAME_SOURCE_FILE = 'import_file';
14
  protected $_isProductSetupMode = false;
 
15
  protected $_haderError = array();
16
  protected $_FtpErrors = array();
17
  protected $_UploadCsvErrors = array();
18
  protected $_inventoryModel;
19
  protected $_vendorSkuFlag = array();
20
  protected $conn;
 
21
  protected $_errors = array();
22
  const XML_PATH_UPLOAD_ENABLED = 'logicbroker_sourcing/cron_settings_upload/enabled';
23
  const XML_PATH_UPLOAD_FTP_SITE = 'logicbroker_sourcing/cron_settings_upload/ftp_site';
@@ -25,13 +27,24 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
25
  const XML_PATH_UPLOAD_FTP_PASSWORD = 'logicbroker_sourcing/cron_settings_upload/ftp_password';
26
  const XML_PATH_UPLOAD_FTP_TYPE = 'logicbroker_sourcing/cron_settings_upload/ftp_type';
27
  const XML_PATH_UPLOAD_FTP_ACCNUMBER = 'logicbroker_sourcing/cron_settings_upload/ftp_accnumber';
28
-
 
 
 
 
 
 
 
 
 
 
29
 
30
  protected function _construct()
31
  {
32
- $this->_inventoryModel = Mage::getModel('logicbroker/inventory');
33
  $this->conn = $this->getDatabaseConnection ();
34
- $this->_init("logicbroker/uploadvendor");
 
35
 
36
  }
37
 
@@ -45,11 +58,22 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
45
  return Mage::getSingleton('adminhtml/session');
46
  }
47
 
48
- protected function _getCsvData($fileName)
49
  {
50
  $csvObject = new Varien_File_Csv();
51
- $csvData = $csvObject->getData($fileName);
52
- return $csvData;
 
 
 
 
 
 
 
 
 
 
 
53
  }
54
 
55
 
@@ -74,13 +98,14 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
74
  try{
75
  $this->save();
76
  }catch(Exception $e){
77
- $this->_getSession()->addError(Mage::helper('logicbroker')->__($e->getMessage()));
78
  }
79
  }
80
 
81
  public function uploadSource()
82
  {
83
  $error = false;
 
84
  $this->_isProductSetupMode = $this->getProductsetupmode();
85
  $entity = 'vendor_product_'.date('ymdHis');
86
  $uploader = Mage::getModel('core/file_uploader', self::FIELD_NAME_SOURCE_FILE);
@@ -88,28 +113,17 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
88
  $result = $uploader->save(self::getWorkingDir());
89
  $extension = pathinfo($result['file'], PATHINFO_EXTENSION);
90
  $uploadedFile = $result['path'] . $result['file'];
91
- if (!$extension) {
92
- $this->fileObj()->rm($uploadedFile);
93
- throw new Exception(Mage::helper('importexport')->__('Uploaded file has no extension'));
94
- return $error = true;
95
-
96
- }
97
- if (strtolower($extension) != 'csv') {
98
- $this->fileObj()->rm($uploadedFile);
99
- throw new Exception(Mage::helper('importexport')->__('Incorrect file type uploaded. Please upload your Inventory feed in .csv format.'));
100
- return $error = true;
101
- }
102
-
103
  $error = $this->validateCsv($uploadedFile);
104
  if($error){
105
  $this->fileObj()->rm($uploadedFile);
106
- $this->_getSession()->addNotice(Mage::helper('logicbroker')->__('Please fix errors and re-upload file'));
107
  return $error;
108
  }
109
 
110
  $sourceFile = self::getWorkingDir() . $entity;
111
 
112
  $sourceFile .= '.' . strtolower($extension);
 
113
 
114
  if(strtolower($uploadedFile) != strtolower($sourceFile)) {
115
  if (file_exists($sourceFile)) {
@@ -120,9 +134,9 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
120
  Mage::throwException(Mage::helper('importexport')->__('Source file moving failed'));
121
  }
122
  }
123
- Mage::register('file_name',$entity);
124
  if(!$error)
125
- $this->insertCronEntry($entity);
126
 
127
  return $error;
128
  }
@@ -132,46 +146,56 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
132
  {
133
  //$fileName
134
  $isError = false;
135
- $csvData = $this->_getCsvData($fileName);
136
 
137
  /** checks columns */
138
 
139
  if($this->validateCsvHeader($csvData)){
140
- $dataValidation = false;
141
- if($dataValidation){
142
- $isError = true;
143
- }
144
  }else{
145
- $this->_getSession()->addError(Mage::helper('logicbroker')->__('CSV header %s is invalid ',implode(',',$this->_haderError)));
146
  $isError = true;
 
147
  }
148
  return $isError;
149
  }
150
 
151
  protected function validateCsvHeader($csvData,$isFtp = false)
152
  {
 
 
 
 
 
153
  if ($this->_isProductSetupMode && !$isFtp ){
154
- $csvFields = array(
155
- 0 => Mage::helper('logicbroker')->__('magento_sku'),
156
- 1 => Mage::helper('logicbroker')->__('vendor_sku'),
157
- 2 => Mage::helper('logicbroker')->__(''),
158
- 3 => Mage::helper('logicbroker')->__('')
159
- );
160
  }else{
161
- $csvFields = (!$isFtp) ? array(
162
- 0 => Mage::helper('logicbroker')->__('vendor_sku'),
163
- 1 => Mage::helper('logicbroker')->__('qty'),
164
- 2 => Mage::helper('logicbroker')->__('cost'),
165
- ) : array(
166
- 0 => Mage::helper('logicbroker')->__('vendor_code'),
167
- 1 => Mage::helper('logicbroker')->__('vendor_sku'),
168
- 2 => Mage::helper('logicbroker')->__('qty'),
169
- 3 => Mage::helper('logicbroker')->__('cost')
170
- );
171
  }
172
-
173
  $cvsDataNum = count($csvData[0]);
174
- $result = true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
  if(!$isFtp && !$this->_isProductSetupMode ){
176
  if($cvsDataNum != 3){
177
  foreach ($csvData[0] as $val){
@@ -180,10 +204,28 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
180
  $this->_haderError[] = $val;
181
  }
182
  }
183
- return false;
184
  }
185
-
186
- }else if($this->_isProductSetupMode ){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
187
  if($cvsDataNum != 2){
188
  foreach ($csvData[0] as $val){
189
  if(!in_array($val,array('vendor_sku','magento_sku')))
@@ -191,48 +233,17 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
191
  $this->_haderError[] = $val;
192
  }
193
  }
194
- return false;
195
- }
196
-
197
- }else{
198
- if($cvsDataNum == 3 || $cvsDataNum == 4){
199
- foreach ($csvData[0] as $val){
200
- if(!in_array($val,($cvsDataNum == 3) ? array('vendor_sku','qty', 'cost') : array('vendor_code','vendor_sku','qty', 'cost'))){
201
- $this->_haderError[] = $val;
202
- }
203
- }
204
- if(!empty($this->_haderError))
205
- return false;
206
- else
207
- return true;
208
- }else
209
- {
210
- $this->_haderError[] = 'csv not supported';
211
- return false;
212
- }
213
-
214
- }
215
- for ($i = 0; $i < $cvsDataNum; $i++) {
216
- if( $isFtp && ($csvData[0][0] == 'vendor_code' || $csvData[0][0] == 'vendor_sku')){
217
- continue;
218
- }
219
- if($csvData[0][$i] == $csvFields[$i]){
220
- continue;
221
- }else{
222
- (!$isFtp) ? $this->_haderError[] = $csvData[0][$i] : '';
223
- $result = false;
224
  }
225
  }
226
- return $result;
227
  }
228
-
229
  protected function checkDataIntigrity($csvData,$isFtp = false){
230
- $emptyRecords = array();
231
  //patch for FTP backward compatibility header
232
  (count($csvData[0]) <= 3) ? array_unshift($csvData[0], "") : $csvData[0];
233
  foreach($csvData as $row => $csvRowData)
234
  {
235
- $error = true;
236
  if($row == 0)
237
  continue;
238
  if(!$this->_isProductSetupMode && !$isFtp){
@@ -241,107 +252,110 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
241
  //patch for FTP backward compatibility data
242
  if($isFtp)
243
  (count($csvRowData) <= 3) ? array_unshift($csvRowData, "") : $csvRowData;
244
-
245
-
 
 
 
 
 
 
246
  foreach($csvRowData as $key => $data){
247
  $data = trim($data);
248
  switch($key){
249
- case 0:
250
  if($this->_isProductSetupMode){
251
  if(empty($data)){
252
- $emptyRecords['magento_sku'][] = $row;
253
- $result[] = true;
254
  } else {
255
- $error = false; $result[] = false;
256
  }
257
  }else{
258
  continue;
259
  }
260
  break;
261
- case 1:
262
  if(empty($data)){
263
- $emptyRecords['vendor_sku'][] = $row;
264
- $result[] = true;
265
  }
266
  else
267
- $error = false; $result[] = false;
268
  break;
269
- case 2:
270
  if(!is_numeric($data) || $data < 0 )
271
  {
272
  if($data!=""){
273
- $emptyRecords['qty'][] = $row;
274
- $result[] = true;
275
  }
276
  }
277
  else
278
- $error = false; $result[] = false;
279
  break;
280
- case 3:
281
  if(!is_numeric($data) || $data < 0 ){
282
  if($data!=""){
283
- $emptyRecords['cost'][] = $row;
284
- $result[] = true;
285
  }
286
  }
287
  else
288
- $error = false; $result[] = false;
289
  break;
 
290
  }
 
291
  }
 
292
 
293
- if (!$isFtp) {
294
  $error = in_array(true,$result) ? true : false;
295
  if($error){
296
  foreach($emptyRecords as $key=>$value){
297
  if($this->_isProductSetupMode){
298
  if($key == 'magento_sku'){
299
- $string = implode(',',$value);
300
- $this->_UploadCsvErrors['magento_sku'] = 'Missing Data at Row(s) ' .$string.' are missing data in magento_sku';
301
  }
302
  }
303
  if($key == 'vendor_sku'){
304
- $string = implode(',',$value);
305
- $this->_UploadCsvErrors['vendor_sku'] = 'Missing Data at Row(s) ' .$string.' are missing data in vendor_sku';
 
 
 
 
306
  }
 
307
  if($key == 'qty'){
308
- $string = implode(',',$value);
309
- $this->_UploadCsvErrors['qty'] = 'Bad Data at Row(s) '.$string.' contain bad data in qty';
 
 
 
 
310
  }
 
311
  if($key == 'cost'){
312
- $string = implode(',',$value);
313
- $this->_UploadCsvErrors['cost'] = 'Bad Data at Row(s) '.$string.' contain bad data in cost';
314
- }
315
- }
316
- }
317
- } else {
318
- $error = in_array(true,$result) ? true : false;
319
- if ($error){
320
- foreach($emptyRecords as $key=>$value){
321
- if($key == 'vendor_sku')
322
- { $string = implode(',',$value);
323
- $this->_FtpErrors['vendor_sku'] = 'Missing Data at Row(s) ' .$string.' are missing data in vendor_sku';
324
  }
325
- if($key == 'qty')
326
- { $string = implode(',',$value);
327
- $this->_FtpErrors['qty'] = 'Bad Data at Row(s) '.$string.' contain bad data in qty';
328
  }
329
- if($key == 'cost')
330
- { $string = implode(',',$value);
331
- $this->_FtpErrors['cost'] = 'Bad Data at Row(s) '.$string.' contain bad data in cost';
332
  }
333
- }
334
- }
335
- }
336
- }
337
- return in_array(true,$result) ? true : false;
338
  }
339
 
340
  protected function getConfigValue($path)
341
  {
342
  return Mage::getStoreConfig($path);
343
  }
344
- protected function getMagentoSku($vendorCode,$vendorSku){
345
  $sku = '';
346
  $vendorCollection = $this->_inventoryModel->getCollection()->addFieldTofilter('lb_vendor_code',$vendorCode)->addFieldTofilter('lb_vendor_sku',$vendorSku);
347
  if($vendorCollection->count() > 0)
@@ -357,41 +371,23 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
357
  $records = array();
358
  $success = array();
359
  $failure = array();
 
360
  $foramterroroutput = array();
361
- $tableVendorImportLog = Mage::getSingleton ( 'core/resource' )->getTableName ( 'logicbroker/vendor_import_log' );
362
- $csvData = $this->_getCsvData(self::getWorkingDir().$fileName.'.csv');
 
 
363
 
364
- if(count($csvData) <= 1 )
365
  {
366
- $failure[$fileName.'.csv'] = 'File is empty';
367
- $this->_UploadCsvErrors['empty_file'] = 'File is empty';
368
  }
369
 
370
- foreach($csvData as $row => $csvRowData)
371
- {
372
- if($row == 0)
373
- continue;
374
-
375
- if(!$this->_isProductSetupMode)
376
- {
377
- (count($csvRowData) <= 3) ? array_unshift($csvRowData, "") : $csvRowData;
378
- if(is_numeric($csvRowData[2])){
379
- /* LBN - 935 change */
380
- $magento_sku = $this->getMagentoSku($lb_vendor_code, trim($csvRowData[1]));
381
- $csvqty = (!empty($magento_sku)) ? Mage::helper('logicbroker')->getIsQtyDecimal($magento_sku,$csvRowData[2]) : $csvRowData[2];;
382
- }
383
- else
384
- {
385
- $csvqty = $csvRowData[2];
386
- }
387
- }
388
- if(!$this->_isProductSetupMode)
389
- $records[$row] = array('vendor_sku'=>trim($csvRowData[1]),'qty'=>$csvqty ,'cost'=>$csvRowData[3],'lb_vendor_code'=>$lb_vendor_code);
390
- else
391
- $records[$row] = array('magento_sku'=>trim($csvRowData[0]),'vendor_sku'=>trim($csvRowData[1]),'qty'=>0 ,'cost'=>0,'lb_vendor_code'=>$lb_vendor_code);
392
- }
393
 
394
- $this->conn->beginTransaction ();
 
395
  if(is_array($records) && !empty($records)){
396
  $requestData = array_chunk($records, 1, true);
397
 
@@ -410,10 +406,9 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
410
  if($successOrfail['failure']!="")
411
  $failure[] = $successOrfail['failure'];
412
  }
413
- $updateFileStatus = $this->load($fileName,'file_name');
414
- $updateFileStatus->setImportStatus('done');
415
-
416
- try{
417
  $updateFileStatus->save();
418
  }catch(Exception $e){
419
  echo $e->getMessage();
@@ -424,31 +419,27 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
424
  }
425
  $this->checkDataIntigrity($csvData);
426
  }
427
- if(isset($this->_UploadCsvErrors['general_error'])){
428
- $this->_UploadCsvErrors['other'] = implode(' , ', $this->_UploadCsvErrors['general_error']);
429
- unset($this->_UploadCsvErrors['general_error']);
 
 
 
 
 
 
 
430
  }
431
- foreach($this->_UploadCsvErrors as $k=>$output){
432
- if($k =='combination_error' && is_array($output)){
433
- foreach($output as $oput){
434
- $foramterroroutput[] = '<li>'.$oput.'</li>';
435
- }
436
- }else{
437
- $foramterroroutput[] = '<li>'.$output.'</li>';
438
- }
439
- }
440
- array_unshift($foramterroroutput,'<ul>');
441
- array_push($foramterroroutput,'</ul>');
442
- $errorDiscription = implode('',$foramterroroutput);
443
- unset($foramterroroutput);
444
- $ftp_err = (count($failure) > 0) ? 'Missing/Bad Data' : '';
445
- $insert = 'INSERT INTO '.$tableVendorImportLog.'(lb_vendor_code,updated_by,success,failure,ftp_error,ftp_error_desc,created_at) VALUES ("'.$lb_vendor_code.'","'.Mage::getSingleton('admin/session')->getUser()->getUsername().'",'.count($success).','.count($failure).',"'.$ftp_err.'","'.$errorDiscription.'","'.now().'")';
446
-
447
  $this->conn->query($insert);
448
-
449
  try {
450
  $this->conn->commit ();
451
- $file = self::getWorkingDir() . $fileName.'.csv';
 
452
  $this->fileObj()->rm($file);
453
  } catch ( Exception $e ) {
454
  $this->conn->rollBack ();
@@ -459,7 +450,10 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
459
  echo $e->getMessage();
460
 
461
  }
462
- unset($this->_vendorSkuFlag);
 
 
 
463
  return $this;
464
  }
465
 
@@ -467,21 +461,21 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
467
  protected function chekDuplicateCombination($data)
468
  {
469
  $result = true;
470
- $collection = $this->_inventoryModel->getCollection()->addFieldTofilter('lb_vendor_code',$data['lb_vendor_code'])->addFieldTofilter('lb_vendor_sku',trim($data['vendor_sku']));
471
  if($collection->count() > 0){
472
  $existing_product_sku = $collection->getFirstItem()->getProductSku();
473
  if(!empty($existing_product_sku)){
474
- if(trim($data['magento_sku']) != trim($existing_product_sku)){
475
  $result = false;
476
  }
477
  }
478
  }
479
- $inventoryCollection = $this->_inventoryModel->getCollection()->addFieldTofilter('lb_vendor_code',$data['lb_vendor_code'])->addFieldTofilter('product_sku',trim($data['magento_sku']));
480
  if($inventoryCollection->getSize() > 0){
481
  $inventoryCollection = $inventoryCollection->getData();
482
  $inventoryCollection = $inventoryCollection[0];
483
  $existing_vendor_sku = $inventoryCollection['lb_vendor_sku'];
484
- if(trim($existing_vendor_sku) != trim($data['vendor_sku']))
485
  {
486
  $result = false;
487
  }
@@ -530,7 +524,7 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
530
  }
531
  protected function vendorProductInsert($data)
532
  {
533
- $tableVendorInventory = Mage::getSingleton ( 'core/resource' )->getTableName ( 'logicbroker/inventory' );
534
  $inventoryCollectionResult = $this->getInventoryCollection($data);
535
  $qtyArray = $this->calculateProductQty($data);
536
 
@@ -539,39 +533,23 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
539
  case 'update':
540
  $productId = Mage::getModel('catalog/product')->getIdBySku(trim($data['magento_sku']));
541
  if($productId){
542
- if(!is_numeric($data['cost']) || $data['cost'] < 0 || trim($data['cost']) =="")
543
- {
544
- $costUpdate = '';
545
- }else
546
- {
547
- $costUpdate = 'cost ='. $data['cost'] . ',';
548
- }
549
 
550
- if($qtyArray['upload_qty'] == .999999999 || trim($data['qty']) =="" )
551
- {
552
- $qtyUpdate = '';
553
- }else
554
- {
555
- $qtyUpdate = ' stock = '.$qtyArray['upload_qty']. ',';
556
- }
557
- if($costUpdate=='' && $qtyUpdate =='' && !$this->_isProductSetupMode){
558
- $timeUpdate = "";
559
- }else{
560
- $timeUpdate = ' updated_at = "'.now(). '",';
561
- }
562
- $vSkuUpdate = ' lb_vendor_sku = "'.$data['vendor_sku']. '"';
563
- $update = 'update '.$tableVendorInventory.' set '.$costUpdate.$qtyUpdate.$timeUpdate.$vSkuUpdate.' where id = '.$inventoryCollectionResult['vendor_id'];
564
 
565
  try {
566
  if(!$this->updateProductInventory(trim($data['magento_sku']),$qtyArray['final_qty']))
567
  {
568
- $this->_UploadCsvErrors['general_error'][] = 'Update error: Error in updating magento product inventory';
569
  return false;
570
  }
571
- if($update)
572
- $this->conn->query($update);
 
 
 
573
  return true;
574
  } catch ( Exception $e ) {
 
575
  $this->_errors[] = $e->getMessage();
576
  $this->_errors[] = $e->getTrace();
577
  Mage::log($e->getMessage(), Zend_Log::ERR);
@@ -581,7 +559,7 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
581
 
582
  }else
583
  {
584
- $this->_UploadCsvErrors['general_error'][] = 'Update error: magento product sku ' .$data['magento_sku'].' not exist';
585
  return false;
586
  }
587
  break;
@@ -594,12 +572,15 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
594
  try {
595
  if(!$this->updateProductInventory($data['magento_sku'],$qtyArray['final_qty']))
596
  {
597
- $this->_UploadCsvErrors['general_error'][] = 'Add error: Error in updating magento product inventory';
598
  return false;
599
  }
 
600
  $this->conn->query($insert);
 
601
  return true;
602
  } catch ( Exception $e ) {
 
603
  $this->_errors[] = $e->getMessage();
604
  $this->_errors[] = $e->getTrace();
605
  Mage::log($e->getMessage(), Zend_Log::ERR);
@@ -618,19 +599,31 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
618
 
619
  }
620
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
621
  protected function getInventoryLogQuery($data,$type,$qty,$updateBy=null,$ignoreData)
622
  {
623
  if(count($ignoreData)>0){
624
  if($type=='update'){
625
- if(in_array('qty', $ignoreData))
626
- $type = 'Cost Updated, Qty Ignored';
627
- if(in_array('cost', $ignoreData))
628
- $type = 'Qty Updated, Cost Ignored';
629
  }else{
630
- if(in_array('qty', $ignoreData))
631
- $type = 'Cost Added, Qty Ignored';
632
- if(in_array('cost', $ignoreData))
633
- $type = 'Qty Added, Cost Ignored';
634
  }
635
  if(count($ignoreData)==2){
636
  $type = 'ignore';
@@ -638,10 +631,10 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
638
  }
639
  if($qty==0.999999999)
640
  $qty = 0;
641
- $vendorRankModel = Mage::getModel('logicbroker/ranking')->load($data['lb_vendor_code'],'lb_vendor_code');
642
  $vendorName = $vendorRankModel->getLbVendorName();
643
 
644
- $tableName = Mage::getSingleton("core/resource")->getTableName('logicbroker/inventorylog');
645
  if(!$updateBy){
646
  $updateBy = Mage::getSingleton('admin/session')->getUser()->getUsername();
647
  }
@@ -732,7 +725,7 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
732
  $io = new Varien_Io_File();
733
  $path = Mage::getBaseDir('var') . DS . 'export' . DS;
734
  $name = md5(microtime());
735
- $file = $path . DS . $name . '.csv';
736
 
737
  $io->setAllowCreateFolders(true);
738
  $io->open(array('path' => $path));
@@ -750,7 +743,7 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
750
 
751
  protected function getVendorName($vendorCode)
752
  {
753
- return Mage::getModel('logicbroker/ranking')->load($vendorCode,'lb_vendor_code')->getLbVendorName();
754
  }
755
 
756
 
@@ -779,7 +772,7 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
779
 
780
  return array('error'=>true,'message' => 'Unable to connect');
781
  }
782
- $loggedIn = ftp_login($ftpcon, $ftpUserName['value'], $ftpPassword['value']);
783
  ftp_pasv($ftpcon, true);
784
  if (false === $loggedIn) {
785
  return array('error'=>true,'message' => 'Unable to log in');
@@ -803,42 +796,52 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
803
  */
804
  public function ftpParseCsv()
805
  {
806
- if(Mage::helper('logicbroker')->isProcessRunning('bulk_assign')){
807
  $message = 'Bulk product setup is currently running hence cannot run ftp import';
808
  Mage::log($message, null, 'logicbroker_log_report.log');
809
  return;
810
  }
811
  $ftpfileName = array();
812
- $ftpRequestPram = array('ftp_site'=>array('value'=> $this->getConfigValue(self::XML_PATH_UPLOAD_FTP_SITE)),'ftp_username'=>array('value'=> $this->getConfigValue(self::XML_PATH_UPLOAD_FTP_USERNAME)),'ftp_password'=>array('value'=> Mage::helper('core')->decrypt($this->getConfigValue(self::XML_PATH_UPLOAD_FTP_PASSWORD))),'ftp_type'=>array('value'=> $this->getConfigValue(self::XML_PATH_UPLOAD_FTP_TYPE)));
813
 
814
  if (! Mage::getStoreConfigFlag ( self::XML_PATH_UPLOAD_ENABLED )) {
815
  return $this;
816
  }
817
-
818
- $connectionResult = $this->testFtpConnection($ftpRequestPram,true);
819
  if($connectionResult['error']){
 
820
  $this->genrateLogEntry(array('ftp_error'=>'Connection error','ftp_error_desc'=>$connectionResult['message'],'error'=> 1));
821
  Mage::log($connectionResult['message'], null, 'logicbroker_ftp_vendor_inventory_import.log');
822
  ftp_close($connectionResult['object']);
823
  return $this;
824
  }
825
 
826
- $rankCollection = Mage::getModel('logicbroker/ranking')->getCollection()->addFieldToFilter('is_dropship','yes');
827
  /* file path format <ftp site>/<Logicbroker Account Number>_MagVendID<number>/Inventory/ */
828
 
829
  if($rankCollection->getSize() > 0){
830
  foreach($rankCollection as $ranks){
831
  $path = $this->getConfigValue(self::XML_PATH_UPLOAD_FTP_ACCNUMBER).'_'.$ranks->getLbVendorCode().'/'.'Inventory';
832
-
833
- $ftpFiles = ftp_nlist($connectionResult['object'],$path);
834
-
835
- if(is_array($ftpFiles)){
 
 
 
 
 
 
 
 
 
 
 
 
836
  foreach($ftpFiles as $file){
837
- if(!preg_match("/\bArchive\b/i", $file, $match)){
838
  if($this->downloadFtpFile($connectionResult['object'],$file,$path, $ranks->getLbVendorCode()))
839
  $ftpfileName[$ranks->getLbVendorCode()][] = self::getWorkingDir().str_replace("\\","/",$path).DS.$this->downloadFtpFile($connectionResult['object'],$file,$path);
840
  }
841
- }
842
  }
843
  ftp_chdir($connectionResult['object'],'/');
844
  }
@@ -847,33 +850,26 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
847
  Mage::log('No dropship supplier found', null, 'logicbroker_ftp_vendor_inventory_import.log');
848
  ftp_close($connectionResult['object']);
849
  return $this;
850
- }
851
- $nondropshipCollection = Mage::getModel('logicbroker/ranking')->getCollection()->addFieldToFilter('is_dropship','no');
852
- if($nondropshipCollection->getSize() > 0){
853
- foreach($nondropshipCollection as $nondropship){
854
- $path = $this->getConfigValue(self::XML_PATH_UPLOAD_FTP_ACCNUMBER).'_'.$nondropship->getLbVendorCode().'/'.'Inventory';
855
- $ftpFiles = ftp_nlist($connectionResult['object'],$path);
856
- if(is_array($ftpFiles)){
857
- foreach($ftpFiles as $file){
858
- if(!preg_match("/\bArchive\b/i", $file, $match)){
859
- $this->archiveFtpFile(array('object'=>$connectionResult['object'],'path'=>self::getWorkingDir().str_replace("\\","/",$path).DS.$this->downloadFtpFile($connectionResult['object'],$file,$path)));
860
- $this->genrateLogEntry(array('lb_vendor_code'=>$nondropship->getLbVendorCode(),'ftp_error'=>'Import Error','ftp_error_desc'=>$nondropship->getLbVendorCode().' is not a dropship supplier','error'=> 1));
861
- }
862
- }
863
- }
864
- ftp_chdir($connectionResult['object'],'/');
865
- }
866
  }
867
  if(!empty($ftpfileName)){
868
  $this->initialize();
 
 
 
869
  foreach($ftpfileName as $vendorCode=>$fileinfo)
870
  {
 
871
  foreach($fileinfo as $path){
872
- if($this->validateCsvHeader($this->_getCsvData($path),true)){
 
873
  $this->ftpUpdateVendorProduct($this->_getCsvData($path),$path,$vendorCode);
 
 
874
 
875
  }else{
 
876
  $logPath = explode('logicbrokervendorproduct',str_replace("\\","/",$path));
 
877
  $this->genrateLogEntry(array('lb_vendor_code'=>$vendorCode,'ftp_error'=>'Bad File header','ftp_error_desc'=>'Check header format at following FTP path '.$logPath[1],'error'=> 1));
878
  Mage::log('Please check header format', null, 'logicbroker_ftp_vendor_inventory_import.log');
879
  }
@@ -881,7 +877,6 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
881
  $this->archiveFtpFile(array('object'=>$connectionResult['object'],'path'=>$path));
882
  }
883
  }
884
-
885
  $this->finalize();
886
  }else{
887
  Mage::log('No files found on ftp server', null, 'logicbroker_ftp_vendor_inventory_import.log');
@@ -889,17 +884,19 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
889
  return $this;
890
  }
891
  ftp_close($connectionResult['object']);
 
 
 
892
  return $this;
893
-
894
  }
895
 
896
  protected function initialize(){
897
- Mage::helper('logicbroker')->startProcess('manual_upload');
898
  Mage::log('Ftp upload started', null, 'logicbroker_ftp_vendor_inventory_import.log');
899
  }
900
 
901
  protected function finalize(){
902
- Mage::helper('logicbroker')->finishProcess('manual_upload');
903
  Mage::log('Ftp upload finished', null, 'logicbroker_ftp_vendor_inventory_import.log');
904
  }
905
 
@@ -909,7 +906,17 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
909
  $patharr = explode('logicbrokervendorproduct',$path);
910
  $dirname = pathinfo($patharr[1],PATHINFO_DIRNAME);
911
  $basename = pathinfo($patharr[1],PATHINFO_BASENAME );
912
- $newname = Mage::getModel('core/date')->date('Y-m-d h:i:s').'_'.$basename;
 
 
 
 
 
 
 
 
 
 
913
  ftp_chdir($object['object'],$dirname);
914
  ftp_mkdir($object['object'], 'Archive');
915
  ftp_chdir($object['object'],'Archive');
@@ -918,6 +925,7 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
918
  ftp_chdir($object['object'],'/');
919
  $this->fileObj()->rm($object['path']);
920
  ftp_delete($object['object'], $dirname.'/'.$basename);
 
921
  return;
922
 
923
  }
@@ -925,14 +933,6 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
925
  {
926
  $file = str_replace("/","\\",$file);
927
  $extension = pathinfo($file, PATHINFO_EXTENSION);
928
- if (strtolower($extension) != 'csv') {
929
- $this->fileObj()->rm($file);
930
- $logPath = explode('logicbrokervendorproduct',str_replace("\\","/",$file));
931
- $this->genrateLogEntry(array('lb_vendor_code'=>$vendorCode, 'ftp_error'=>'Bad File', 'ftp_error_desc'=>'Disallowed file type '.$logPath[1], 'error'=> 1));
932
- Mage::log('Disallowed file type.', null, 'logicbroker_ftp_vendor_inventory_import.log');
933
-
934
- return false;
935
- }
936
  return true;
937
  }
938
 
@@ -950,10 +950,6 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
950
  ftp_chdir($ftpRequest,'/'.$fileName[0].'/'.$fileName[1]);
951
  $server_file = $fileName[2];
952
  $local_file = self::getWorkingDir().$path.DS.$fileName[2];
953
-
954
- if(!$this->validateFtpFile(self::getWorkingDir().$path.DS.$fileName[2], $vendorCode)){
955
- return false;
956
- }
957
  // download server file
958
  if (ftp_get($ftpRequest, $local_file, $server_file, FTP_ASCII)){
959
 
@@ -963,48 +959,45 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
963
  }
964
  }
965
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
966
  protected function ftpUpdateVendorProduct($csvData,$path,$vendorCode = null)
967
  {
968
  $records = array();
969
  $success = array();
970
  $failure = array();
971
  $itemerroroutput = array();
 
972
  //$vendorCode = '';
973
- $tableVendorImportLog = Mage::getSingleton ( 'core/resource' )->getTableName ( 'logicbroker/vendor_import_log' );
974
- if(count($csvData) <= 1 )
975
  {
976
- $failure[] = 'File is empty';
977
- $this->_FtpErrors['empty_file'] = 'File is empty';
978
  }
979
- foreach($csvData as $row => $csvRowData)
980
- {
981
- if($row == 0)
982
- continue;
983
- $data = trim($data);
984
- //patch for backwards compatible for ftp change lbn-1070
985
- (count($csvRowData) <= 3) ? array_unshift($csvRowData, "") : $csvRowData;
986
- if(is_numeric($csvRowData[2]) || $csvRowData[2] > 0){
987
- //$qty = floor($csvRowData[2]);
988
- /* LBN - 935 change */
989
- $magento_sku = $this->getMagentoSku($vendorCode, trim($csvRowData[1]));
990
-
991
- if(!empty($magento_sku))
992
- {
993
- $qty = Mage::helper('logicbroker')->getIsQtyDecimal($magento_sku,$csvRowData[2]);
994
- }
995
- else
996
- {
997
- $qty = $csvRowData[2];
998
- }
999
- /* End of LBN - 935 change */
1000
- }else{
1001
- $qty = $csvRowData[2];
1002
- }
1003
- $records[$row] = array('lb_vendor_code'=>$vendorCode,'vendor_sku'=>trim($csvRowData[1]),'qty'=>$qty ,'cost'=>$csvRowData[3]);
1004
- //$vendorCode = $csvRowData[0];
1005
- }
1006
-
1007
- $this->conn->beginTransaction ();
1008
  if(is_array($records) && !empty($records)){
1009
  $requestData = array_chunk($records, 1, true);
1010
 
@@ -1014,7 +1007,6 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
1014
  $result[] = $this->validateCsvData($data, true);
1015
  }
1016
  }
1017
-
1018
  foreach($result as $successOrfail){
1019
  if($successOrfail['success']!="")
1020
  $success[] = $successOrfail['success'];
@@ -1024,28 +1016,36 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
1024
  }
1025
  $this->checkDataIntigrity($this->_getCsvData($path),true);
1026
  }
1027
- if(isset($this->_FtpErrors['general_error'])){
1028
- $this->_FtpErrors['other'] = implode(' , ', $this->_FtpErrors['general_error']);
1029
- unset($this->_FtpErrors['general_error']);
 
 
 
 
 
 
1030
  }
1031
- foreach($this->_FtpErrors as $k=>$output){
1032
- if($k =='combination_error' && is_array($output)){
1033
- foreach($output as $oput){
1034
- $itemerroroutput[] = '<li>'.$oput.'</li>';
1035
- }
1036
- }else{
1037
- $itemerroroutput[] = '<li>'.$output.'</li>';
1038
- }
1039
- }
1040
- array_unshift($itemerroroutput,'<ul>');
1041
- array_push($itemerroroutput,'</ul>');
1042
-
1043
- $ftp_err = (count($failure) > 0) ? 'Missing/Bad Data' : '';
1044
- $insert = 'INSERT INTO '.$tableVendorImportLog.'(lb_vendor_code,updated_by,success,failure,ftp_error,ftp_error_desc,created_at) VALUES ("'.$vendorCode.'","FTP",'.count($success).','.count($failure).',"'.$ftp_err.'","'.implode('',$itemerroroutput).'","'.now().'")';
1045
- unset($itemerroroutput);
1046
  $this->conn->query($insert);
 
1047
  try {
1048
  $this->conn->commit ();
 
 
 
 
 
 
 
 
 
 
 
1049
  } catch ( Exception $e ) {
1050
  $this->conn->rollBack ();
1051
  Mage::log($e->getMessage(), null, 'logicbroker_ftp_vendor_inventory_import.log');
@@ -1056,7 +1056,7 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
1056
 
1057
  protected function ftpVendorProductUpdate($data)
1058
  {
1059
- $tableVendorInventory = Mage::getSingleton ( 'core/resource' )->getTableName ( 'logicbroker/inventory' );
1060
  $inventoryCollectionResult = $this->getInventoryCollection($data,true);
1061
  $qtyArray = $this->calculateProductQty(array('magento_sku'=>$inventoryCollectionResult['magento_sku'],'qty'=>$data['qty'],'lb_vendor_code'=>$data['lb_vendor_code']));
1062
  switch($inventoryCollectionResult['operationType'])
@@ -1064,50 +1064,36 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
1064
  case 'update':
1065
  $productId = Mage::getModel('catalog/product')->getIdBySku($inventoryCollectionResult['magento_sku']);
1066
  if($productId){
1067
- if(!is_numeric($data['cost']) || $data['cost'] < 0 || trim($data['cost']) =="")
1068
- {
1069
- $costUpdate = '';
1070
- }else
1071
- {
1072
- $costUpdate = ' cost ='. $data['cost'] . ',';
1073
- }
1074
-
1075
- if($qtyArray['upload_qty'] == .999999999 || trim($data['qty']) =="" )
1076
- {
1077
- $qtyUpdate = '';
1078
- }else
1079
- {
1080
- $qtyUpdate = ' stock = '.$qtyArray['upload_qty']. ',';
1081
- }
1082
- if($costUpdate=='' && $qtyUpdate ==''){
1083
- $timeUpdate = "";
1084
- }else{
1085
- $timeUpdate = ' updated_at = "'.now(). '"';
1086
- }
1087
- $update = 'update '.$tableVendorInventory.' set '.$costUpdate. $qtyUpdate.$timeUpdate.' where id = '.$inventoryCollectionResult['vendor_id'];
1088
-
1089
  try {
1090
  if(!$this->updateProductInventory($inventoryCollectionResult['magento_sku'],$qtyArray['final_qty']))
1091
  {
1092
- $this->_FtpErrors['general_error'][] = 'Update error: Error in updating magento product inventory';
 
1093
  return false;
1094
  }
1095
- if($update)
 
1096
  $this->conn->query($update);
 
 
1097
  return true;
1098
  } catch ( Exception $e ) {
 
1099
  Mage::log($e->getMessage(), null, 'logicbroker_ftp_vendor_inventory_import.log');
1100
  echo $e->getMessage();
1101
  }
1102
 
1103
  }else{
1104
- $this->_FtpErrors['general_error'][] = 'Update error: '.$data['lb_vendor_code'].' and '.$data['vendor_sku'] .' combination does not exist';
 
1105
  return false;
1106
  }
1107
  break;
1108
  default :
1109
  /*fix for ticket lbn-710 vendor_sku not visible*/
1110
- $this->_FtpErrors['general_error'][] = $data['lb_vendor_code'].' and '.$data['vendor_sku'] .' combination does not exist';
 
1111
  return false;
1112
  }
1113
  return true;
@@ -1116,9 +1102,9 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
1116
  protected function genrateLogEntry($message)
1117
  {
1118
  $vendorCode = (!empty($message['lb_vendor_code'])) ? $message['lb_vendor_code'] : '';
1119
- $ftp_error = (!empty($message['ftp_error'])) ? $message['ftp_error'] : '';;
1120
- $ftp_error_desc = (!empty($message['ftp_error_desc'])) ? $message['ftp_error_desc'] : '';;
1121
- $tableVendorImportLog = Mage::getSingleton ( 'core/resource' )->getTableName ( 'logicbroker/vendor_import_log' );
1122
  $this->conn->beginTransaction ();
1123
  $now = now();
1124
  $insert = 'INSERT INTO '.$tableVendorImportLog.'(lb_vendor_code,updated_by,success,failure,created_at,ftp_error,ftp_error_desc) VALUES ("'.$vendorCode.'","FTP",'.count($success).','.$message['error'].',"'.$now.'","'.$ftp_error.'","'.$ftp_error_desc.'")';
@@ -1162,9 +1148,10 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
1162
  if(!$duplicateCombination = $this->chekDuplicateCombination($data)){
1163
  $invalidData = true;
1164
  if(!$isFtp){
1165
- $this->_UploadCsvErrors['combination_error'][] = 'Supplier code'. $data['lb_vendor_code'] .' and vendor sku '.$data['vendor_sku'].' combination not matching' ;
1166
  }else{
1167
- $this->_FtpErrors['combination_error'][] = 'Supplier code'. $data['lb_vendor_code'] .' and vendor sku '.$data['vendor_sku'].' combination not matching' ;
 
1168
  }
1169
  }
1170
  $vendorCollection = $this->_inventoryModel->getCollection()->addFieldTofilter('lb_vendor_code',$data['lb_vendor_code'])->addFieldTofilter('lb_vendor_sku',trim($data['vendor_sku']));
@@ -1178,7 +1165,7 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
1178
  if($vendorCollection->getSize() > 0){
1179
  if($data['magento_sku']!=$vendorCollection->getFirstItem ()->getProductSku()){
1180
  $invalidData = true;
1181
- $this->_UploadCsvErrors['combination_error'][] = 'Vendor sku '.$data['vendor_sku'].' is already been assigned for this vendor';
1182
  }
1183
  }
1184
  if($invalidData){
@@ -1195,10 +1182,11 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
1195
  $failure+=1;
1196
  if(!$isFtp){
1197
  if(trim($data['vendor_sku']))
1198
- $this->_UploadCsvErrors['general_error'][] = 'Vendor Sku '. $data['vendor_sku'] .' & Supplier code '.$data['lb_vendor_code'].' combination does not exist';
1199
  }else{
1200
  if(trim($data['vendor_sku']))
1201
- $this->_FtpErrors['general_error'][] = 'Vendor Sku '. $data['vendor_sku'] .' & Supplier code '.$data['lb_vendor_code'].' combination does not exist';
 
1202
  }
1203
  }
1204
  if($data['magento_sku']){
@@ -1208,7 +1196,15 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
1208
  $insertInventoryLog = $this->getInventoryLogQuery($data, $inventoryCollectionResult['operationType'], $data['qty'], null,$ignoreData);
1209
  }
1210
  if($insertInventoryLog)
1211
- $this->conn->query($insertInventoryLog);
 
 
 
 
 
 
 
 
1212
  }
1213
  return array('success'=>$success, 'failure'=>$failure);
1214
  }
@@ -1234,11 +1230,11 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
1234
  if(!empty($existing_product_sku)){
1235
  if($data['magento_sku'] != $existing_product_sku){
1236
  $invalidData = true;
1237
- $this->_UploadCsvErrors['combination_error'][] = 'Vendor sku '.$data['vendor_sku'].' is duplicate in Magento Sku '. $data['magento_sku'] .' for this supplier';
1238
 
1239
  }else{
1240
  $invalidData = true;
1241
- $this->_UploadCsvErrors['combination_error'][] = 'Vendor sku '.$data['vendor_sku'].' & Magento Sku '. $data['magento_sku'] .' combination already present';
1242
  }
1243
  }
1244
  }
@@ -1266,13 +1262,20 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
1266
  ($this->vendorProductInsert($data)) ? $success += 1 : $failure+=1;
1267
  if($this->vendorProductInsert($data)){
1268
  $insertInventoryLog = $this->getInventoryLogQuery($data, $type, 0, null, null);
1269
- if($insertInventoryLog)
1270
- $this->conn->query($insertInventoryLog);
 
 
 
 
 
 
 
1271
  }
1272
  }
1273
  }else{
1274
  $failure+=1;
1275
- $this->_UploadCsvErrors['general_error'][] = 'Magento Sku '.$data['magento_sku'].' does not exist';
1276
  }
1277
  return array('success'=>$success, 'failure'=>$failure);
1278
  }
@@ -1331,5 +1334,208 @@ class Logicbroker_Dropship360_Model_Uploadvendor extends Mage_Core_Model_Abstrac
1331
  }
1332
  return $trimmedSkus;
1333
  }
1334
- }
1335
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
 
13
  const FIELD_NAME_SOURCE_FILE = 'import_file';
14
  protected $_isProductSetupMode = false;
15
+ protected $sendBadFileAlert = false;
16
  protected $_haderError = array();
17
  protected $_FtpErrors = array();
18
  protected $_UploadCsvErrors = array();
19
  protected $_inventoryModel;
20
  protected $_vendorSkuFlag = array();
21
  protected $conn;
22
+ protected $ftpRequestPram = array();
23
  protected $_errors = array();
24
  const XML_PATH_UPLOAD_ENABLED = 'logicbroker_sourcing/cron_settings_upload/enabled';
25
  const XML_PATH_UPLOAD_FTP_SITE = 'logicbroker_sourcing/cron_settings_upload/ftp_site';
27
  const XML_PATH_UPLOAD_FTP_PASSWORD = 'logicbroker_sourcing/cron_settings_upload/ftp_password';
28
  const XML_PATH_UPLOAD_FTP_TYPE = 'logicbroker_sourcing/cron_settings_upload/ftp_type';
29
  const XML_PATH_UPLOAD_FTP_ACCNUMBER = 'logicbroker_sourcing/cron_settings_upload/ftp_accnumber';
30
+ const XML_PATH_INVENTORY_NOTIFICATION_EMAIL = 'logicbroker_sourcing/inventory_notification/email';
31
+ const XML_PATH_INVENTORY_NOTIFICATION_EMAIL_ENABLED = 'logicbroker_sourcing/inventory_notification/enabled';
32
+ protected $ftpCSVFormat = array('vendor_code','vendor_sku','qty','cost');
33
+ protected $manualCSVFormat = array('vendor_sku','qty','cost');
34
+ protected $productSetupCSVFormat = array('magento_sku','vendor_sku','','');
35
+ protected $_csvDataCache;
36
+ protected $_vendorCode;
37
+ protected $_csvParserObj;
38
+ protected $emptyRecords = array(); //checkDataIntigrity fnction store empty records from CSV
39
+ protected $result = array(); //checkDataIntigrity fnction store final result for error
40
+ protected $supplierName = '';
41
 
42
  protected function _construct()
43
  {
44
+ $this->_inventoryModel = Mage::getModel('dropship360/inventory');
45
  $this->conn = $this->getDatabaseConnection ();
46
+ $this->_init("dropship360/uploadvendor");
47
+ $this->_csvParserObj = Mage::getModel('dropship360/csvparser');
48
 
49
  }
50
 
58
  return Mage::getSingleton('adminhtml/session');
59
  }
60
 
61
+ protected function _getCsvData($fileName,$header = false)
62
  {
63
  $csvObject = new Varien_File_Csv();
64
+
65
+ if(!$this->_csvDataCache){
66
+ $this->_csvDataCache = $this->_csvParserObj->getChangedValue($csvObject->getData($fileName),$this->_vendorCode);
67
+ }else
68
+ {
69
+ if($header){
70
+ return array($this->_csvDataCache[0]);
71
+ }else
72
+ {
73
+ $this->_csvDataCache;
74
+ }
75
+ }
76
+ return $this->_csvDataCache;
77
  }
78
 
79
 
98
  try{
99
  $this->save();
100
  }catch(Exception $e){
101
+ $this->_getSession()->addError(Mage::helper('dropship360')->__($e->getMessage()));
102
  }
103
  }
104
 
105
  public function uploadSource()
106
  {
107
  $error = false;
108
+ $this->_vendorCode = $this->getVendor();
109
  $this->_isProductSetupMode = $this->getProductsetupmode();
110
  $entity = 'vendor_product_'.date('ymdHis');
111
  $uploader = Mage::getModel('core/file_uploader', self::FIELD_NAME_SOURCE_FILE);
113
  $result = $uploader->save(self::getWorkingDir());
114
  $extension = pathinfo($result['file'], PATHINFO_EXTENSION);
115
  $uploadedFile = $result['path'] . $result['file'];
 
 
 
 
 
 
 
 
 
 
 
 
116
  $error = $this->validateCsv($uploadedFile);
117
  if($error){
118
  $this->fileObj()->rm($uploadedFile);
119
+ $this->_getSession()->addNotice(Mage::helper('dropship360')->__('Please fix errors and re-upload file'));
120
  return $error;
121
  }
122
 
123
  $sourceFile = self::getWorkingDir() . $entity;
124
 
125
  $sourceFile .= '.' . strtolower($extension);
126
+ $fileName = $entity.'.'.strtolower($extension);
127
 
128
  if(strtolower($uploadedFile) != strtolower($sourceFile)) {
129
  if (file_exists($sourceFile)) {
134
  Mage::throwException(Mage::helper('importexport')->__('Source file moving failed'));
135
  }
136
  }
137
+ Mage::register('file_name',$fileName);
138
  if(!$error)
139
+ $this->insertCronEntry($fileName);
140
 
141
  return $error;
142
  }
146
  {
147
  //$fileName
148
  $isError = false;
149
+ $csvData = $this->_getCsvData($fileName,true);
150
 
151
  /** checks columns */
152
 
153
  if($this->validateCsvHeader($csvData)){
154
+ $isError = false;
 
 
 
155
  }else{
156
+ $this->_getSession()->addError(Mage::helper('dropship360')->__('CSV header %s is invalid ',implode(',',$this->_haderError)));
157
  $isError = true;
158
+ $this->_csvDataCache = array();
159
  }
160
  return $isError;
161
  }
162
 
163
  protected function validateCsvHeader($csvData,$isFtp = false)
164
  {
165
+ $result = true;
166
+ if(empty($csvData))
167
+ {
168
+ return false;
169
+ }
170
  if ($this->_isProductSetupMode && !$isFtp ){
171
+ $csvFields = $this->productSetupCSVFormat;
 
 
 
 
 
172
  }else{
173
+ $csvFields = (!$isFtp) ? $this->manualCSVFormat : $this->ftpCSVFormat;
 
 
 
 
 
 
 
 
 
174
  }
 
175
  $cvsDataNum = count($csvData[0]);
176
+
177
+ if(!$this->validateManualCsvHeader($cvsDataNum,$csvData,$isFtp))
178
+ return false;
179
+ if(!$this->validateFtpCsvHeader($cvsDataNum,$csvData))
180
+ return false;
181
+ if(!$this->validateProductSetupCsvHeader($cvsDataNum,$csvData))
182
+ return false;
183
+ for ($i = 0; $i < $cvsDataNum; $i++) {
184
+ if( $isFtp && ($csvData[0][0] == 'vendor_code' || $csvData[0][0] == 'vendor_sku')){
185
+ continue;
186
+ }
187
+ if($csvData[0][$i] == $csvFields[$i]){
188
+ continue;
189
+ }else{
190
+ (!$isFtp) ? $this->_haderError[] = $csvData[0][$i] : '';
191
+ $result = false;
192
+ }
193
+ }
194
+ return $result;
195
+ }
196
+
197
+ protected function validateManualCsvHeader($cvsDataNum,$csvData,$isFtp)
198
+ {
199
  if(!$isFtp && !$this->_isProductSetupMode ){
200
  if($cvsDataNum != 3){
201
  foreach ($csvData[0] as $val){
204
  $this->_haderError[] = $val;
205
  }
206
  }
207
+ return false;
208
  }
209
+ }
210
+ return true;
211
+ }
212
+ protected function validateFtpCsvHeader($cvsDataNum,$csvData)
213
+ {
214
+ $validation = true;
215
+ if($cvsDataNum == 3 || $cvsDataNum == 4){
216
+ foreach ($csvData[0] as $val){
217
+ if(!in_array($val,($cvsDataNum == 3) ? array('vendor_sku','qty', 'cost') : array('vendor_code','vendor_sku','qty', 'cost'))){
218
+ $this->_haderError[] = $val;
219
+ $validation = false;
220
+ }
221
+ }
222
+ return $validation;
223
+ }
224
+ return true;
225
+ }
226
+ protected function validateProductSetupCsvHeader($cvsDataNum,$csvData)
227
+ {
228
+ if($this->_isProductSetupMode ){
229
  if($cvsDataNum != 2){
230
  foreach ($csvData[0] as $val){
231
  if(!in_array($val,array('vendor_sku','magento_sku')))
233
  $this->_haderError[] = $val;
234
  }
235
  }
236
+ return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
237
  }
238
  }
239
+ return true;
240
  }
 
241
  protected function checkDataIntigrity($csvData,$isFtp = false){
242
+
243
  //patch for FTP backward compatibility header
244
  (count($csvData[0]) <= 3) ? array_unshift($csvData[0], "") : $csvData[0];
245
  foreach($csvData as $row => $csvRowData)
246
  {
 
247
  if($row == 0)
248
  continue;
249
  if(!$this->_isProductSetupMode && !$isFtp){
252
  //patch for FTP backward compatibility data
253
  if($isFtp)
254
  (count($csvRowData) <= 3) ? array_unshift($csvRowData, "") : $csvRowData;
255
+ $this->getErrorRowNumber($csvRowData,$row);
256
+ }
257
+ $this->generateMsg($isFtp,$this->result,$this->emptyRecords);
258
+ return in_array(true,$this->result) ? true : false;
259
+ }
260
+ protected function getErrorRowNumber($csvRowData,$row)
261
+ {
262
+
263
  foreach($csvRowData as $key => $data){
264
  $data = trim($data);
265
  switch($key){
266
+ case is_numeric($key) ? 0 : 'magento_sku' :
267
  if($this->_isProductSetupMode){
268
  if(empty($data)){
269
+ $this->emptyRecords['magento_sku'][] = $row;
270
+ $this->result[] = true;
271
  } else {
272
+ $this->result[] = false;
273
  }
274
  }else{
275
  continue;
276
  }
277
  break;
278
+ case is_numeric($key) ? 1 : 'vendor_sku':
279
  if(empty($data)){
280
+ $this->emptyRecords['vendor_sku'][] = $row;
281
+ $this->result[] = true;
282
  }
283
  else
284
+ $this->result[] = false;
285
  break;
286
+ case is_numeric($key) ? 2 : 'qty':
287
  if(!is_numeric($data) || $data < 0 )
288
  {
289
  if($data!=""){
290
+ $this->emptyRecords['qty'][] = $row;
291
+ $this->result[] = true;
292
  }
293
  }
294
  else
295
+ $this->result[] = false;
296
  break;
297
+ case is_numeric($key) ? 3 : 'cost':
298
  if(!is_numeric($data) || $data < 0 ){
299
  if($data!=""){
300
+ $this->emptyRecords['cost'][] = $row;
301
+ $this->result[] = true;
302
  }
303
  }
304
  else
305
+ $this->result[] = false;
306
  break;
307
+ }
308
  }
309
+ return;
310
  }
311
+ protected function generateMsg($isFtp,$result,$emptyRecords){
312
 
 
313
  $error = in_array(true,$result) ? true : false;
314
  if($error){
315
  foreach($emptyRecords as $key=>$value){
316
  if($this->_isProductSetupMode){
317
  if($key == 'magento_sku'){
318
+ $string = implode(';',$value);
319
+ $this->_UploadCsvErrors[] = array('error_type'=>'row_magento_sku','value'=>$string);
320
  }
321
  }
322
  if($key == 'vendor_sku'){
323
+ $string = implode(';',$value);
324
+ if($isFtp){
325
+ $this->_FtpErrors[] = array('error_type'=>'row_vendor_sku','value'=>$string);
326
+ $this->sendBadFileAlert = true;
327
+ }else{
328
+ $this->_UploadCsvErrors[] = array('error_type'=>'row_vendor_sku','value'=>$string);
329
  }
330
+ }
331
  if($key == 'qty'){
332
+ $string = implode(';',$value);
333
+ if($isFtp){
334
+ $this->_FtpErrors[] = array('error_type'=>'row_qty','value'=>$string);
335
+ $this->sendBadFileAlert = true;
336
+ }else{
337
+ $this->_UploadCsvErrors[] = array('error_type'=>'row_qty','value'=>$string);
338
  }
339
+ }
340
  if($key == 'cost'){
341
+ $string = implode(';',$value);
342
+ if($isFtp){
343
+ $this->_FtpErrors[] = array('error_type'=>'row_cost','value'=>$string);
344
+ $this->sendBadFileAlert = true;
345
+ }else{
346
+ $this->_UploadCsvErrors[] = array('error_type'=>'row_cost','value'=>$string);
347
+ }
 
 
 
 
 
348
  }
 
 
 
349
  }
 
 
 
350
  }
351
+ return ;
 
 
 
 
352
  }
353
 
354
  protected function getConfigValue($path)
355
  {
356
  return Mage::getStoreConfig($path);
357
  }
358
+ public function getMagentoSku($vendorCode,$vendorSku){
359
  $sku = '';
360
  $vendorCollection = $this->_inventoryModel->getCollection()->addFieldTofilter('lb_vendor_code',$vendorCode)->addFieldTofilter('lb_vendor_sku',$vendorSku);
361
  if($vendorCollection->count() > 0)
371
  $records = array();
372
  $success = array();
373
  $failure = array();
374
+ $counter = 0;
375
  $foramterroroutput = array();
376
+ $this->_csvDataCache = array();
377
+ $this->_vendorCode = $lb_vendor_code;
378
+ $tableVendorImportLog = Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship360/vendor_import_log' );
379
+ $csvData = $this->_getCsvData(self::getWorkingDir().$fileName);
380
 
381
+ if(count($csvData) <= 1 && Mage::getModel('dropship360/csvparser')->isCsvFileEmpty())
382
  {
383
+ $failure[$fileName] = 'Sorry,we cant find the record to update inventory';
384
+ $this->_UploadCsvErrors[] = array('error_type'=>'empty_file','value'=>'Sorry,we cant find the record to update inventory');
385
  }
386
 
387
+ $records = Mage::getModel('dropship360/csvparser')->generateManualCsvRow($csvData,$this->_isProductSetupMode,$lb_vendor_code);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
388
 
389
+ Mage::helper('dropship360')->turnOnReadUncommittedMode(); // dirty read patch
390
+ //$this->conn->beginTransaction ();
391
  if(is_array($records) && !empty($records)){
392
  $requestData = array_chunk($records, 1, true);
393
 
406
  if($successOrfail['failure']!="")
407
  $failure[] = $successOrfail['failure'];
408
  }
409
+ try{
410
+ $updateFileStatus = Mage::getModel('dropship360/uploadvendor')->load($fileName,'file_name');
411
+ $updateFileStatus->setImportStatus('done');
 
412
  $updateFileStatus->save();
413
  }catch(Exception $e){
414
  echo $e->getMessage();
419
  }
420
  $this->checkDataIntigrity($csvData);
421
  }
422
+ $finalResultCounter = (!$this->_isProductSetupMode) ? $this->logForUnprocessedRows($lb_vendor_code) : 0;
423
+
424
+ if(is_array($finalResultCounter))
425
+ {
426
+ $failed = count($failure)+$finalResultCounter['failure'];
427
+ $success = count($success)+$finalResultCounter['success'];
428
+ }else
429
+ {
430
+ $failed = count($failure)+$finalResultCounter;
431
+ $success = count($success)+$finalResultCounter;
432
  }
433
+
434
+ $ftp_err = ($failed > 0) ? 'Missing/Bad Data' : '';
435
+ $insert = 'INSERT INTO '.$tableVendorImportLog.'(lb_vendor_code,updated_by,success,failure,ftp_error,created_at) VALUES ("'.$lb_vendor_code.'","'.Mage::getSingleton('admin/session')->getUser()->getUsername().'",'.$success.','.$failed.',"'.$ftp_err.'","'.now().'")';
436
+ $this->conn->beginTransaction ();
 
 
 
 
 
 
 
 
 
 
 
 
437
  $this->conn->query($insert);
438
+ $entityId = $this->conn->lastInsertId($tableVendorImportLog);
439
  try {
440
  $this->conn->commit ();
441
+ $this->prepareInsertAndExeQuery($this->_UploadCsvErrors,$entityId);
442
+ $file = self::getWorkingDir() . $fileName;
443
  $this->fileObj()->rm($file);
444
  } catch ( Exception $e ) {
445
  $this->conn->rollBack ();
450
  echo $e->getMessage();
451
 
452
  }
453
+ $this->_csvParserObj->emptyTable();
454
+ $this->_csvDataCache = array();
455
+ $this->_vendorSkuFlag = array();
456
+ Mage::helper('dropship360')->turnOnReadCommittedMode(); //restore to orignal trasectional level
457
  return $this;
458
  }
459
 
461
  protected function chekDuplicateCombination($data)
462
  {
463
  $result = true;
464
+ $collection = $this->_inventoryModel->getCollection()->addFieldTofilter('lb_vendor_code',$data['lb_vendor_code'])->addFieldTofilter('lb_vendor_sku',$data['vendor_sku']);
465
  if($collection->count() > 0){
466
  $existing_product_sku = $collection->getFirstItem()->getProductSku();
467
  if(!empty($existing_product_sku)){
468
+ if($data['magento_sku'] != $existing_product_sku){
469
  $result = false;
470
  }
471
  }
472
  }
473
+ $inventoryCollection = $this->_inventoryModel->getCollection()->addFieldTofilter('lb_vendor_code',$data['lb_vendor_code'])->addFieldTofilter('product_sku',$data['magento_sku']);
474
  if($inventoryCollection->getSize() > 0){
475
  $inventoryCollection = $inventoryCollection->getData();
476
  $inventoryCollection = $inventoryCollection[0];
477
  $existing_vendor_sku = $inventoryCollection['lb_vendor_sku'];
478
+ if($existing_vendor_sku != trim($data['vendor_sku']))
479
  {
480
  $result = false;
481
  }
524
  }
525
  protected function vendorProductInsert($data)
526
  {
527
+ $tableVendorInventory = Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship360/inventory' );
528
  $inventoryCollectionResult = $this->getInventoryCollection($data);
529
  $qtyArray = $this->calculateProductQty($data);
530
 
533
  case 'update':
534
  $productId = Mage::getModel('catalog/product')->getIdBySku(trim($data['magento_sku']));
535
  if($productId){
 
 
 
 
 
 
 
536
 
537
+ $update = $this->_prepareUpdateQuery($data,$qtyArray,$inventoryCollectionResult,$tableVendorInventory,false);
 
 
 
 
 
 
 
 
 
 
 
 
 
538
 
539
  try {
540
  if(!$this->updateProductInventory(trim($data['magento_sku']),$qtyArray['final_qty']))
541
  {
542
+ $this->_UploadCsvErrors[] = array('error_type'=>'inventory_update_error','value'=>array('magento_sku'=>$data['magento_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
543
  return false;
544
  }
545
+ if($update){
546
+ $this->conn->beginTransaction ();
547
+ $this->conn->query($update);
548
+ $this->conn->commit ();
549
+ }
550
  return true;
551
  } catch ( Exception $e ) {
552
+ $this->conn->rollBack ();
553
  $this->_errors[] = $e->getMessage();
554
  $this->_errors[] = $e->getTrace();
555
  Mage::log($e->getMessage(), Zend_Log::ERR);
559
 
560
  }else
561
  {
562
+ $this->_UploadCsvErrors[] = array('error_type'=>'magento_sku_exists','value'=>array('magento_sku'=>$data['magento_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
563
  return false;
564
  }
565
  break;
572
  try {
573
  if(!$this->updateProductInventory($data['magento_sku'],$qtyArray['final_qty']))
574
  {
575
+ $this->_UploadCsvErrors[] = array('error_type'=>'inventory_add_error','value'=>array('magento_sku'=>$data['magento_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
576
  return false;
577
  }
578
+ $this->conn->beginTransaction ();
579
  $this->conn->query($insert);
580
+ $this->conn->commit ();
581
  return true;
582
  } catch ( Exception $e ) {
583
+ $this->conn->rollBack ();
584
  $this->_errors[] = $e->getMessage();
585
  $this->_errors[] = $e->getTrace();
586
  Mage::log($e->getMessage(), Zend_Log::ERR);
599
 
600
  }
601
 
602
+ protected function _prepareUpdateQuery($data,$qtyArray,$inventoryCollectionResult,$tableVendorInventory,$isFtp)
603
+ {
604
+ $update;
605
+ (!is_numeric($data['cost']) || $data['cost'] < 0 || trim($data['cost']) =="") ? $costUpdate = '' : $costUpdate = 'cost ='. $data['cost'] . ',';
606
+ ($qtyArray['upload_qty'] == .999999999 || trim($data['qty']) =="" ) ? $qtyUpdate = '' : $qtyUpdate = ' stock = '.$qtyArray['upload_qty']. ',';
607
+ if(!$isFtp){
608
+ ($costUpdate=='' && $qtyUpdate =='' && !$this->_isProductSetupMode) ? $timeUpdate = "" : $timeUpdate = ' updated_at = "'.now(). '",';
609
+ $vSkuUpdate = ' lb_vendor_sku = "'.$data['vendor_sku']. '"';
610
+ $update = 'update '.$tableVendorInventory.' set '.$costUpdate.$qtyUpdate.$timeUpdate.$vSkuUpdate.' where id = '.$inventoryCollectionResult['vendor_id'];
611
+ }else
612
+ {
613
+ if(trim($data['qty'])!='' || trim($data['cost']) !='')
614
+ $update = 'update '.$tableVendorInventory.' set '.$costUpdate. $qtyUpdate.' updated_at = "'.now().'" where id = '.$inventoryCollectionResult['vendor_id'];
615
+ }
616
+ return $update;
617
+ }
618
  protected function getInventoryLogQuery($data,$type,$qty,$updateBy=null,$ignoreData)
619
  {
620
  if(count($ignoreData)>0){
621
  if($type=='update'){
622
+ (in_array('qty', $ignoreData)) ? $type = 'Cost Updated, Qty Ignored' : '';
623
+ (in_array('cost', $ignoreData)) ? $type = 'Qty Updated, Cost Ignored' : '';
 
 
624
  }else{
625
+ (in_array('qty', $ignoreData)) ? $type = 'Cost Added, Qty Ignored' : '';
626
+ (in_array('cost', $ignoreData)) ? $type = 'Qty Added, Cost Ignored' : '';
 
 
627
  }
628
  if(count($ignoreData)==2){
629
  $type = 'ignore';
631
  }
632
  if($qty==0.999999999)
633
  $qty = 0;
634
+ $vendorRankModel = Mage::getModel('dropship360/ranking')->load($data['lb_vendor_code'],'lb_vendor_code');
635
  $vendorName = $vendorRankModel->getLbVendorName();
636
 
637
+ $tableName = Mage::getSingleton("core/resource")->getTableName('dropship360/inventorylog');
638
  if(!$updateBy){
639
  $updateBy = Mage::getSingleton('admin/session')->getUser()->getUsername();
640
  }
725
  $io = new Varien_Io_File();
726
  $path = Mage::getBaseDir('var') . DS . 'export' . DS;
727
  $name = md5(microtime());
728
+ $file = $path . DS . $name;
729
 
730
  $io->setAllowCreateFolders(true);
731
  $io->open(array('path' => $path));
743
 
744
  protected function getVendorName($vendorCode)
745
  {
746
+ return Mage::getModel('dropship360/ranking')->load($vendorCode,'lb_vendor_code')->getLbVendorName();
747
  }
748
 
749
 
772
 
773
  return array('error'=>true,'message' => 'Unable to connect');
774
  }
775
+ $loggedIn = @ftp_login($ftpcon, $ftpUserName['value'], $ftpPassword['value']);
776
  ftp_pasv($ftpcon, true);
777
  if (false === $loggedIn) {
778
  return array('error'=>true,'message' => 'Unable to log in');
796
  */
797
  public function ftpParseCsv()
798
  {
799
+ if(Mage::helper('dropship360')->isProcessRunning('bulk_assign')){
800
  $message = 'Bulk product setup is currently running hence cannot run ftp import';
801
  Mage::log($message, null, 'logicbroker_log_report.log');
802
  return;
803
  }
804
  $ftpfileName = array();
805
+ $this->ftpRequestPram = array('ftp_site'=>array('value'=> $this->getConfigValue(self::XML_PATH_UPLOAD_FTP_SITE)),'ftp_username'=>array('value'=> $this->getConfigValue(self::XML_PATH_UPLOAD_FTP_USERNAME)),'ftp_password'=>array('value'=> Mage::helper('core')->decrypt($this->getConfigValue(self::XML_PATH_UPLOAD_FTP_PASSWORD))),'ftp_type'=>array('value'=> $this->getConfigValue(self::XML_PATH_UPLOAD_FTP_TYPE)));
806
 
807
  if (! Mage::getStoreConfigFlag ( self::XML_PATH_UPLOAD_ENABLED )) {
808
  return $this;
809
  }
810
+ $connectionResult = $this->testFtpConnection($this->ftpRequestPram,true);
 
811
  if($connectionResult['error']){
812
+ $this->sendMail(array('subject'=>'Your magento site has failed to connect FTP site','message' => 'Connection Failure','bcc'=>trim(Mage::helper('dropship360')->getConfigObject('apiconfig/email/bcc'))));
813
  $this->genrateLogEntry(array('ftp_error'=>'Connection error','ftp_error_desc'=>$connectionResult['message'],'error'=> 1));
814
  Mage::log($connectionResult['message'], null, 'logicbroker_ftp_vendor_inventory_import.log');
815
  ftp_close($connectionResult['object']);
816
  return $this;
817
  }
818
 
819
+ $rankCollection = Mage::getModel('dropship360/ranking')->getCollection()->addFieldToFilter('is_dropship','yes');
820
  /* file path format <ftp site>/<Logicbroker Account Number>_MagVendID<number>/Inventory/ */
821
 
822
  if($rankCollection->getSize() > 0){
823
  foreach($rankCollection as $ranks){
824
  $path = $this->getConfigValue(self::XML_PATH_UPLOAD_FTP_ACCNUMBER).'_'.$ranks->getLbVendorCode().'/'.'Inventory';
825
+ $ftpFiles = array();
826
+ $ftpFilesList = ftp_nlist($connectionResult['object'],$path);
827
+ //patch for sort ftp files by time
828
+ if($ftpFilesList){
829
+ foreach ($ftpFilesList as $value) {
830
+ if(preg_match("/.csv$/i", $value, $match)){
831
+ $fileTime = ftp_mdtm($connectionResult['object'], $value);
832
+ if(array_key_exists($fileTime,$ftpFiles))
833
+ $ftpFiles[$fileTime+20] = $value; // if timestamp same for files
834
+ else
835
+ $ftpFiles[$fileTime] = $value;
836
+ }
837
+ }
838
+ ksort($ftpFiles); // sort associative arrays in acending order, according to the key(time)
839
+ }
840
+ if($ftpFiles){
841
  foreach($ftpFiles as $file){
 
842
  if($this->downloadFtpFile($connectionResult['object'],$file,$path, $ranks->getLbVendorCode()))
843
  $ftpfileName[$ranks->getLbVendorCode()][] = self::getWorkingDir().str_replace("\\","/",$path).DS.$this->downloadFtpFile($connectionResult['object'],$file,$path);
844
  }
 
845
  }
846
  ftp_chdir($connectionResult['object'],'/');
847
  }
850
  Mage::log('No dropship supplier found', null, 'logicbroker_ftp_vendor_inventory_import.log');
851
  ftp_close($connectionResult['object']);
852
  return $this;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
853
  }
854
  if(!empty($ftpfileName)){
855
  $this->initialize();
856
+ $this->_csvParserObj->emptyTable();
857
+ $this->_csvDataCache = array();
858
+ Mage::helper('dropship360')->turnOnReadUncommittedMode(); //dirty read patch
859
  foreach($ftpfileName as $vendorCode=>$fileinfo)
860
  {
861
+ $this->_vendorCode = $vendorCode;
862
  foreach($fileinfo as $path){
863
+ if($this->validateCsvHeader($this->_getCsvData($path,true),true)){
864
+ Mage::helper('dropship360')->turnOnReadUncommittedMode(); // dirty read patch
865
  $this->ftpUpdateVendorProduct($this->_getCsvData($path),$path,$vendorCode);
866
+ Mage::helper('dropship360')->turnOnReadCommittedMode(); //restore to orignal trasectional level
867
+ $this->_csvDataCache = array();//for more than one csv file on FTP server
868
 
869
  }else{
870
+ $this->_csvDataCache = array();
871
  $logPath = explode('logicbrokervendorproduct',str_replace("\\","/",$path));
872
+ $this->sendMail(array('isfailed'=>true,'vendor_code'=>$vendorCode,'subject'=>'dropship360 failed to update inventory','message' => 'Bad File header,Check header format at following FTP path '.$logPath[1]));
873
  $this->genrateLogEntry(array('lb_vendor_code'=>$vendorCode,'ftp_error'=>'Bad File header','ftp_error_desc'=>'Check header format at following FTP path '.$logPath[1],'error'=> 1));
874
  Mage::log('Please check header format', null, 'logicbroker_ftp_vendor_inventory_import.log');
875
  }
877
  $this->archiveFtpFile(array('object'=>$connectionResult['object'],'path'=>$path));
878
  }
879
  }
 
880
  $this->finalize();
881
  }else{
882
  Mage::log('No files found on ftp server', null, 'logicbroker_ftp_vendor_inventory_import.log');
884
  return $this;
885
  }
886
  ftp_close($connectionResult['object']);
887
+ $this->_csvParserObj->emptyTable();
888
+ $this->_csvDataCache = array();
889
+ Mage::helper('dropship360')->turnOnReadCommittedMode(); //restore to orignal transection level
890
  return $this;
 
891
  }
892
 
893
  protected function initialize(){
894
+ Mage::helper('dropship360')->startProcess('manual_upload');
895
  Mage::log('Ftp upload started', null, 'logicbroker_ftp_vendor_inventory_import.log');
896
  }
897
 
898
  protected function finalize(){
899
+ Mage::helper('dropship360')->finishProcess('manual_upload');
900
  Mage::log('Ftp upload finished', null, 'logicbroker_ftp_vendor_inventory_import.log');
901
  }
902
 
906
  $patharr = explode('logicbrokervendorproduct',$path);
907
  $dirname = pathinfo($patharr[1],PATHINFO_DIRNAME);
908
  $basename = pathinfo($patharr[1],PATHINFO_BASENAME );
909
+ $newname = Mage::getModel('core/date')->date('Ymd-his').'_'.$basename;
910
+ $connection = $this->testFtpConnection($this->ftpRequestPram,true);
911
+ if($connection['error'])
912
+ {
913
+ $this->sendMail(array('subject'=>'Your magento site has failed to connect FTP site','message' => "Connection Failure--Can not archive file -".$basename,'bcc'=>trim(Mage::helper('dropship360')->getConfigObject('apiconfig/email/bcc'))));
914
+ Mage::log($connection['message'] ."--Can not archive file -".$basename, null, 'logicbroker_ftp_vendor_inventory_import.log');
915
+ }
916
+ else
917
+ {
918
+ $object['object'] = $connection['object'];
919
+ }
920
  ftp_chdir($object['object'],$dirname);
921
  ftp_mkdir($object['object'], 'Archive');
922
  ftp_chdir($object['object'],'Archive');
925
  ftp_chdir($object['object'],'/');
926
  $this->fileObj()->rm($object['path']);
927
  ftp_delete($object['object'], $dirname.'/'.$basename);
928
+ ftp_close($connection['object']);
929
  return;
930
 
931
  }
933
  {
934
  $file = str_replace("/","\\",$file);
935
  $extension = pathinfo($file, PATHINFO_EXTENSION);
 
 
 
 
 
 
 
 
936
  return true;
937
  }
938
 
950
  ftp_chdir($ftpRequest,'/'.$fileName[0].'/'.$fileName[1]);
951
  $server_file = $fileName[2];
952
  $local_file = self::getWorkingDir().$path.DS.$fileName[2];
 
 
 
 
953
  // download server file
954
  if (ftp_get($ftpRequest, $local_file, $server_file, FTP_ASCII)){
955
 
959
  }
960
  }
961
 
962
+ protected function uploadReport($file,$vendorCode){
963
+ $path = $this->getConfigValue(self::XML_PATH_UPLOAD_FTP_ACCNUMBER).'_'.$vendorCode.'/'.'Inventory';
964
+ $reprotPath = 'report'.Mage::getModel('core/date')->date('Ymd-his').'.csv';
965
+ $connection = $this->testFtpConnection($this->ftpRequestPram,true);
966
+ if($connection['error'])
967
+ {
968
+ $this->sendMail(array('subject'=>'Your magento site has failed to connect FTP site','message' => "Connection Failure--Can not upload report file -".$basename,'bcc'=>trim(Mage::helper('dropship360')->getConfigObject('apiconfig/email/bcc'))));
969
+ Mage::log($connection['message'] ."--Can not archive file -".$basename, null, 'logicbroker_ftp_vendor_inventory_import.log');
970
+ }
971
+ else
972
+ {
973
+ $object = $connection['object'];
974
+ }
975
+ ftp_chdir($object,'/');
976
+ ftp_chdir($object,$path);
977
+ ftp_mkdir($object,'Reports');
978
+ ftp_chdir($object,'Reports');
979
+ ftp_put($object, $reprotPath,$file['value'], FTP_ASCII);
980
+ ftp_chdir($object,'/');
981
+ $this->fileObj()->rm( $file['value']);
982
+ ftp_close($connection['object']);
983
+ return;
984
+ }
985
  protected function ftpUpdateVendorProduct($csvData,$path,$vendorCode = null)
986
  {
987
  $records = array();
988
  $success = array();
989
  $failure = array();
990
  $itemerroroutput = array();
991
+ $counter = 0;
992
  //$vendorCode = '';
993
+ $tableVendorImportLog = Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship360/vendor_import_log' );
994
+ if(count($csvData) <= 1 && Mage::getModel('dropship360/csvparser')->isCsvFileEmpty())
995
  {
996
+ $failure[] = 'Sorry,we cant find the record to update inventory';
997
+ $this->_FtpErrors[] = array('error_type'=>'empty_file','value'=>'Sorry,we cant find the record to update inventory');
998
  }
999
+ $records = Mage::getModel('dropship360/csvparser')->generateFtpCsvRow($csvData,$vendorCode);
1000
+ //$this->conn->beginTransaction ();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1001
  if(is_array($records) && !empty($records)){
1002
  $requestData = array_chunk($records, 1, true);
1003
 
1007
  $result[] = $this->validateCsvData($data, true);
1008
  }
1009
  }
 
1010
  foreach($result as $successOrfail){
1011
  if($successOrfail['success']!="")
1012
  $success[] = $successOrfail['success'];
1016
  }
1017
  $this->checkDataIntigrity($this->_getCsvData($path),true);
1018
  }
1019
+ $finalResultCounter = (!$this->_isProductSetupMode) ? $this->logForUnprocessedRows($vendorCode,true) : 0;
1020
+ if(is_array($finalResultCounter))
1021
+ {
1022
+ $failed = count($failure)+$finalResultCounter['failure'];
1023
+ $success = count($success)+$finalResultCounter['success'];
1024
+ }else
1025
+ {
1026
+ $failed = count($failure)+$finalResultCounter;
1027
+ $success = count($success)+$finalResultCounter;
1028
  }
1029
+ $itemerroroutput = Mage::helper('core')->jsonEncode($this->_FtpErrors);
1030
+ //$failed = count($failure)+$counter;
1031
+ $ftp_err = ($failed > 0) ? 'Missing/Bad Data' : '';
1032
+ $insert = 'INSERT INTO '.$tableVendorImportLog.'(lb_vendor_code,updated_by,success,failure,ftp_error,created_at) VALUES ("'.$vendorCode.'","FTP",'.$success.','.$failed.',"'.$ftp_err.'","'.now().'")';
1033
+ $this->conn->beginTransaction ();
 
 
 
 
 
 
 
 
 
 
1034
  $this->conn->query($insert);
1035
+ $entityId = $this->conn->lastInsertId($tableVendorImportLog);
1036
  try {
1037
  $this->conn->commit ();
1038
+ if(count($this->_FtpErrors) > 0){
1039
+ $csvFile = Mage::helper('dropship360')->generateErrorList(array('ftp_error_desc'=>$itemerroroutput,'lb_vendor_code'=>$vendorCode),true);
1040
+ $this->uploadReport($csvFile,$vendorCode);
1041
+ }
1042
+ if($this->sendBadFileAlert){
1043
+ $logPath = explode('logicbrokervendorproduct',str_replace("\\","/",$path));
1044
+ $this->sendMail(array('isfailed'=>true,'vendor_code'=>$vendorCode,'subject'=>'dropship360 failed to update inventory','message' => 'Missing/Bad data, check CSV data at following FTP path <br>'.$logPath[1]));
1045
+ }
1046
+ $this->prepareInsertAndExeQuery($this->_FtpErrors,$entityId);
1047
+ $itemerroroutput = array();
1048
+ $this->_FtpErrors = array();
1049
  } catch ( Exception $e ) {
1050
  $this->conn->rollBack ();
1051
  Mage::log($e->getMessage(), null, 'logicbroker_ftp_vendor_inventory_import.log');
1056
 
1057
  protected function ftpVendorProductUpdate($data)
1058
  {
1059
+ $tableVendorInventory = Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship360/inventory' );
1060
  $inventoryCollectionResult = $this->getInventoryCollection($data,true);
1061
  $qtyArray = $this->calculateProductQty(array('magento_sku'=>$inventoryCollectionResult['magento_sku'],'qty'=>$data['qty'],'lb_vendor_code'=>$data['lb_vendor_code']));
1062
  switch($inventoryCollectionResult['operationType'])
1064
  case 'update':
1065
  $productId = Mage::getModel('catalog/product')->getIdBySku($inventoryCollectionResult['magento_sku']);
1066
  if($productId){
1067
+ $update = $this->_prepareUpdateQuery($data,$qtyArray,$inventoryCollectionResult,$tableVendorInventory,true);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1068
  try {
1069
  if(!$this->updateProductInventory($inventoryCollectionResult['magento_sku'],$qtyArray['final_qty']))
1070
  {
1071
+ $this->_FtpErrors[] = array('error_type'=>'inventory_update_error','value'=>array('magento_sku'=>$inventoryCollectionResult['magento_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));;
1072
+ $this->sendBadFileAlert = true;
1073
  return false;
1074
  }
1075
+ if($update){
1076
+ $this->conn->beginTransaction ();
1077
  $this->conn->query($update);
1078
+ $this->conn->commit ();
1079
+ }
1080
  return true;
1081
  } catch ( Exception $e ) {
1082
+ $this->conn->rollBack ();
1083
  Mage::log($e->getMessage(), null, 'logicbroker_ftp_vendor_inventory_import.log');
1084
  echo $e->getMessage();
1085
  }
1086
 
1087
  }else{
1088
+ $this->_FtpErrors[] = array('error_type'=>'combination_notexist','value'=>array('magento_sku'=>'','qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1089
+ $this->sendBadFileAlert = true;
1090
  return false;
1091
  }
1092
  break;
1093
  default :
1094
  /*fix for ticket lbn-710 vendor_sku not visible*/
1095
+ $this->_FtpErrors[] = array('error_type'=>'combination_notexist','value'=>array('magento_sku'=>'','qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));;
1096
+ $this->sendBadFileAlert = true;
1097
  return false;
1098
  }
1099
  return true;
1102
  protected function genrateLogEntry($message)
1103
  {
1104
  $vendorCode = (!empty($message['lb_vendor_code'])) ? $message['lb_vendor_code'] : '';
1105
+ $ftp_error = (!empty($message['ftp_error'])) ? $message['ftp_error'] : '';
1106
+ $ftp_error_desc = (!empty($message['ftp_error_desc'])) ? $message['ftp_error_desc'] : '';
1107
+ $tableVendorImportLog = Mage::getSingleton ( 'core/resource' )->getTableName ( 'dropship360/vendor_import_log' );
1108
  $this->conn->beginTransaction ();
1109
  $now = now();
1110
  $insert = 'INSERT INTO '.$tableVendorImportLog.'(lb_vendor_code,updated_by,success,failure,created_at,ftp_error,ftp_error_desc) VALUES ("'.$vendorCode.'","FTP",'.count($success).','.$message['error'].',"'.$now.'","'.$ftp_error.'","'.$ftp_error_desc.'")';
1148
  if(!$duplicateCombination = $this->chekDuplicateCombination($data)){
1149
  $invalidData = true;
1150
  if(!$isFtp){
1151
+ $this->_UploadCsvErrors[] = array('error_type'=>'combination_exist','value'=>array('magento_sku'=>$data['magento_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1152
  }else{
1153
+ $this->_FtpErrors[] = array('error_type'=>'combination_exist','value'=>array('magento_sku'=>$data['magento_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1154
+ $this->sendBadFileAlert = true;
1155
  }
1156
  }
1157
  $vendorCollection = $this->_inventoryModel->getCollection()->addFieldTofilter('lb_vendor_code',$data['lb_vendor_code'])->addFieldTofilter('lb_vendor_sku',trim($data['vendor_sku']));
1165
  if($vendorCollection->getSize() > 0){
1166
  if($data['magento_sku']!=$vendorCollection->getFirstItem ()->getProductSku()){
1167
  $invalidData = true;
1168
+ $this->_UploadCsvErrors[] = array('error_type'=>'already_assigned','value'=>array('magento_sku'=>$data['magento_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1169
  }
1170
  }
1171
  if($invalidData){
1182
  $failure+=1;
1183
  if(!$isFtp){
1184
  if(trim($data['vendor_sku']))
1185
+ $this->_UploadCsvErrors[] = array('error_type'=>'combination_notexist','value'=>array('magento_sku'=>'','qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1186
  }else{
1187
  if(trim($data['vendor_sku']))
1188
+ $this->_FtpErrors[] = array('error_type'=>'combination_notexist','value'=>array('magento_sku'=>'','qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1189
+ $this->sendBadFileAlert = true;
1190
  }
1191
  }
1192
  if($data['magento_sku']){
1196
  $insertInventoryLog = $this->getInventoryLogQuery($data, $inventoryCollectionResult['operationType'], $data['qty'], null,$ignoreData);
1197
  }
1198
  if($insertInventoryLog)
1199
+ {
1200
+ $this->conn->beginTransaction ();
1201
+ $this->conn->query($insertInventoryLog);
1202
+ try{
1203
+ $this->conn->commit ();
1204
+ }catch(Exception $e){
1205
+ $this->conn->rollBack ();
1206
+ }
1207
+ }
1208
  }
1209
  return array('success'=>$success, 'failure'=>$failure);
1210
  }
1230
  if(!empty($existing_product_sku)){
1231
  if($data['magento_sku'] != $existing_product_sku){
1232
  $invalidData = true;
1233
+ $this->_UploadCsvErrors[] = array('error_type'=>'duplicate_vendor_sku','value'=>array('magento_sku'=>$data['magento_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1234
 
1235
  }else{
1236
  $invalidData = true;
1237
+ $this->_UploadCsvErrors[] = array('error_type'=>'combination_exist','value'=>array('magento_sku'=>$data['magento_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1238
  }
1239
  }
1240
  }
1262
  ($this->vendorProductInsert($data)) ? $success += 1 : $failure+=1;
1263
  if($this->vendorProductInsert($data)){
1264
  $insertInventoryLog = $this->getInventoryLogQuery($data, $type, 0, null, null);
1265
+ if($insertInventoryLog){
1266
+ $this->conn->beginTransaction ();
1267
+ $this->conn->query($insertInventoryLog);
1268
+ try{
1269
+ $this->conn->commit ();
1270
+ }catch(Exception $e){
1271
+ $this->conn->rollBack ();
1272
+ }
1273
+ }
1274
  }
1275
  }
1276
  }else{
1277
  $failure+=1;
1278
+ $this->_UploadCsvErrors[] = array('error_type'=>'magento_sku_exists','value'=>array('magento_sku'=>$data['magento_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1279
  }
1280
  return array('success'=>$success, 'failure'=>$failure);
1281
  }
1334
  }
1335
  return $trimmedSkus;
1336
  }
1337
+
1338
+ protected function sendMail($mailData = array()){
1339
+ if (!Mage::getStoreConfigFlag (self::XML_PATH_INVENTORY_NOTIFICATION_EMAIL_ENABLED)) {
1340
+ return $this;
1341
+ }
1342
+ $mailData['datetime'] = Mage::getModel('core/date')->date();
1343
+ $postObject = new Varien_Object();
1344
+ $postObject->setData($mailData);
1345
+ $email = trim(Mage::getStoreConfig(self::XML_PATH_INVENTORY_NOTIFICATION_EMAIL));
1346
+ $templateId = 'logicbroker_ftp_con_fail';
1347
+ $isMailSent = Mage::helper('dropship360')->sendMail($postObject,$email,$templateId);
1348
+ if(!$isMailSent)
1349
+ Mage::log('Notification email not sent :'.$email, null, 'logicbroker_debug.log');
1350
+ }
1351
+ protected function logForUnprocessedRows($vendorCode,$isFtp = false){
1352
+ $msg = '';
1353
+ $error = 0;
1354
+ $success = 0;
1355
+ $proObj = Mage::getModel('dropship360/ranking')->load($vendorCode,'lb_vendor_code');
1356
+ $proLinkAttr = $proObj->getLinkingAttribute();
1357
+ $proLinkAttr = empty($proLinkAttr) ? 'none' : $proLinkAttr;
1358
+ $this->supplierName = $proObj->getLbVendorName();
1359
+ $helper = Mage::helper('dropship360');
1360
+ $csvData = Mage::getModel('dropship360/csvparser')->getUnprocessedCsvRows($vendorCode,$isFtp);
1361
+ if(count($csvData) > 0 ){
1362
+ foreach($csvData as $data){
1363
+ $collection = $this->_inventoryModel->getCollection()->addFieldTofilter('lb_vendor_code',$vendorCode)->addFieldTofilter('lb_vendor_sku',$data['vendor_sku']);
1364
+ if($collection->getSize() > 0)
1365
+ {
1366
+ $msg = array('error_type'=>'data_notchnage','value'=>array('magento_sku'=> $collection->getFirstItem()->getProductSku(),'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1367
+ (!$isFtp) ? $this->_UploadCsvErrors[] = $msg : $this->_FtpErrors[] = $msg;
1368
+ $error++;
1369
+ }else
1370
+ {
1371
+ switch ($proLinkAttr) {
1372
+ case 'none':
1373
+ $msg = array('error_type'=>'combination_notexist','value'=>array('magento_sku'=>'','qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1374
+ (!$isFtp) ? $this->_UploadCsvErrors[] = $msg : $this->_FtpErrors[] = $msg;
1375
+ $error++;
1376
+ break;
1377
+ default:
1378
+ $proCol = Mage::getModel('catalog/product')->getCollection();
1379
+ if(!$this->checkAttributeAval($proLinkAttr,$proCol)){
1380
+ $msg = array('error_type'=>'attribute_notexist','value'=>array('magento_sku'=>'','qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1381
+ (!$isFtp) ? $this->_UploadCsvErrors[] = $msg : $this->_FtpErrors[] = $msg;
1382
+ $error++;
1383
+ }else{
1384
+ $product = $proCol->addAttributeToFilter($proLinkAttr,$data['vendor_sku']);
1385
+ if($this->validateGenerateProduct($product,$data,$proLinkAttr,$isFtp)){
1386
+ $tempArray = $this->genNonExistPro($product,$data,$isFtp);
1387
+ !empty($tempArray['success']) ? $success++ : '';
1388
+ !empty($tempArray['failure']) ? $error++ : '';
1389
+ }else
1390
+ {
1391
+ $error++;
1392
+ }
1393
+ }
1394
+ break;
1395
+ }
1396
+ }
1397
+ }
1398
+ $csvData[0] = $this->_csvDataCache[0];
1399
+ $this->emptyRecords = array();
1400
+ $this->result = array();
1401
+ $this->checkDataIntigrity($csvData,$isFtp);
1402
+ }
1403
+ return array('success'=>$success,'failure'=>$error);
1404
+ }
1405
+ protected function prepareInsertAndExeQuery($csvData,$entityId){
1406
+ if(count($csvData) <= 0 || empty($entityId))
1407
+ return ;
1408
+ $tableName = Mage::getSingleton ( 'core/resource' )->getTableName ('dropship360/vendor_import_log_desc');
1409
+
1410
+ foreach($csvData as $data)
1411
+ {
1412
+ try {
1413
+ $this->conn->insertArray($tableName,array('error_id','description'),array(array($entityId,Mage::helper('core')->jsonEncode($data))));
1414
+ } catch ( Exception $e ) {
1415
+ Mage::logException($e);
1416
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
1417
+ }
1418
+
1419
+ }
1420
+ return ;
1421
+ }
1422
+ protected function validateGenerateProduct($product,$data,$attr,$isFtp){
1423
+ $isValid = true;
1424
+ $helper = Mage::helper('dropship360');
1425
+ if($product->getSize() == 0)
1426
+ {
1427
+ $errorType = ($attr == $helper::LOGICBROKER_PRODUCT_LINK_CODE_SKU) ? 'magento_sku_exists' : $attr.'_notexist';
1428
+ $msg = array('error_type'=>$errorType,'value'=>array('magento_sku'=>$data['vendor_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1429
+ (!$isFtp) ? $this->_UploadCsvErrors[] = $msg : $this->_FtpErrors[] = $msg;
1430
+ $isValid = false;
1431
+ }elseif($product->getSize() > 1)
1432
+ {
1433
+ $msg = array('error_type'=>$attr.'_multiple','value'=>array('magento_sku'=>'','qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1434
+ (!$isFtp) ? $this->_UploadCsvErrors[] = $msg : $this->_FtpErrors[] = $msg;
1435
+ $isValid = false;
1436
+ }else{
1437
+ $data['magento_sku'] = $product->getFirstItem()->getSku();
1438
+ if(!$this->chekDuplicateCombination($data))
1439
+ {
1440
+ $msg = array('error_type'=>'combination_exist','value'=>array('magento_sku'=>$data['magento_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1441
+ (!$isFtp) ? $this->_UploadCsvErrors[] = $msg : $this->_FtpErrors[] = $msg;
1442
+ $isValid = false;
1443
+ }
1444
+ }
1445
+
1446
+ return $isValid;
1447
+ }
1448
+
1449
+ protected function genNonExistPro($proObj,$data,$isFtp){
1450
+ $invalidData = false;
1451
+ $failure = 0;
1452
+ $success = 0;
1453
+ $ignoreData = array();
1454
+ $data['magento_sku'] = $proObj->getFirstItem()->getSku();
1455
+ /* LBN - 935 change */
1456
+ $data['qty'] = (is_numeric($data['qty'])) ? Mage::helper('dropship360')->getIsQtyDecimal($data['magento_sku'],$data['qty']) : $data['qty'];
1457
+ if(!is_numeric($data['qty']) || $data['qty'] < 0){
1458
+ $ignoreData[]= 'qty';
1459
+ }
1460
+ if(!is_numeric($data['cost']) || $data['cost'] < 0){
1461
+ $ignoreData[]= 'cost';
1462
+ }
1463
+ if((!is_numeric($data['cost']) || $data['cost'] < 0) && (!is_numeric($data['qty']) || $data['qty'] < 0)){
1464
+ if($data['cost']!="" && $data['qty']!="")
1465
+ $invalidData = true;
1466
+ }
1467
+
1468
+ if($invalidData){
1469
+ $failure+=1;
1470
+ }else{
1471
+ ($this->insertNonExistPro($proObj,$data,$isFtp)) ? $success += 1 : $failure += 1;
1472
+ }
1473
+
1474
+ $this->insertInventoryLog($ignoreData,$data,$isFtp);
1475
+
1476
+ return array('success'=>$success,'failure'=>$failure);
1477
+ }
1478
+
1479
+ protected function insertNonExistPro($proObj,$data,$isFtp = false){
1480
+
1481
+ $vendorCode = ($isFtp) ? $data['lb_vendor_code'] : $this->_vendorCode;
1482
+ $tableVendorInventory = Mage::getSingleton ('core/resource')->getTableName('dropship360/inventory');
1483
+ $qtyArray = $this->calculateProductQty($data);
1484
+ $costInsert = (!is_numeric($data['cost']) || $data['cost'] < 0 || trim($data['cost']) =="") ? 0 : $data['cost'] ;
1485
+ $qtyInsert = ($qtyArray['upload_qty'] == .999999999 || trim($data['qty']) =="" ) ? 0 : $qtyArray['upload_qty'];
1486
+ $dbFields = array('lb_vendor_code','lb_vendor_name','product_sku','lb_vendor_sku','stock','cost','created_at','updated_at');
1487
+ $dbFieldVal = array(
1488
+ array($vendorCode,$this->supplierName,$data['magento_sku'],$data['vendor_sku'],$qtyInsert,$costInsert,now(),now())
1489
+ );
1490
+ try {
1491
+ if(!$this->updateProductInventory(trim($data['magento_sku']),$qtyArray['final_qty']))
1492
+ {
1493
+ $this->_UploadCsvErrors[] = array('error_type'=>'inventory_update_error','value'=>array('magento_sku'=>$data['magento_sku'],'qty'=>$data['qty'],'vendor_sku'=>$data['vendor_sku'],'cost'=>$data['cost']));
1494
+ return false;
1495
+ }
1496
+ $this->conn->insertArray($tableVendorInventory,$dbFields,$dbFieldVal);
1497
+ return true;
1498
+ } catch ( Exception $e ) {
1499
+ Mage::logException($e);
1500
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
1501
+ }
1502
+
1503
+
1504
+ }
1505
+ protected function insertInventoryLog($ignoreData,$data,$isFtp)
1506
+ {
1507
+ $type = 'add';
1508
+ $vendorCode = ($isFtp) ? $data['lb_vendor_code'] : $this->_vendorCode;
1509
+ if(count($ignoreData)>0){
1510
+ (in_array('qty', $ignoreData)) ? $type = 'Cost Added, Qty Ignored' : '';
1511
+ (in_array('cost', $ignoreData)) ? $type = 'Qty Added, Cost Ignored' : '';
1512
+
1513
+ if(count($ignoreData)==2){
1514
+ $type = 'ignore';
1515
+ }
1516
+ }
1517
+ if($data['qty']==0.999999999)
1518
+ $data['qty'] = 0;
1519
+ $tableName = Mage::getSingleton("core/resource")->getTableName('dropship360/inventorylog');
1520
+ $updatedBy = (!$isFtp) ? Mage::getSingleton('admin/session')->getUser()->getUsername() : 'FTP';
1521
+ $dbFields = array('lb_vendor_code','lb_vendor_name','product_sku','cost','stock','updated_by','activity','updated_at','created_at');
1522
+ $dbFieldVal = array(
1523
+ array($vendorCode,$this->supplierName,$data['magento_sku'],$data['cost'],$data['qty'],$updatedBy,$type,now(),now())
1524
+ );
1525
+ try {
1526
+ $this->conn->insertArray($tableName,$dbFields,$dbFieldVal);
1527
+ return true;
1528
+ } catch ( Exception $e ) {
1529
+ Mage::logException($e);
1530
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
1531
+ }
1532
+
1533
+ }
1534
+ protected function checkAttributeAval($attr,$object){
1535
+ $isExist = false;
1536
+ $attrEav = Mage::getResourceModel('catalog/eav_attribute')->loadByCode('catalog_product',$attr);
1537
+ if ($attrEav->getId())
1538
+ $isExist = true;
1539
+ return $isExist;
1540
+ }
1541
+ }
js/logicbroker/vendorhistory.css ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .black_overlay{
2
+ display: none;
3
+ position: fixed;
4
+ top: 0%;
5
+ left: 0%;
6
+ width: 100%;
7
+ height: 100%;
8
+ background-color: black;
9
+ z-index:1001;
10
+ -moz-opacity: 0.8;
11
+ opacity:.80;
12
+ filter: alpha(opacity=80);
13
+ }
14
+ .white_content {
15
+ display: none;
16
+ position: fixed;
17
+ top: 25%;
18
+ left: 25%;
19
+ width: 50%;
20
+ height: 50%;
21
+ padding: 16px;
22
+ border: 8px solid #f3bf8f;
23
+ background-color: white;
24
+ z-index:1002;
25
+ overflow: auto;
26
+ }
27
+ .supplier-pager .amount {
28
+ float: left;
29
+ height: 30px;
30
+ line-height: 30px;
31
+ }
32
+
33
+ .supplier-pager .limiter {
34
+ float: left;
35
+ line-height: 30px;
36
+ height: 30px;
37
+ margin: 0 10px;
38
+ }
39
+
40
+ .supplier-pager .pages strong {
41
+ display: none;
42
+ }
43
+
44
+ .supplier-pager .pages {
45
+ margin: 0 auto;
46
+ text-align: center;
47
+ display: inline-block;
48
+ overflow: hidden;
49
+ float: none;
50
+ }
51
+
52
+ .supplier-pager .pages > ol {
53
+ margin: 0px auto;
54
+ overflow: hidden;
55
+ text-align: center;
56
+ }
57
+
58
+ .supplier-pager .pages li {
59
+ float: left;
60
+ margin: 0 0px 0 1px;
61
+ display: block;
62
+ text-align: center;
63
+ }
64
+
65
+ .supplier-pager .pages li.current {
66
+ background-color: #E5E5E5;
67
+ border: none;
68
+ }
69
+
70
+ .supplier-pager .pages li a,.supplier-pager .pages li.current {
71
+ background-color: #F5F5F5;
72
+ display: inline-block;
73
+ border: 0;
74
+ font-size: 13px;
75
+ text-align: center;
76
+ text-transform: uppercase;
77
+ vertical-align: middle;
78
+ white-space: nowrap;
79
+ line-height: 30px;
80
+ width: 25px;
81
+ height: 30px;
82
+ padding: 0;
83
+ color: #ea7601;
84
+ font-family: Verdana, Arial, sans-serif;
85
+ }
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>dropship360</name>
4
- <version>2.1.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://logicbroker.com/portfolio/magento/license">Customer License</license>
7
  <channel>community</channel>
@@ -10,9 +10,9 @@
10
  <description>logicbroker is the most complete eCommerce integration platform available and offers a true end-to-end EDI solution for Magento. Beyond its EDI capabilities, logicbroker&#x2019;s flexible connectivity automates and simplifies tasks like drop ship deployment and omni-channel retailing. logicbroker connects Magento to backend systems like ERPs (Dynamics, Netsuite, Exact), accounting software (QuickBooks), and order management systems (M.O.M) to seamlessly exchange information</description>
11
  <notes>package is ready</notes>
12
  <authors><author><name>Logicbroker</name><user>Logicbroker</user><email>magentoext@logicbroker.com</email></author></authors>
13
- <date>2015-06-25</date>
14
- <time>09:37:54</time>
15
- <contents><target name="magecommunity"><dir name="Logicbroker"><dir name="Dropship360"><dir name="Block"><dir name="Adminhtml"><dir name="Inventory"><dir name="Edit"><dir name="Tab"><file name="Addvendorfield.php" hash="6625647e155eacc986eca2a4d373b281"/><file name="Lbvendor.php" hash="27f09bc7b031dc069a362a7975720842"/><file name="Vendortabhistory.php" hash="e016910fb9519d329772430b44e5e893"/></dir><file name="Vendortab.php" hash="814752c7c23059c93eb4fdc41a32bdd2"/><file name="Vendortabhistory.php" hash="c3a43db297bc516fac6f1a2beb2680c4"/></dir><file name="Grid.php" hash="380086c734d9cfd461dd03769e5ebe58"/></dir><file name="Inventory.php" hash="c7728661548631477dcc48d817719877"/><file name="Logicbroker.php" hash="ce2312714d815277183c307473ad2f07"/><file name="Notification.php" hash="cfe6611b4238cc315cd8fcee18e50387"/><dir name="Ranking"><file name="Grid.php" hash="7f04b9fdff771da3ef4e372c0ece1dcf"/></dir><file name="Ranking.php" hash="3df5f3d9b3eb76dfcfb76953e3e611a0"/><dir name="Reports"><dir name="Activitymonitor"><file name="Email.php" hash="6fb521aa6a26ff35dad2ed5ac1dcfd04"/><file name="Form.php" hash="e50e581912bd8f73556528121266da45"/><file name="Grid.php" hash="9029ec4399242544707cd8985d7c38b8"/><file name="Periodopen.php" hash="6297aefbe9fc2f7c9449e1b461afe075"/></dir><file name="Activitymonitor.php" hash="a3473f721724bbbca3b6f77ff91035ed"/><dir name="Form"><file name="Timestatus.php" hash="3c05459135341b52b439e2c119781ab1"/></dir></dir><dir name="Sales"><dir name="Order"><dir name="View"><file name="Items.php" hash="5245dfa460de93a54aede73d952518c0"/></dir></dir></dir><file name="Showhistory.php" hash="f68cf95bc55e779d441376a73ba56d60"/><dir name="Sourcing"><dir name="Edit"><file name="Form.php" hash="e6b0312f4fc38b771089fbb1815578ef"/><dir name="Tab"><file name="Form.php" hash="60a5d352df0d20ac200e29d83203cafa"/></dir><file name="Tabs.php" hash="ef1501d2821bbb92e9b9033368f1040e"/></dir><file name="Edit.php" hash="f8b57c6d6523f86a20706ce30d17d4d4"/><file name="Grid.php" hash="48399aa0d9aa46f40b41ca232c60483a"/><dir name="History"><dir name="Renderer"><file name="Action.php" hash="edea4e5929b246ff70d063aa5845b3f9"/></dir><dir name="View"><file name="Form.php" hash="f4df7e1a5aeed4099587cd9faffa9754"/><file name="Tabs.php" hash="461d00cc9f003e3f34762effb56c715c"/></dir><file name="View.php" hash="b579312729923625c759073e4364e8e5"/></dir></dir><file name="Sourcing.php" hash="af52b223025355dabddd48c91e1b8b33"/><dir name="System"><dir name="Config"><file name="Crontime.php" hash="b81ffae42850e8171d357f911a0e11fc"/><dir name="Fieldset"><file name="Hint.php" hash="9edf815e44d4ce26c6ee421012ac2c9c"/></dir><file name="Ftpconnectionbutton.php" hash="6a3b3b65888ce196a397e4c8af61589b"/><file name="Helplink.php" hash="a03673c6286b925737553bf46b4372ba"/><file name="Singuplink.php" hash="a6927e292ac86b35339a5029034b5ac2"/><file name="Submitbutton.php" hash="7ce0fade94eede8db6ff04c0dbe50dac"/><file name="Time.php" hash="74a40038b4a50994296b0cb7fce2947f"/></dir></dir><dir name="Upload"><file name="Bulkassign.php" hash="56d1feb5ba70d29c5afd99bad850f9b7"/><dir name="Edit"><file name="Button.php" hash="7b98d1326c1f93bc643e1463242224a2"/><file name="Form.php" hash="b0377f1f4bb8426410a9cb297a286bc9"/></dir></dir><file name="Upload.php" hash="27b63659c455c3b7543497271ffbc80a"/><file name="Vendorproductuploadhistory.php" hash="4ef8cc2c4de117935d762c44fad929d8"/><dir name="Widget"><dir name="Grid"><dir name="Column"><file name="Nameaction.php" hash="bd171423eec53f92fda759bf4d3624f1"/><file name="Orderaction.php" hash="842701da280c25c3c552b05d7c06413e"/><file name="Skuaction.php" hash="0c4477b7bdabcc81da134929b2926ef7"/><file name="Textaction.php" hash="9855312bb0dcac85104f7f0cd4a51054"/></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="80f8221910b329d8564d513c42d37ff1"/></dir><dir name="Model"><dir name="Api2"><file name="Createroleandrule.php" hash="0705eae3777b7cfc4eeba433265edeb5"/><dir name="Inventory"><dir name="Rest"><dir name="Admin"><file name="V1.php" hash="642da28ad0fb79d889552472de633638"/></dir><dir name="Customer"><file name="V1.php" hash="c0327118b69995896f78acd7907fa71f"/></dir><dir name="Guest"><file name="V1.php" hash="1c3f3a1a87ccd9bd1120138d8369229d"/></dir></dir><file name="Rest.php" hash="b7e996ed201e1d1e0239d6d226ef1007"/></dir><file name="Inventory.php" hash="9d08c98e36b9c232b9d796a418aac383"/><dir name="Product"><dir name="Rest"><dir name="Admin"><file name="V1.php" hash="6008242b34650ff438483d73af8a7702"/></dir><dir name="Customer"><file name="V1.php" hash="c0327118b69995896f78acd7907fa71f"/></dir><dir name="Guest"><file name="V1.php" hash="0f4c46ad1ef2e6fefd1fdbda4034ad85"/></dir></dir><file name="Rest.php" hash="f423598eb3ae1871d8b4a326f7dda181"/></dir><file name="Product.php" hash="5ced4e9d325db0cf6f748a13c8384298"/></dir><file name="Inventory.php" hash="02a3373d6498ec7b857a4a1f942b0105"/><file name="Inventorylog.php" hash="1c493c02c6270f081f9625c33cd6ae50"/><file name="Logicbroker.php" hash="f4aa68ef222a83d9561341c0d50062bb"/><file name="Observer.php" hash="97ef80eb905c9c1b338bdcdaa4f9176c"/><dir name="Order"><file name="Api.php" hash="dcee014ae73d74ddd8fb16181a085ffb"/></dir><file name="Orderitems.php" hash="cb0e97261ed642bfc5e74b4620f8a81d"/><file name="Ordersourcing.php" hash="cd717bc6118c164851e27a36dc656809"/><file name="Productimport.php" hash="7feece453157d3930e7866b48afaa6f6"/><file name="Ranking.php" hash="439cdfe86f9727ad1ec0049ed7b5a80c"/><file name="Rankinglog.php" hash="eec4a3d38d0aec48c2c07c3e8cfc1daa"/><file name="Report.php" hash="82953e8fcc1470f03448c555802d713b"/><dir name="Resource"><dir name="Inventory"><file name="Collection.php" hash="64abac572c4cdbbd15bec30f0c4614ef"/></dir><file name="Inventory.php" hash="b6853986d109fb7c3ba2c3db32cd0381"/><dir name="Inventorylog"><file name="Collection.php" hash="e5f33b8a0db2acc304ff1f0706c52bf2"/></dir><file name="Inventorylog.php" hash="55255ff69e778710fd2e29700e9da06d"/><dir name="Orderitems"><file name="Collection.php" hash="d3c95b0634b37948b2d0cb19e3637fd6"/></dir><file name="Orderitems.php" hash="f34b5d078a9498d10958395c6875d969"/><dir name="Ordersourcing"><file name="Collection.php" hash="df7fede92820a7b4a50aeac2d32cd7ef"/></dir><file name="Ordersourcing.php" hash="0409c90fb55997b340a54888a6f4b3bf"/><dir name="Ranking"><file name="Collection.php" hash="9efcdcab905872553f0828ecd1670aa6"/></dir><file name="Ranking.php" hash="bb5db1250b0f6ce79f0928cd5aeb49fd"/><dir name="Rankinglog"><file name="Collection.php" hash="5f7dc2e0b408c240220abc0ac36b7868"/></dir><file name="Rankinglog.php" hash="889c96c4a2dd3b45cf6aa322ee4e28ae"/><file name="Setup.php" hash="db1b106449549a4d6a94e115b35f36d3"/><dir name="Uploadvendor"><file name="Collection.php" hash="b24a06b05dc7570b1d904f118401a7eb"/></dir><file name="Uploadvendor.php" hash="c94c815f0f3d2e1646a453b08754e032"/><file name="Vendorimportlog.php" hash="15ac60a8f798c9231d4f27c0fde7cfb0"/></dir><dir name="System"><dir name="Config"><dir name="Backend"><dir name="Report"><file name="Email.php" hash="b8add0d41e93c027e056103eb2ffd784"/></dir><dir name="Sourcing"><file name="Cronbackorder.php" hash="b653137f284099cda52229ca4a03032a"/><file name="Cronsourcing.php" hash="e344d67cb474c67d39453cbfb90ae010"/></dir><dir name="Uploadvendor"><file name="Cron.php" hash="d7ab43d34129359aaca41be3f8510e7a"/></dir></dir><dir name="Source"><file name="Attributecodes.php" hash="7019e72b1ef6a3b198b88beb50b28423"/><file name="Category.php" hash="881c2167d9b011e554eac5067c17b321"/><file name="Ediqualifier.php" hash="5d76df44f40965e294e8de84bb6658e8"/><file name="Ftptype.php" hash="aeafcda1a2d1abffa14b3db37e454c2a"/><file name="Optionvalues.php" hash="a9fa9a4a20d8ec93edeff97e3c8590a7"/><file name="Ranktype.php" hash="f604c3e530d1541996791266430dbaad"/><file name="Store.php" hash="eaa19dfd1575ac6f851f115dd501fbf2"/><file name="Time.php" hash="7ccf6ebc62220eb3861b6ae3c91e7cfa"/><file name="Vendorlist.php" hash="38d75a6b285d8940de2ea443130def4c"/></dir></dir></dir><file name="Uploadvendor.php" hash="bdb6f645f0eab6a4d1c939fa82d58a19"/><dir name="Versions"><dir name="Api"><file name="V2.php" hash="6def122e3c99344db1d10dc0b4ccfaa3"/></dir><file name="Api.php" hash="7fc94e25af730bd4b8f48dbc8603bf7b"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="InventoryController.php" hash="b7a16563b730885689a8d6a094c30d49"/><file name="LogicbrokerController.php" hash="bbe0d67ce6a50d2dc15ba1dec219b90e"/><file name="RankingController.php" hash="b4c12c7c1455a06d90c4bafd550e446e"/><file name="ReportController.php" hash="343239bb1e1a88c7f26786ed84a04229"/><file name="SourcingController.php" hash="e0ce773b6ce36b0959c9644643127cd8"/><file name="UploadController.php" hash="97ab71275f80a70e0138a540731caf71"/></dir></dir><dir name="data"><dir name="dropship360_setup"><file name="data-install-1.0.3.php" hash="f64eb739485e76a1b3b75122ffe0b6e4"/><file name="data-upgrade-1.0.3-1.0.4.php" hash="abe2ec3249c0ee5f06831709e32df84c"/><file name="data-upgrade-1.0.4-1.0.5.php" hash="600ebfb638e81e010971f2abe5da8868"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="421d0fb0752e49a805c8a0d4702fd141"/><file name="api.xml" hash="ea7885ce176a7834b99919e5afa95b35"/><file name="api2.xml" hash="9cb4085a1308c3125122eff3873f1c27"/><file name="config.xml" hash="612bc4f5d7c29a513307851015f7c46c"/><file name="jstranslator.xml" hash="79a9dc9d7577f91ca53d39d42e7e131d"/><file name="system.xml" hash="f566349afd0dca256993b35d18a99c73"/><file name="wsdl.xml" hash="deb338269cb05784cb598725d16685af"/></dir><dir name="sql"><dir name="dropship360_setup"><file name="mysql4-install-1.0.3.php" hash="7d7a762b292350276581e9fbcface824"/><file name="mysql4-upgrade-1.0.3-1.0.4.php" hash="742378548926e65d35b17542c9073eaf"/><file name="mysql4-upgrade-1.0.4-1.0.5.php" hash="240baad27f8e8465fe9f25e8857c665f"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="logicbroker"><file name="add_help_js.phtml" hash="0ace78350cb5efccf248ce7abdeef4f0"/><file name="addvendorfields.phtml" hash="bde763b9cf60e59b243752361c0c836f"/><dir name="bundle"><file name="renderer.phtml" hash="30768bd9ab10afd38d8638fdd4e8f1c7"/></dir><dir name="downloadable"><file name="downloadable.phtml" hash="b3ae1d38fc0d46088f81075c7c83c3cd"/></dir><dir name="import"><dir name="form"><file name="after.phtml" hash="08085046e6675633ada4009bc000297f"/><file name="before.phtml" hash="3dda3ab8d33e980fb48b3ac8af757bfc"/></dir><dir name="frame"><file name="result.phtml" hash="3593b07a3b9540c7eea44d29fbf3c272"/></dir></dir><file name="inline-edit.phtml" hash="bb76be6a89e4acfe3814324d18c514f6"/><file name="item_order_history.phtml" hash="a76e0a3f2143b7f3d45587bf79f5ab7e"/><file name="popup.phtml" hash="ca4e3467dceb197329cd2593e4d90096"/><file name="process-profile.phtml" hash="7e0e5aa22e6f331e48a166cd3e368c7d"/><dir name="reports"><dir name="grid"><file name="container.phtml" hash="8e3b1b857ac68763823f0ef5dd607d80"/></dir></dir><file name="result.phtml" hash="b678e39aa114a5385d14991b259cc252"/><dir name="sales"><file name="default.phtml" hash="a74e549bdd51a049d14130b31f0e039a"/><file name="items.phtml" hash="eece06fcdcbc9cb7975577e635191d0a"/></dir><dir name="system"><dir name="config"><dir name="fieldset"><file name="hint.phtml" hash="916fad4ec2abad24fc66b7034f5264b6"/></dir><file name="submitbutton.phtml" hash="ad652c41e879efe23da1a58d963dd197"/></dir></dir><file name="upload_vendor_product.phtml" hash="b39846857de94d50ad399995f2f25bbd"/><file name="vendor_ranking.phtml" hash="fcd9d7d36170f6559f2e3db61d94bf00"/><file name="vendor_upload_product_history.phtml" hash="dfd479cc649b757e849fb1cf2d9eb92a"/><file name="vendorproducttab.phtml" hash="e72264342c221d69cac54efd2e4a634d"/><file name="vendorproducttabhistory.phtml" hash="9c0194bf9e410f46f1941246cdaee363"/><file name="window.phtml" hash="39ae4fe638386e9e78a49d52828edd21"/></dir></dir><dir name="layout"><file name="logicbroker.xml" hash="5a07628cc48a7e26c61ccbebe88fcba2"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Logicbroker_Dropship360.xml" hash="67068aaea26ac3534322d12dbb7c0c1a"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Logicbroker_Dropship360.csv" hash="34e85a999b73c4a216eed04dfffa756d"/><dir name="template"><dir name="email"><file name="logicbroker.html" hash="a297d490d378b0da09c8ac46104d06a2"/></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="logicbroker"><dir><dir name="extjs"><file name="bootstrap.js" hash="a82e5f0ee98f60e92bb5774e25c480f7"/><dir name="css"><file name="example.css" hash="7fcbf7ea6c0466ac334f00e12ac4be7e"/><file name="ext-all.css" hash="ecf28869070c6511559c6a5286a6f6cb"/><dir name="images"><dir name="boundlist"><file name="trigger-arrow.png" hash="4655916b183b914b357da69b86414f52"/></dir><dir name="box"><file name="corners-blue.gif" hash="86fd4c5664e0971bfc11959e8442604c"/><file name="corners.gif" hash="d2d1bc2085b369ce35ffd20c0121676e"/><file name="l-blue.gif" hash="ced9ffbf66ea39e77083a591f8257267"/><file name="l.gif" hash="c4d9dbbdc59ae06b5e9e72a6a865c981"/><file name="r-blue.gif" hash="82dbb522a80e3246f6297719371a9494"/><file name="r.gif" hash="bf1e1d4a45f951ae656968a8c834f04a"/><file name="tb-blue.gif" hash="7c4b19eb682afdc1bde0640d2321fb25"/><file name="tb.gif" hash="dd3f63afe7ba90983ba73dad1c66bf2f"/></dir><dir name="button"><file name="arrow.gif" hash="44b6dbf385236a2697932a7a3e20b4a0"/><file name="btn.gif" hash="40ac871755023cc11ad15dcd77b54dbf"/><file name="group-cs.gif" hash="5dc0252bd9ecf72f98d858427054cf08"/><file name="group-lr.gif" hash="cb7813012d6be17e083835d60037029e"/><file name="group-tb.gif" hash="4edf9b7db13b1331282eed298384cab9"/><file name="s-arrow-b-noline.gif" hash="30d04f652551f1df9d59d33a99c9a320"/><file name="s-arrow-b.gif" hash="a957a6d618d19b92a2d1a7a1b50f5235"/><file name="s-arrow-bo.gif" hash="53a15d7907a017122f7f60402c435753"/><file name="s-arrow-light.gif" hash="6576de0eb6bec88f8e37c12829939573"/><file name="s-arrow-noline.gif" hash="13f08a275c58135365b8e58b3177ab1a"/><file name="s-arrow-o.gif" hash="5005d8dea2f9456aaf2ab27ca7bf5651"/><file name="s-arrow.gif" hash="bc71296ddf9c7ef5aa56b09ca3512c8a"/></dir><dir name="datepicker"><file name="datepicker-footer-bg.gif" hash="52e65759b3e8c81d3c3f2d0484ec9e58"/><file name="datepicker-footer-bg.png" hash="deca7c712da61f827c61b6219b3246af"/><file name="datepicker-header-bg.gif" hash="5cda0bb28a42b7023d24d48b9a0e1685"/><file name="datepicker-header-bg.png" hash="93fb8e8f1fb52d38e61ab064187f11de"/></dir><dir name="dd"><file name="drop-add.gif" hash="95eb34ac70a1a3c95ef39ab826a89491"/><file name="drop-no.gif" hash="ae536c37391ba78143b5c8283cec8d13"/><file name="drop-yes.gif" hash="f3216326c00890259e84f1726dd1043f"/></dir><dir name="editor"><file name="tb-sprite.gif" hash="a2f06caddc2fb729db5cbbd874491128"/></dir><dir name="form"><file name="checkbox.gif" hash="75d685cab5665a935660a3d04f71c2be"/><file name="clear-trigger.gif" hash="97b3e5e9edf27b50d63d48098c2f1eae"/><file name="date-trigger.gif" hash="30b5bace9f3dac358716c1415270f874"/><file name="error-tip-corners.gif" hash="364474276178c7b48b6270056b42b808"/><file name="exclamation.gif" hash="37dbe02e3cbde0f6780650bfd8535e38"/><file name="radio.gif" hash="0239bdaef529be68530b86266a24742c"/><file name="search-trigger.gif" hash="559ef372cf27a38678d84e8c0b7237fc"/><file name="spinner-small.gif" hash="122ab763adfc5f379def95269889a876"/><file name="spinner.gif" hash="eee2bdd07a8136d2eff635b721838b4c"/><file name="text-bg.gif" hash="d5ba54c1f417e6a72cbce8b909078727"/><file name="trigger-square.gif" hash="c1cbaecc91209f77e2d20235c137e13e"/><file name="trigger-tpl.gif" hash="d7be20f0dc38f4f46cd318fe32cf3ce3"/><file name="trigger.gif" hash="447d5b600f7527f5c8cc49e7453bbb27"/></dir><dir name="grid"><file name="arrow-left-white.gif" hash="b04e859bdcbd21ad1f06b8bfa7881df8"/><file name="arrow-right-white.gif" hash="714eb00f8134dde3a65c83f3f71ad2c4"/><file name="cell-special-bg.gif" hash="60b05fd8cd98b6109112775a4cf2ad0e"/><file name="cell-special-bg.png" hash="a6487b6bd88ce1a726d41140595235be"/><file name="cell-special-selected-bg.gif" hash="2d4830861beacb8945d22b3bb79ad9c2"/><file name="cell-special-selected-bg.png" hash="df8d68826afb17ab5ed333565f531fdf"/><file name="checked.gif" hash="cb7b3408df56f5585aaa1242cd2f0b45"/><file name="col-move-bottom.gif" hash="9c38bcb5cee1dc9b4ce64ad9ab1386f8"/><file name="col-move-top.gif" hash="c4584202d5172464050f675d396d1c6f"/><file name="column-header-bg.gif" hash="1c0619ef4faf05d33d53e46f164664d0"/><file name="column-header-bg.png" hash="2c8e36b59e78fe93fcc13360bebd7f7f"/><file name="column-header-over-bg.gif" hash="8af4b32e4a033f3ac980277efee1d0b2"/><file name="column-header-over-bg.png" hash="25da418192d7f8bb7fbacc3baf6731fb"/><file name="columns.gif" hash="ef35242fa6514a81d17d5f700f561b7c"/><file name="dd-insert-arrow-left.gif" hash="fee4ee1bfc31c909a83713656497c8b2"/><file name="dd-insert-arrow-left.png" hash="5050c8e897cec907d6319f397a66c474"/><file name="dd-insert-arrow-right.gif" hash="b03355f58b96d167f0770b14358e5d88"/><file name="dd-insert-arrow-right.png" hash="46faba03ba3a35d750b5b758cc3d5d2c"/><file name="dirty.gif" hash="decca3b96e2c37cf6eb04ddb0d9f669b"/><file name="done.gif" hash="365266930a93451414fe51ffc524a196"/><file name="drop-no.gif" hash="b53ca86d60fbcc7a45c8917299218bfd"/><file name="drop-yes.gif" hash="af96f4c3b32a470db2f38abb521b5c97"/><file name="footer-bg.gif" hash="65ed63e44c6149f1127ad3b4be4e0108"/><file name="grid-blue-hd.gif" hash="dd35d5c1202c440c2d1a945b335984d3"/><file name="grid-blue-split.gif" hash="0494ba49974ff2bc1bf81e1d82dfee18"/><file name="grid-hrow.gif" hash="55972a5063d80f35fb6b95a79bb0018a"/><file name="grid-loading.gif" hash="9ac6f737eb9b15272f12b00bfeb3c3c6"/><file name="grid-split.gif" hash="3ef419d4b9421d8e94f673a6238dc4c0"/><file name="grid-vista-hd.gif" hash="675f403e8a9cb5ab4bed725da9fe2023"/><file name="grid3-hd-btn.gif" hash="e3e77072c16a6b27556236961f29c552"/><file name="grid3-hrow-over.gif" hash="a92d8f6c106943995720f2884634670e"/><file name="grid3-hrow.gif" hash="3e4484ea8db10af1320808c8477346ea"/><file name="grid3-rowheader.gif" hash="b4491705564909da7f9eaf749dbbfbb1"/><file name="group-by.gif" hash="3ff8c5936e358cf213227509c9bee95a"/><file name="group-collapse.gif" hash="fd6a72ffa784170d83f9f13322266ca8"/><file name="group-expand-sprite.gif" hash="d0f614a387292177f3acb0c95a4cd760"/><file name="group-expand.gif" hash="8a9ad3ed3d74c2911b7f101268a1843b"/><file name="hd-pop.gif" hash="e5f27a2f68cc2d13b11cf41c46d298dc"/><file name="hmenu-asc.gif" hash="048e0bc30f7c39d473dad5dabcbe03f2"/><file name="hmenu-desc.gif" hash="f0a987b34b003b25a7c82624d41f018a"/><file name="hmenu-lock.gif" hash="bcef18e25342c69c37c44dab87086065"/><file name="hmenu-lock.png" hash="2a3b0b441834f443c1086930939efdae"/><file name="hmenu-unlock.gif" hash="8cc8205dafa587ef02d8a86903ae8074"/><file name="hmenu-unlock.png" hash="c1f61df70b98c5498ea81e7e7b9effbb"/><file name="invalid_line.gif" hash="04a88e97b56e8a8ece4a66d49cc78828"/><file name="loading.gif" hash="00ef871b291bc03a497d608a5bd8ec99"/><file name="mso-hd.gif" hash="37fba9c02f0eefe57f655890eef1c4a1"/><file name="nowait.gif" hash="23c91166dbb16ba8655363321bf5a400"/><file name="page-first-disabled.gif" hash="8d3185028c541cbcce67b5909c04824e"/><file name="page-first.gif" hash="16ec00fa770d860b768cf5034ddfca96"/><file name="page-last-disabled.gif" hash="1d123237ceeb5109a1b9274f0cf19d73"/><file name="page-last.gif" hash="ef524dd0b8dfe4eefecffaa1c0bb8edd"/><file name="page-next-disabled.gif" hash="0f4b8681772c91921fa93ede9c755ea0"/><file name="page-next.gif" hash="f6f9d2209dfc99912ffc9848d97646db"/><file name="page-prev-disabled.gif" hash="eefcbed15c8d37a89618b08f7b224297"/><file name="page-prev.gif" hash="80daad880483eed682b22ec70514ecc4"/><file name="pick-button.gif" hash="b431fdf306f1e2f033d0a431996de93f"/><file name="property-cell-bg.gif" hash="1b65e348d6db0c7b6c9aa5478c15a052"/><file name="property-cell-selected-bg.gif" hash="a94039f89dec164896ceff1fbdf6dbc5"/><file name="refresh-disabled.gif" hash="105c62973ba69710bc2b41b443af5198"/><file name="refresh.gif" hash="f1a2e7df30394c5a30bc76c2d09013b7"/><file name="row-check-sprite.gif" hash="2d0aa7e501c3e6f97a97faf75e35d3c3"/><file name="row-expand-sprite.gif" hash="be81199d9d4fa69bef47a8f036a5a7d8"/><file name="row-over.gif" hash="f639094bd0560aefabc86e51a825f23d"/><file name="row-sel.gif" hash="ca87d6b950386edd5e17c985769d9101"/><file name="sort-hd.gif" hash="2640addef6e987b4c5dfa4c8c2dfb10c"/><file name="sort_asc.gif" hash="2352874b5f636ca331fe9509a2f9bdd7"/><file name="sort_desc.gif" hash="d104fcf119d40c51554ddb8b377142e5"/><file name="unchecked.gif" hash="31846118bddc7945b595ea2090589cf1"/><file name="wait.gif" hash="b0cd5a5dc070c705ebf8814a909802c3"/></dir><dir name="layout"><file name="mini-bottom.gif" hash="ae8e3674fd32997dc5217d5d6199a5a5"/><file name="mini-left.gif" hash="8654fdb45ecf4406af2fce1d3beb7596"/><file name="mini-right.gif" hash="cbdf9fb0c45466b4217ac9f7bd6a9ed4"/><file name="mini-top.gif" hash="fbd91e98576f66fd2702495251b15240"/></dir><dir name="menu"><file name="checked.gif" hash="cb7b3408df56f5585aaa1242cd2f0b45"/><file name="group-checked.gif" hash="f7973443d91e5e074013f1b07ee79479"/><file name="item-over.gif" hash="29055ede2ff0584d0374a2ff5a987382"/><file name="menu-item-active-bg.gif" hash="5956b7cac9aabf4c670c2997bba12d47"/><file name="menu-item-active-corners.gif" hash="9a073e133a65c4e1b3bd4098ca72552a"/><file name="menu-item-active-sides.gif" hash="cf1981c1027a8c962a9d8c0f6d61c098"/><file name="menu-parent.gif" hash="d303ad7e3ced891736e80f77e1d4e51d"/><file name="menu.gif" hash="ae128d5f3f3a39213f3d4e23aec8728f"/><file name="unchecked.gif" hash="31846118bddc7945b595ea2090589cf1"/></dir><dir name="progress"><file name="progress-default-bg.gif" hash="b170dfad9f747e1aca54e47c4415c2d3"/></dir><dir name="shared"><file name="blue-loading.gif" hash="dc2fd7c0ed853c56b4ac65710af3bd0a"/><file name="calendar.gif" hash="81296cff1f97f5365524f2b9dcf626da"/><file name="glass-bg.gif" hash="bc2cd5c5ac9b3874d956c892d23f2119"/><file name="hd-sprite.gif" hash="6a54ae98bef53397d52282201852c204"/><file name="icon-error.gif" hash="f477b54b6b8361362e96c2218dce7ea0"/><file name="icon-info.gif" hash="ec6b7a5d4caeea767c8674689bae47c6"/><file name="icon-question.gif" hash="2713644a8aa582728d71e35eca62fbcd"/><file name="icon-warning.gif" hash="3f20258272af0e00f6b7531b3b9aee35"/><file name="large-loading.gif" hash="d96f6517e00399c37a9765e045eaaf22"/><file name="left-btn.gif" hash="6bf30c6cf0b5d70436c3e463b5532b35"/><file name="loading-balls.gif" hash="ac062b94ed674aaa50a6c18df92acdf3"/><file name="right-btn.gif" hash="e7ad3a7f4814791cecf1b90e77e9e139"/><file name="shadow-c.png" hash="7ab6163237099f2529452b88953a4049"/><file name="shadow-lr.png" hash="986270d8ab4330fa7499dc33ed135598"/><file name="shadow.png" hash="860bf4f690d2ea2aba7b11500925da62"/><file name="warning.gif" hash="448dc934a7f0dd6092b51f88a1e47b2d"/></dir><dir name="sizer"><file name="e-handle-dark.gif" hash="b86289f41d7ad1a7401dd2b2a9b3c3d8"/><file name="e-handle.gif" hash="510edc95ebaa36306916c50ca10596f7"/><file name="ne-handle-dark.gif" hash="115f71b851c7f0b5f354caa7b8dfff15"/><file name="ne-handle.gif" hash="8e268b962dc909d275997b572ff17a72"/><file name="nw-handle-dark.gif" hash="4a361e6920b2e34a39fd425a515c83b9"/><file name="nw-handle.gif" hash="1120600505249c38c3d1cc2ab120cd13"/><file name="s-handle-dark.gif" hash="4a6bf15d308a4ae580dd03cbd431a95c"/><file name="s-handle.gif" hash="5e3338cb09e9df7f52383d6b1423fc86"/><file name="se-handle-dark.gif" hash="f3d8d8aac23e3e9633072e2366cda847"/><file name="se-handle.gif" hash="71edc3f63f79f447d2c81ee09e1fbbc3"/><file name="square.gif" hash="4431ea1954bfd2a9cea0931f07fc7ffa"/><file name="sw-handle-dark.gif" hash="44b2400d873cf8a23d84424827cde44d"/><file name="sw-handle.gif" hash="c3e0befc4208a51180344765fd7deeda"/></dir><dir name="slider"><file name="slider-bg.gif" hash="a6286f74e6de7414663483aa08305a2f"/><file name="slider-bg.png" hash="1fbffa04044bed9262836d2a710f9ee1"/><file name="slider-thumb.gif" hash="e8b6ac40fa2709692ed0d806ef90b0c3"/><file name="slider-thumb.png" hash="24a893c9606f3a6892eb62f29a08870c"/><file name="slider-v-bg.gif" hash="9d8e5f0a4afa0e2256b999c856ba1a9e"/><file name="slider-v-bg.png" hash="0682c28925a7296730f7f221e4a76b96"/><file name="slider-v-thumb.gif" hash="c871f735637e1c383862aacecabb554a"/><file name="slider-v-thumb.png" hash="2fc3430dc351d9a118e048b9aafb7c3c"/></dir><dir name="tab-bar"><file name="scroll-left.gif" hash="611cea625f98ee5c0204dc186da8a05e"/><file name="scroll-right.gif" hash="b31b5bb81129aa52755f7f0becedc624"/><file name="tab-bar-default-bg.gif" hash="d8e4c911af8cf8660fd598b0a004fbb4"/></dir><dir name="tip"><file name="tip-corners.gif" hash="679a8fd0e2d9aa18fedc2f2b4f6001bc"/><file name="tip-sides.gif" hash="f9f434277b451d60474db8756a506736"/></dir><dir name="toolbar"><file name="more.gif" hash="15c7a30d4131305b672fe1e76d962d4d"/><file name="scroll-left.gif" hash="90ed293465f6f6bbb6104e9285f60392"/><file name="scroll-right.gif" hash="086497e95d820d7c58a1be2293e6e4a6"/><file name="toolbar-default-bg.gif" hash="61b9dcfa93a445a8a7dbbfde6efd5ecf"/></dir><dir name="tools"><file name="tool-sprite-tpl.gif" hash="e0449768cd5dce80b18fac904818ab33"/><file name="tool-sprites.gif" hash="75106d9a5ffab255a5bb3792a2a16e16"/><file name="tools-sprites-trans.gif" hash="8331513f15bd26be38974a7d7fc4ee41"/></dir><dir name="tree"><file name="arrows.gif" hash="bd4ecad4870c5b23926742ddd1298584"/><file name="drop-above.gif" hash="d6b303cfa3de8784057d9d7e66cdaa86"/><file name="drop-add.gif" hash="95eb34ac70a1a3c95ef39ab826a89491"/><file name="drop-append.gif" hash="95eb34ac70a1a3c95ef39ab826a89491"/><file name="drop-below.gif" hash="55e5dbc9451cfa91423832260b0753aa"/><file name="drop-between.gif" hash="edb544a0de58547d4a39c526e06e3c82"/><file name="drop-no.gif" hash="67f83ea04a2eb1c50614a96faf625f25"/><file name="drop-over.gif" hash="d6b303cfa3de8784057d9d7e66cdaa86"/><file name="drop-under.gif" hash="55e5dbc9451cfa91423832260b0753aa"/><file name="drop-yes.gif" hash="f3216326c00890259e84f1726dd1043f"/><file name="elbow-end-minus-nl.gif" hash="04025031365f2bdb09169188eae9556b"/><file name="elbow-end-minus.gif" hash="b4ae35ce75b5bbe728fdeeb5ed89ac42"/><file name="elbow-end-plus-nl.gif" hash="d6343055539d3ae503329e65d0927c0d"/><file name="elbow-end-plus.gif" hash="46f4d75f43fff6fcd4b0b9aeda907e9c"/><file name="elbow-end.gif" hash="6748722c117147e321d0af952833109e"/><file name="elbow-line.gif" hash="765c70e58be8064da7ce8c01afb1f6c3"/><file name="elbow-minus-nl.gif" hash="04025031365f2bdb09169188eae9556b"/><file name="elbow-minus.gif" hash="01359f5b57c066f952c1d5a02f21a457"/><file name="elbow-plus-nl.gif" hash="d6343055539d3ae503329e65d0927c0d"/><file name="elbow-plus.gif" hash="e4385b53e7f15b43b74e9c3b46cfee77"/><file name="elbow.gif" hash="53321708a4948539bb8b4c8efeae39c7"/><file name="folder-open.gif" hash="2bf2623696392abc9b2853b59aab3bb5"/><file name="folder.gif" hash="d15144420ee39843bb27feb014ee4442"/><file name="leaf.gif" hash="23757d6e353f343e3c7edfe28428f198"/><file name="loading.gif" hash="00ef871b291bc03a497d608a5bd8ec99"/><file name="s.gif" hash="fc94fb0c3ed8a8f909dbc7630a0987ff"/></dir><dir name="util"><dir name="splitter"><file name="mini-bottom.gif" hash="ae8e3674fd32997dc5217d5d6199a5a5"/><file name="mini-left.gif" hash="8654fdb45ecf4406af2fce1d3beb7596"/><file name="mini-right.gif" hash="cbdf9fb0c45466b4217ac9f7bd6a9ed4"/><file name="mini-top.gif" hash="fbd91e98576f66fd2702495251b15240"/></dir></dir></dir></dir><file name="dnd_grid_to_grid.js" hash="057a8cbf8b255c1955c83ca249bd9ae8"/><file name="examples.js" hash="c34c39a3da1b2216f636778b26e10108"/><file name="ext-all.js" hash="33c8a2191d27ee2812d9e5469f094556"/></dir><dir name="jquery"><file name="jquery.min.js" hash="4c8cfcfcda2e9d34ba0097086a7bc328"/></dir><dir name="resources"><dir name="css"><file name="README.txt" hash="66440774774ca4995ad5137ac9ae48e0"/><file name="basic-dialog.css" hash="4cc973c87f79ea230f372cea597963ba"/><file name="box.css" hash="3809db7ee254d629d52dba0aad472d35"/><file name="button.css" hash="d3f29c8497579832fe5d7aafff7c3544"/><file name="combo.css" hash="483a1a701ca9c7db718e0e767f3d4585"/><file name="core.css" hash="6e82710d5206b6b7c0f70399cf649449"/><file name="date-picker.css" hash="fa68b668561d477e702318fb5d59636c"/><file name="dd.css" hash="f0e5f55969aeda8f65a01033613181c5"/><file name="debug.css" hash="6ef466c0c857e0c405cac7b8911f0824"/><file name="editor.css" hash="2fdb75e85a247c362285d4f079c0a12f"/><file name="ext-all.css" hash="c5e12af950c3ea3a243d0b9ca0dc4dba"/><file name="form.css" hash="38bd5bd602a83075325696af2c447e65"/><file name="grid.css" hash="c6d110f89542c04e4cbf98de73e97e9b"/><file name="layout.css" hash="89251906d248b3756f0ed354491651a6"/><file name="menu.css" hash="88eb8b3754612496ccf9d386694a39e0"/><file name="panel.css" hash="deaf7ccb5526687fadd67c093da9e604"/><file name="qtips.css" hash="2a6e683a7b23cbdf52177d7141d17435"/><file name="reset-min.css" hash="8fddbb1b7930f2817f2d5d215be98d5f"/><file name="resizable.css" hash="a50b8d1ea8e9dfbdd101a43bc63857c3"/><file name="tabs.css" hash="323d6f11f1550a43a02a617e39242ed5"/><file name="toolbar.css" hash="d09eb7507f57178967d217caeaa8b046"/><file name="tree.css" hash="b0104f954fbe1f04ebf49acffcec74ef"/><file name="ytheme-aero.css" hash="c25b48ba1b913f2ea094065fa916e9da"/><file name="ytheme-galdaka.css" hash="8b1917749205e64bdbcecc893e188b09"/><file name="ytheme-gray.css" hash="c45ba874b89038c9c8d9a79a1c591f26"/><file name="ytheme-magento.css" hash="94c3fc72743ad6d1fe7d8e74d713750e"/><file name="ytheme-vista.css" hash="2092ef97154cf5f6b33893bf5e178e21"/></dir><dir name="themes"><dir name="images"><dir name="default"><dir name="basic-dialog"><file name="btn-arrow.gif" hash="9e2365ef98c6096f6b5f411ab618bb4e"/><file name="btn-sprite.gif" hash="73a8327c23c12ed9ec42ac8f52b072e0"/><file name="close.gif" hash="2d54069e9355f295dd27027f7f779eb9"/><file name="collapse.gif" hash="63b2687a2dc81537765a7d22f9e480da"/><file name="e-handle.gif" hash="f9357e6c1dfbd00da007cf6705e08225"/><file name="expand.gif" hash="740af52fb7de6ca9fd888184e86a5308"/><file name="hd-sprite.gif" hash="6a54ae98bef53397d52282201852c204"/><file name="progress.gif" hash="baff9a083b93588fa7ff3548844a9e1a"/><file name="progress2.gif" hash="339036f9eb530c1b180c77f9a109ef3e"/><file name="s-handle.gif" hash="36b90844c0b35da23da21aac599957d4"/><file name="se-handle.gif" hash="668b22581100befcf947e806599dc0ce"/></dir><dir name="box"><file name="corners-blue.gif" hash="86fd4c5664e0971bfc11959e8442604c"/><file name="corners.gif" hash="d2d1bc2085b369ce35ffd20c0121676e"/><file name="l-blue.gif" hash="ced9ffbf66ea39e77083a591f8257267"/><file name="l.gif" hash="c4d9dbbdc59ae06b5e9e72a6a865c981"/><file name="r-blue.gif" hash="82dbb522a80e3246f6297719371a9494"/><file name="r.gif" hash="bf1e1d4a45f951ae656968a8c834f04a"/><file name="tb-blue.gif" hash="7c4b19eb682afdc1bde0640d2321fb25"/><file name="tb.gif" hash="dd3f63afe7ba90983ba73dad1c66bf2f"/></dir><dir name="dd"><file name="drop-add.gif" hash="95eb34ac70a1a3c95ef39ab826a89491"/><file name="drop-no.gif" hash="ae536c37391ba78143b5c8283cec8d13"/><file name="drop-yes.gif" hash="f3216326c00890259e84f1726dd1043f"/></dir><dir name="editor"><file name="tb-sprite.gif" hash="8908365d736426795ce46de7e328b508"/></dir><dir name="form"><file name="clear-trigger.gif" hash="97b3e5e9edf27b50d63d48098c2f1eae"/><file name="date-trigger.gif" hash="9245675ed8931df277184b419cf4cdad"/><file name="error-tip-corners.gif" hash="364474276178c7b48b6270056b42b808"/><file name="exclamation.gif" hash="40491021e901fa801dbbc09b6c59d73e"/><file name="search-trigger.gif" hash="559ef372cf27a38678d84e8c0b7237fc"/><file name="text-bg.gif" hash="d5ba54c1f417e6a72cbce8b909078727"/><file name="trigger-tpl.gif" hash="d7be20f0dc38f4f46cd318fe32cf3ce3"/><file name="trigger.gif" hash="45019efdf75528242c5a68742821dc57"/></dir><file name="gradient-bg.gif" hash="e117fca9d088e4cd5bbbcec7b99a8408"/><dir name="grid"><file name="Thumbs.db" hash="c3affff39ba36b80da43a08c34a61391"/><file name="arrow-left-white.gif" hash="b04e859bdcbd21ad1f06b8bfa7881df8"/><file name="arrow-right-white.gif" hash="714eb00f8134dde3a65c83f3f71ad2c4"/><file name="col-move-bottom.gif" hash="9c38bcb5cee1dc9b4ce64ad9ab1386f8"/><file name="col-move-top.gif" hash="c4584202d5172464050f675d396d1c6f"/><file name="dirty.gif" hash="decca3b96e2c37cf6eb04ddb0d9f669b"/><file name="done.gif" hash="365266930a93451414fe51ffc524a196"/><file name="drop-no.gif" hash="b53ca86d60fbcc7a45c8917299218bfd"/><file name="drop-yes.gif" hash="af96f4c3b32a470db2f38abb521b5c97"/><file name="footer-bg.gif" hash="65ed63e44c6149f1127ad3b4be4e0108"/><file name="grid-blue-hd.gif" hash="dd35d5c1202c440c2d1a945b335984d3"/><file name="grid-blue-split.gif" hash="0494ba49974ff2bc1bf81e1d82dfee18"/><file name="grid-hrow.gif" hash="55972a5063d80f35fb6b95a79bb0018a"/><file name="grid-loading.gif" hash="9ac6f737eb9b15272f12b00bfeb3c3c6"/><file name="grid-split.gif" hash="3ef419d4b9421d8e94f673a6238dc4c0"/><file name="grid-vista-hd.gif" hash="675f403e8a9cb5ab4bed725da9fe2023"/><file name="grid3-hd-btn.gif" hash="e3e77072c16a6b27556236961f29c552"/><file name="grid3-hrow-over.gif" hash="a92d8f6c106943995720f2884634670e"/><file name="grid3-hrow.gif" hash="4c58074bb961c8f184522355f1b0eb90"/><file name="grid3-special-col-bg.gif" hash="c9df03a1c107360128da89fa47066405"/><file name="grid3-special-col-sel-bg.gif" hash="a94039f89dec164896ceff1fbdf6dbc5"/><file name="hd-pop.gif" hash="e5f27a2f68cc2d13b11cf41c46d298dc"/><file name="hmenu-asc.gif" hash="048e0bc30f7c39d473dad5dabcbe03f2"/><file name="hmenu-desc.gif" hash="f0a987b34b003b25a7c82624d41f018a"/><file name="hmenu-lock.gif" hash="bcef18e25342c69c37c44dab87086065"/><file name="hmenu-lock.png" hash="2a3b0b441834f443c1086930939efdae"/><file name="hmenu-unlock.gif" hash="8cc8205dafa587ef02d8a86903ae8074"/><file name="hmenu-unlock.png" hash="c1f61df70b98c5498ea81e7e7b9effbb"/><file name="invalid_line.gif" hash="04a88e97b56e8a8ece4a66d49cc78828"/><file name="loading.gif" hash="00ef871b291bc03a497d608a5bd8ec99"/><file name="mso-hd.gif" hash="37fba9c02f0eefe57f655890eef1c4a1"/><file name="nowait.gif" hash="23c91166dbb16ba8655363321bf5a400"/><file name="page-first-disabled.gif" hash="8d3185028c541cbcce67b5909c04824e"/><file name="page-first.gif" hash="16ec00fa770d860b768cf5034ddfca96"/><file name="page-last-disabled.gif" hash="1d123237ceeb5109a1b9274f0cf19d73"/><file name="page-last.gif" hash="ef524dd0b8dfe4eefecffaa1c0bb8edd"/><file name="page-next-disabled.gif" hash="0f4b8681772c91921fa93ede9c755ea0"/><file name="page-next.gif" hash="f6f9d2209dfc99912ffc9848d97646db"/><file name="page-prev-disabled.gif" hash="eefcbed15c8d37a89618b08f7b224297"/><file name="page-prev.gif" hash="80daad880483eed682b22ec70514ecc4"/><file name="pick-button.gif" hash="b431fdf306f1e2f033d0a431996de93f"/><file name="refresh.gif" hash="8dae08d3581dcd9a04ca73877eab4b53"/><file name="row-check-sprite.gif" hash="2d0aa7e501c3e6f97a97faf75e35d3c3"/><file name="row-expand-sprite.gif" hash="be81199d9d4fa69bef47a8f036a5a7d8"/><file name="row-over.gif" hash="f639094bd0560aefabc86e51a825f23d"/><file name="row-sel.gif" hash="ca87d6b950386edd5e17c985769d9101"/><file name="sort_asc.gif" hash="cc186187e31b0c39abbb7d2394916292"/><file name="sort_desc.gif" hash="fcfe91243fac2e5f24d05bb44f78ded4"/><file name="wait.gif" hash="b0cd5a5dc070c705ebf8814a909802c3"/></dir><dir name="layout"><file name="collapse.gif" hash="dfcec0803d488a783916c750fd83a897"/><file name="expand.gif" hash="c9c9b0ea5311c3dc016c69dc234912bc"/><file name="gradient-bg.gif" hash="e117fca9d088e4cd5bbbcec7b99a8408"/><file name="ns-collapse.gif" hash="efa9fbd7a1f3f0f1f22360391e16126f"/><file name="ns-expand.gif" hash="da1f9d40c091d3b6dc7a8dee4fc02ac6"/><file name="panel-close.gif" hash="b185da1837344529bfb684a96d8371b5"/><file name="panel-title-bg.gif" hash="b66384c309a397963389a76b07e9ecd4"/><file name="panel-title-light-bg.gif" hash="688d3a263442db125da170e5d3aebf70"/><file name="stick.gif" hash="be9e67ae0b61b01cfd15928ca7a3da51"/><file name="stuck.gif" hash="745e0cacb51250ea0216efc4a1cb50cb"/><file name="tab-close-on.gif" hash="0ae2c978e85391a69f0dce8da18d8b23"/><file name="tab-close.gif" hash="f92107cc6b4cb78af084648a628e01d2"/></dir><dir name="menu"><file name="checked.gif" hash="692bc97badf50c05495f6109143b4b11"/><file name="group-checked.gif" hash="f7973443d91e5e074013f1b07ee79479"/><file name="menu-parent.gif" hash="d303ad7e3ced891736e80f77e1d4e51d"/><file name="menu.gif" hash="5d34732294bbe06a862961dd02bcc962"/><file name="unchecked.gif" hash="9b90ed7c9e8f0892ce09f3b35b19db53"/></dir><dir name="panel"><file name="corners-sprite.gif" hash="06daef2335218cdfd900ce8bf7a68738"/><file name="left-right.gif" hash="49344fefef7c6f866f910b9067f0990f"/><file name="tool-sprite-tpl.gif" hash="e0449768cd5dce80b18fac904818ab33"/><file name="tool-sprites.gif" hash="31ccd74ac8dab4b5669887310a2341df"/><file name="top-bottom.gif" hash="d9a86e8466a31bd1cb87aae2cf55faf2"/><file name="white-corners-sprite.gif" hash="de8b3036676d19b9635f319a8a4aad36"/><file name="white-left-right.gif" hash="77a6389c6737ad507ca5330ad8816524"/><file name="white-top-bottom.gif" hash="f865d7237bff3c45fd4a8c448f97d236"/></dir><dir name="qtip"><file name="bg.gif" hash="49c0a530cc16357bb39d51c13065a88f"/><file name="close.gif" hash="0379d036250096cae2e42b427b3df2e7"/><file name="tip-sprite.gif" hash="11637a20b1f3f2331bf0627146c2f433"/></dir><file name="s.gif" hash="fc94fb0c3ed8a8f909dbc7630a0987ff"/><file name="shadow-c.png" hash="3abbfce345687daada53445adf6fddc7"/><file name="shadow-lr.png" hash="986270d8ab4330fa7499dc33ed135598"/><file name="shadow.png" hash="860bf4f690d2ea2aba7b11500925da62"/><dir name="shared"><file name="calendar.gif" hash="81296cff1f97f5365524f2b9dcf626da"/><file name="glass-bg.gif" hash="bc2cd5c5ac9b3874d956c892d23f2119"/><file name="left-btn.gif" hash="6bf30c6cf0b5d70436c3e463b5532b35"/><file name="right-btn.gif" hash="e7ad3a7f4814791cecf1b90e77e9e139"/><file name="warning.gif" hash="448dc934a7f0dd6092b51f88a1e47b2d"/></dir><dir name="sizer"><file name="e-handle-dark.gif" hash="b86289f41d7ad1a7401dd2b2a9b3c3d8"/><file name="e-handle.gif" hash="510edc95ebaa36306916c50ca10596f7"/><file name="ne-handle-dark.gif" hash="115f71b851c7f0b5f354caa7b8dfff15"/><file name="ne-handle.gif" hash="8e268b962dc909d275997b572ff17a72"/><file name="nw-handle-dark.gif" hash="4a361e6920b2e34a39fd425a515c83b9"/><file name="nw-handle.gif" hash="1120600505249c38c3d1cc2ab120cd13"/><file name="s-handle-dark.gif" hash="4a6bf15d308a4ae580dd03cbd431a95c"/><file name="s-handle.gif" hash="5e3338cb09e9df7f52383d6b1423fc86"/><file name="se-handle-dark.gif" hash="f3d8d8aac23e3e9633072e2366cda847"/><file name="se-handle.gif" hash="71edc3f63f79f447d2c81ee09e1fbbc3"/><file name="square.gif" hash="4431ea1954bfd2a9cea0931f07fc7ffa"/><file name="sw-handle-dark.gif" hash="44b2400d873cf8a23d84424827cde44d"/><file name="sw-handle.gif" hash="c3e0befc4208a51180344765fd7deeda"/></dir><dir name="tabs"><file name="tab-btm-inactive-left-bg.gif" hash="4f141a6abf25d3c9409b6c381333c138"/><file name="tab-btm-inactive-right-bg.gif" hash="eb2423d3b9dd072976ce955ab0c683d6"/><file name="tab-btm-left-bg.gif" hash="a36eb9382ed8b858eff2c5d4e5d7011a"/><file name="tab-btm-right-bg.gif" hash="9e4245776f0f7b6b6c7ddbf40a43103a"/><file name="tab-sprite.gif" hash="6a7d481bf5b74acfbfa0b01a35bd6620"/></dir><dir name="toolbar"><file name="btn-arrow-light.gif" hash="fa49b39a0fd88ef26264da44a2b4edea"/><file name="btn-arrow.gif" hash="12bda29a4c8016cfa047e852c4353f59"/><file name="btn-over-bg.gif" hash="faddf9b24cefa721326ba3f87f3ef31f"/><file name="gray-bg.gif" hash="cf2d9408f320e696e607d8472afa7ff0"/><file name="tb-bg.gif" hash="5309337fd7a22cab9d9467fd9eaa0a0c"/><file name="tb-btn-sprite.gif" hash="3aed28dd646d22e215c8a6a3e983322f"/></dir><dir name="tree"><file name="drop-add.gif" hash="95eb34ac70a1a3c95ef39ab826a89491"/><file name="drop-between.gif" hash="edb544a0de58547d4a39c526e06e3c82"/><file name="drop-no.gif" hash="67f83ea04a2eb1c50614a96faf625f25"/><file name="drop-over.gif" hash="d6b303cfa3de8784057d9d7e66cdaa86"/><file name="drop-under.gif" hash="55e5dbc9451cfa91423832260b0753aa"/><file name="drop-yes.gif" hash="f3216326c00890259e84f1726dd1043f"/><file name="elbow-end-minus-nl.gif" hash="5e5bffba157eceee7989db95b919e4d5"/><file name="elbow-end-minus.gif" hash="a469f6a4394d797c2efeffc70409f6db"/><file name="elbow-end-plus-nl.gif" hash="f0f50c0dd3ee6dd4b11c1f245b36eb01"/><file name="elbow-end-plus.gif" hash="ec1482391363612d9e5f8c7087fddaba"/><file name="elbow-end.gif" hash="345551384aa325189ba28a1c20f3405e"/><file name="elbow-line.gif" hash="90e478158df476dc989a60daaafc87e6"/><file name="elbow-minus-nl.gif" hash="5e5bffba157eceee7989db95b919e4d5"/><file name="elbow-minus.gif" hash="71bb1bd44b1274c60d30dba1de472ed7"/><file name="elbow-plus-nl.gif" hash="f0f50c0dd3ee6dd4b11c1f245b36eb01"/><file name="elbow-plus.gif" hash="945572d06a74b5f952251a86c595f2da"/><file name="elbow.gif" hash="27679f3b1222ba95d9925885d7d82d02"/><file name="folder-open.gif" hash="c569141d6ae7c61d838ed8af26aa9380"/><file name="folder.gif" hash="b7209740bb4a825a06beb8698d92c2b1"/><file name="leaf.gif" hash="23757d6e353f343e3c7edfe28428f198"/><file name="loading.gif" hash="00ef871b291bc03a497d608a5bd8ec99"/><file name="s.gif" hash="fc94fb0c3ed8a8f909dbc7630a0987ff"/></dir><dir name="window"><file name="corners-sprite.gif" hash="b485d6e69678822a0fb77cc312487874"/><file name="left-right.gif" hash="3fe626d6ca2f71d36fc62c32cb1cc52a"/><file name="top-bottom.gif" hash="8a227016c401438e602c2f770a611d5b"/></dir></dir><dir name="magento"><dir name="basic-dialog"><file name="collapse-on.gif" hash="b60dfdc0d00cfb30a8a622e0c22eed84"/><file name="collapse.gif" hash="8525b9d2e93d31e0b071b1f9bf9550e5"/><file name="expand-on.gif" hash="0dfb4ac6d626cdcaa931c14dbb45848e"/><file name="expand.gif" hash="0eb5c03da8b8415e0568784c959e536a"/><file name="hd-sprite.gif" hash="035bf2296afd70af7020cf06b60bf3f6"/><file name="ns-collapse-on.gif" hash="88ed8b7578c803f68d9f1eb171454e00"/><file name="ns-collapse.gif" hash="44b91376c040f91672aaa98c1fcc062b"/><file name="ns-expand-on.gif" hash="587c2ce90066280e5e6cd731bb9d346c"/><file name="ns-expand.gif" hash="57b479b168f8a54200bd1770b5591630"/><file name="panel_close.gif" hash="686c6dfcf341de25487ab4d8ea5954ce"/><file name="pop_close.gif" hash="dd3605531f9959901eff6f089f084bdc"/><file name="pop_collapse.gif" hash="2b8007242ae1c9ae9f26c60a878a63f7"/></dir><dir name="grid"><file name="grid-body-bg.gif" hash="b5fe585c01f57b2171a2b723abcc4a38"/><file name="grid-split.gif" hash="32e210451e8dc4295b53cf7ca13bb4a6"/></dir><dir name="layout"><file name="checkered-bg.gif" hash="f0a0cd29a6120377c289fd39e2ee7e80"/><file name="icon-catalog.gif" hash="435ff2300ddefb9f8a4bad8ee806fb1a"/><file name="icon-category.gif" hash="ce2a146851bb5ec1e41670b68183b56a"/><file name="icon-my-tasks.gif" hash="0ecb888b160701845e25a7140d038af0"/><file name="icon-product.gif" hash="a0707878c5221052209e5ae6a4de0bd2"/></dir><file name="loading_bg.gif" hash="e202ef7e03d0ef3e9beac7480dae65bf"/><dir name="tabs"><file name="tab-sprite.gif" hash="049fb2f4186b6dc9de747ad96456b1ab"/></dir><dir name="toolbar"><file name="btn-arrow.gif" hash="938cffb6de5cc8b1febfd1851fd983c2"/><file name="header_bg.gif" hash="3696842a32740fa159484cabc3340d13"/><file name="toolbar-bg.gif" hash="8d1b465c2a75963407b536d9081f649f"/></dir><dir name="tree"><file name="elbow-end-minus-nl.gif" hash="6dc08c43109cc6a365bd0270f05e2f1c"/><file name="elbow-end-minus.gif" hash="3dbdb88a9297fe5631e832f046b0350b"/><file name="elbow-end-plus-nl.gif" hash="6dc08c43109cc6a365bd0270f05e2f1c"/><file name="elbow-end-plus.gif" hash="5470e5712a9742ba666c26cb429baaeb"/><file name="elbow-end.gif" hash="63fe879440e2784e0cc0d316ce017745"/><file name="elbow-line.gif" hash="b316a39455304e20e01dbc437f57fd32"/><file name="elbow-minus-nl.gif" hash="0e3129bff70475c8f7f297e0e59d1608"/><file name="elbow-minus.gif" hash="e7b18ff6800e65c6e171bbb2a911762e"/><file name="elbow-plus-nl.gif" hash="78a8f737941fa658f1e770258a3791cd"/><file name="elbow-plus.gif" hash="b02cb264df55aef2105b1b245d075e56"/><file name="elbow.gif" hash="b6bd0e0237e3cd413fa2dac27701c724"/><file name="folder-open.gif" hash="e3cd196406d4857dc0c926807f16c409"/><file name="folder.gif" hash="03eb26c42137ac792609822862ef4d0f"/><file name="leaf.gif" hash="e3cd196406d4857dc0c926807f16c409"/><file name="s.gif" hash="df3e567d6f16d040326c7a0ea29a4f41"/></dir></dir></dir></dir></dir></dir><file name="ranking.js" hash="bbdbf7077ae6ffeb65b5f0b50bb3204f"/></dir></dir><dir name="includes"><dir name="src"><dir name="Logicbroker"><dir name="Dropship360"><dir name="controllers"><dir name="Adminhtml"><file name="InventoryController.php" hash="b7a16563b730885689a8d6a094c30d49"/><file name="LogicbrokerController.php" hash="bbe0d67ce6a50d2dc15ba1dec219b90e"/><file name="RankingController.php" hash="b4c12c7c1455a06d90c4bafd550e446e"/><file name="ReportController.php" hash="343239bb1e1a88c7f26786ed84a04229"/><file name="SourcingController.php" hash="e0ce773b6ce36b0959c9644643127cd8"/><file name="UploadController.php" hash="97ab71275f80a70e0138a540731caf71"/></dir></dir></dir><dir name="Fulfillment"><dir name="controllers"><dir name="Adminhtml"><file name="InventoryController.php" hash="4b4f567c72e01090613c3d05fc3f70c9"/><file name="LogicbrokerController.php" hash="a01e467a0ad4088b732c0e31f24bd676"/><file name="RankingController.php" hash="3a6770c042bf66c31c228beaa714649f"/><file name="SourcingController.php" hash="ddf643aa9b99a4decbddfa0e337c7d0b"/></dir></dir></dir></dir><file name="Logicbroker_Dropship360_Block_Adminhtml_Inventory.php" hash="c7728661548631477dcc48d817719877"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Inventory_Edit_Tab_Addvendorfield.php" hash="6625647e155eacc986eca2a4d373b281"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Inventory_Edit_Tab_Lbvendor.php" hash="27f09bc7b031dc069a362a7975720842"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Inventory_Edit_Tab_Vendortabhistory.php" hash="e016910fb9519d329772430b44e5e893"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Inventory_Edit_Vendortab.php" hash="814752c7c23059c93eb4fdc41a32bdd2"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Inventory_Edit_Vendortabhistory.php" hash="c3a43db297bc516fac6f1a2beb2680c4"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Inventory_Grid.php" hash="380086c734d9cfd461dd03769e5ebe58"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Logicbroker.php" hash="ce2312714d815277183c307473ad2f07"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Notification.php" hash="cfe6611b4238cc315cd8fcee18e50387"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Ranking.php" hash="3df5f3d9b3eb76dfcfb76953e3e611a0"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Ranking_Grid.php" hash="7f04b9fdff771da3ef4e372c0ece1dcf"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor.php" hash="a3473f721724bbbca3b6f77ff91035ed"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor_Email.php" hash="6fb521aa6a26ff35dad2ed5ac1dcfd04"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor_Form.php" hash="e50e581912bd8f73556528121266da45"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor_Grid.php" hash="9029ec4399242544707cd8985d7c38b8"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor_Periodopen.php" hash="6297aefbe9fc2f7c9449e1b461afe075"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Reports_Form_Timestatus.php" hash="3c05459135341b52b439e2c119781ab1"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Sales_Order_View_Items.php" hash="5245dfa460de93a54aede73d952518c0"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Showhistory.php" hash="f68cf95bc55e779d441376a73ba56d60"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Sourcing.php" hash="af52b223025355dabddd48c91e1b8b33"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Sourcing_Edit.php" hash="f8b57c6d6523f86a20706ce30d17d4d4"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Sourcing_Edit_Form.php" hash="e6b0312f4fc38b771089fbb1815578ef"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Sourcing_Edit_Tab_Form.php" hash="60a5d352df0d20ac200e29d83203cafa"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Sourcing_Edit_Tabs.php" hash="ef1501d2821bbb92e9b9033368f1040e"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Sourcing_Grid.php" hash="48399aa0d9aa46f40b41ca232c60483a"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Sourcing_History_Renderer_Action.php" hash="edea4e5929b246ff70d063aa5845b3f9"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Sourcing_History_View.php" hash="b579312729923625c759073e4364e8e5"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Sourcing_History_View_Form.php" hash="f4df7e1a5aeed4099587cd9faffa9754"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Sourcing_History_View_Tabs.php" hash="461d00cc9f003e3f34762effb56c715c"/><file name="Logicbroker_Dropship360_Block_Adminhtml_System_Config_Crontime.php" hash="b81ffae42850e8171d357f911a0e11fc"/><file name="Logicbroker_Dropship360_Block_Adminhtml_System_Config_Fieldset_Hint.php" hash="9edf815e44d4ce26c6ee421012ac2c9c"/><file name="Logicbroker_Dropship360_Block_Adminhtml_System_Config_Ftpconnectionbutton.php" hash="6a3b3b65888ce196a397e4c8af61589b"/><file name="Logicbroker_Dropship360_Block_Adminhtml_System_Config_Helplink.php" hash="a03673c6286b925737553bf46b4372ba"/><file name="Logicbroker_Dropship360_Block_Adminhtml_System_Config_Singuplink.php" hash="a6927e292ac86b35339a5029034b5ac2"/><file name="Logicbroker_Dropship360_Block_Adminhtml_System_Config_Submitbutton.php" hash="7ce0fade94eede8db6ff04c0dbe50dac"/><file name="Logicbroker_Dropship360_Block_Adminhtml_System_Config_Time.php" hash="74a40038b4a50994296b0cb7fce2947f"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Upload.php" hash="27b63659c455c3b7543497271ffbc80a"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Upload_Bulkassign.php" hash="56d1feb5ba70d29c5afd99bad850f9b7"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Upload_Edit_Button.php" hash="7b98d1326c1f93bc643e1463242224a2"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Upload_Edit_Form.php" hash="b0377f1f4bb8426410a9cb297a286bc9"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Vendorproductuploadhistory.php" hash="4ef8cc2c4de117935d762c44fad929d8"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Widget_Grid_Column_Nameaction.php" hash="bd171423eec53f92fda759bf4d3624f1"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Widget_Grid_Column_Orderaction.php" hash="842701da280c25c3c552b05d7c06413e"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Widget_Grid_Column_Skuaction.php" hash="0c4477b7bdabcc81da134929b2926ef7"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Widget_Grid_Column_Textaction.php" hash="9855312bb0dcac85104f7f0cd4a51054"/><file name="Logicbroker_Dropship360_Helper_Data.php" hash="80f8221910b329d8564d513c42d37ff1"/><file name="Logicbroker_Dropship360_Model_Api2_Createroleandrule.php" hash="0705eae3777b7cfc4eeba433265edeb5"/><file name="Logicbroker_Dropship360_Model_Api2_Inventory.php" hash="9d08c98e36b9c232b9d796a418aac383"/><file name="Logicbroker_Dropship360_Model_Api2_Inventory_Rest.php" hash="b7e996ed201e1d1e0239d6d226ef1007"/><file name="Logicbroker_Dropship360_Model_Api2_Inventory_Rest_Admin_V1.php" hash="642da28ad0fb79d889552472de633638"/><file name="Logicbroker_Dropship360_Model_Api2_Inventory_Rest_Customer_V1.php" hash="c0327118b69995896f78acd7907fa71f"/><file name="Logicbroker_Dropship360_Model_Api2_Inventory_Rest_Guest_V1.php" hash="1c3f3a1a87ccd9bd1120138d8369229d"/><file name="Logicbroker_Dropship360_Model_Api2_Product.php" hash="5ced4e9d325db0cf6f748a13c8384298"/><file name="Logicbroker_Dropship360_Model_Api2_Product_Rest.php" hash="f423598eb3ae1871d8b4a326f7dda181"/><file name="Logicbroker_Dropship360_Model_Api2_Product_Rest_Admin_V1.php" hash="6008242b34650ff438483d73af8a7702"/><file name="Logicbroker_Dropship360_Model_Api2_Product_Rest_Customer_V1.php" hash="c0327118b69995896f78acd7907fa71f"/><file name="Logicbroker_Dropship360_Model_Api2_Product_Rest_Guest_V1.php" hash="0f4c46ad1ef2e6fefd1fdbda4034ad85"/><file name="Logicbroker_Dropship360_Model_Inventory.php" hash="02a3373d6498ec7b857a4a1f942b0105"/><file name="Logicbroker_Dropship360_Model_Inventorylog.php" hash="1c493c02c6270f081f9625c33cd6ae50"/><file name="Logicbroker_Dropship360_Model_Logicbroker.php" hash="f4aa68ef222a83d9561341c0d50062bb"/><file name="Logicbroker_Dropship360_Model_Observer.php" hash="97ef80eb905c9c1b338bdcdaa4f9176c"/><file name="Logicbroker_Dropship360_Model_Order_Api.php" hash="dcee014ae73d74ddd8fb16181a085ffb"/><file name="Logicbroker_Dropship360_Model_Orderitems.php" hash="cb0e97261ed642bfc5e74b4620f8a81d"/><file name="Logicbroker_Dropship360_Model_Ordersourcing.php" hash="cd717bc6118c164851e27a36dc656809"/><file name="Logicbroker_Dropship360_Model_Productimport.php" hash="7feece453157d3930e7866b48afaa6f6"/><file name="Logicbroker_Dropship360_Model_Ranking.php" hash="439cdfe86f9727ad1ec0049ed7b5a80c"/><file name="Logicbroker_Dropship360_Model_Rankinglog.php" hash="eec4a3d38d0aec48c2c07c3e8cfc1daa"/><file name="Logicbroker_Dropship360_Model_Report.php" hash="82953e8fcc1470f03448c555802d713b"/><file name="Logicbroker_Dropship360_Model_Resource_Inventory.php" hash="b6853986d109fb7c3ba2c3db32cd0381"/><file name="Logicbroker_Dropship360_Model_Resource_Inventory_Collection.php" hash="64abac572c4cdbbd15bec30f0c4614ef"/><file name="Logicbroker_Dropship360_Model_Resource_Inventorylog.php" hash="55255ff69e778710fd2e29700e9da06d"/><file name="Logicbroker_Dropship360_Model_Resource_Inventorylog_Collection.php" hash="e5f33b8a0db2acc304ff1f0706c52bf2"/><file name="Logicbroker_Dropship360_Model_Resource_Orderitems.php" hash="f34b5d078a9498d10958395c6875d969"/><file name="Logicbroker_Dropship360_Model_Resource_Orderitems_Collection.php" hash="d3c95b0634b37948b2d0cb19e3637fd6"/><file name="Logicbroker_Dropship360_Model_Resource_Ordersourcing.php" hash="0409c90fb55997b340a54888a6f4b3bf"/><file name="Logicbroker_Dropship360_Model_Resource_Ordersourcing_Collection.php" hash="df7fede92820a7b4a50aeac2d32cd7ef"/><file name="Logicbroker_Dropship360_Model_Resource_Ranking.php" hash="bb5db1250b0f6ce79f0928cd5aeb49fd"/><file name="Logicbroker_Dropship360_Model_Resource_Ranking_Collection.php" hash="9efcdcab905872553f0828ecd1670aa6"/><file name="Logicbroker_Dropship360_Model_Resource_Rankinglog.php" hash="889c96c4a2dd3b45cf6aa322ee4e28ae"/><file name="Logicbroker_Dropship360_Model_Resource_Rankinglog_Collection.php" hash="5f7dc2e0b408c240220abc0ac36b7868"/><file name="Logicbroker_Dropship360_Model_Resource_Setup.php" hash="db1b106449549a4d6a94e115b35f36d3"/><file name="Logicbroker_Dropship360_Model_Resource_Uploadvendor.php" hash="c94c815f0f3d2e1646a453b08754e032"/><file name="Logicbroker_Dropship360_Model_Resource_Uploadvendor_Collection.php" hash="b24a06b05dc7570b1d904f118401a7eb"/><file name="Logicbroker_Dropship360_Model_Resource_Vendorimportlog.php" hash="15ac60a8f798c9231d4f27c0fde7cfb0"/><file name="Logicbroker_Dropship360_Model_System_Config_Backend_Report_Email.php" hash="b8add0d41e93c027e056103eb2ffd784"/><file name="Logicbroker_Dropship360_Model_System_Config_Backend_Sourcing_Cronbackorder.php" hash="b653137f284099cda52229ca4a03032a"/><file name="Logicbroker_Dropship360_Model_System_Config_Backend_Sourcing_Cronsourcing.php" hash="e344d67cb474c67d39453cbfb90ae010"/><file name="Logicbroker_Dropship360_Model_System_Config_Backend_Uploadvendor_Cron.php" hash="d7ab43d34129359aaca41be3f8510e7a"/><file name="Logicbroker_Dropship360_Model_System_Config_Source_Attributecodes.php" hash="7019e72b1ef6a3b198b88beb50b28423"/><file name="Logicbroker_Dropship360_Model_System_Config_Source_Category.php" hash="881c2167d9b011e554eac5067c17b321"/><file name="Logicbroker_Dropship360_Model_System_Config_Source_Ediqualifier.php" hash="5d76df44f40965e294e8de84bb6658e8"/><file name="Logicbroker_Dropship360_Model_System_Config_Source_Ftptype.php" hash="aeafcda1a2d1abffa14b3db37e454c2a"/><file name="Logicbroker_Dropship360_Model_System_Config_Source_Optionvalues.php" hash="a9fa9a4a20d8ec93edeff97e3c8590a7"/><file name="Logicbroker_Dropship360_Model_System_Config_Source_Ranktype.php" hash="f604c3e530d1541996791266430dbaad"/><file name="Logicbroker_Dropship360_Model_System_Config_Source_Store.php" hash="eaa19dfd1575ac6f851f115dd501fbf2"/><file name="Logicbroker_Dropship360_Model_System_Config_Source_Time.php" hash="7ccf6ebc62220eb3861b6ae3c91e7cfa"/><file name="Logicbroker_Dropship360_Model_System_Config_Source_Vendorlist.php" hash="38d75a6b285d8940de2ea443130def4c"/><file name="Logicbroker_Dropship360_Model_Uploadvendor.php" hash="bdb6f645f0eab6a4d1c939fa82d58a19"/><file name="Logicbroker_Dropship360_Model_Versions_Api.php" hash="7fc94e25af730bd4b8f48dbc8603bf7b"/><file name="Logicbroker_Dropship360_Model_Versions_Api_V2.php" hash="6def122e3c99344db1d10dc0b4ccfaa3"/></dir></dir><dir name="media"><dir name="logicbroker"><file name="Supplier_Ranking.png" hash="4390fdd6c9a3813ba716d50aa3a0dc2c"/><file name="System_Setup_Update.png" hash="b70cfea7eb0a4b02562d3d851c8a90a0"/><file name="System_Setup_Update_Step2.png" hash="719655c99dbaa771654551e1c496a708"/></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>dropship360</name>
4
+ <version>3.1.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://logicbroker.com/portfolio/magento/license">Customer License</license>
7
  <channel>community</channel>
10
  <description>logicbroker is the most complete eCommerce integration platform available and offers a true end-to-end EDI solution for Magento. Beyond its EDI capabilities, logicbroker&#x2019;s flexible connectivity automates and simplifies tasks like drop ship deployment and omni-channel retailing. logicbroker connects Magento to backend systems like ERPs (Dynamics, Netsuite, Exact), accounting software (QuickBooks), and order management systems (M.O.M) to seamlessly exchange information</description>
11
  <notes>package is ready</notes>
12
  <authors><author><name>Logicbroker</name><user>Logicbroker</user><email>magentoext@logicbroker.com</email></author></authors>
13
+ <date>2015-12-23</date>
14
+ <time>08:12:24</time>
15
+ <contents><target name="magecommunity"><dir name="Logicbroker"><dir name="Dropship360"><dir name="Block"><dir name="Adminhtml"><dir name="Inventory"><dir name="Edit"><dir name="Tab"><file name="Addvendorfield.php" hash="af6a5039e07a8f610a50baaceec5465b"/><file name="Lbvendor.php" hash="67d2d2b7e825f63bff4d343bc1cf8aa4"/><file name="Vendortabhistory.php" hash="69fbc5a2cd3fb1d010a613943f7a951c"/></dir><file name="Vendortab.php" hash="814752c7c23059c93eb4fdc41a32bdd2"/><file name="Vendortabhistory.php" hash="c3a43db297bc516fac6f1a2beb2680c4"/></dir><file name="Grid.php" hash="55a9058cdf9004c4f944d5722c1e5ede"/></dir><file name="Inventory.php" hash="99a5d1a58c1dc6ef2cc56ae9fc5b6481"/><file name="Logicbroker.php" hash="239a7cefa7386a8d3b40ad78422d1ae4"/><file name="Notification.php" hash="18d8754907908e0262c087d573f934a5"/><dir name="Ranking"><file name="Grid.php" hash="52407d6d50481bc32c391e3e09e2a7a1"/></dir><file name="Ranking.php" hash="42e39843931b6030840f8c3161ec84b6"/><dir name="Reports"><dir name="Activitymonitor"><file name="Email.php" hash="b153871bad4a1599a2f9b4165c4287f2"/><file name="Form.php" hash="33d12cac623619efaaac0325f19452b8"/><file name="Grid.php" hash="fd9a2f6af14688fdc19a72803e319ece"/><file name="Periodopen.php" hash="6297aefbe9fc2f7c9449e1b461afe075"/></dir><file name="Activitymonitor.php" hash="750b5adec9792b9bdc593921b3e86a16"/><dir name="Form"><file name="Timestatus.php" hash="ef5b8206b1c0e71cd1d3ad6c31923a8a"/></dir><file name="Staticemailgrid.php" hash="078130167406426bad0e577d1fc4b0ce"/></dir><dir name="Sales"><dir name="Order"><dir name="View"><file name="Items.php" hash="acb46509068da360104a0c8cada453da"/></dir></dir></dir><file name="Showhistory.php" hash="a82540104538beaa185238b4931fdb14"/><dir name="Sourcing"><dir name="Edit"><file name="Form.php" hash="e6b0312f4fc38b771089fbb1815578ef"/><dir name="Tab"><file name="Form.php" hash="d0d9a417b1e59d06030ff7a65c6cbc88"/></dir><file name="Tabs.php" hash="5298c26c63035ff916a986c8072c8d0b"/></dir><file name="Edit.php" hash="767bcde378baf0ff1196598e0c466fc5"/><file name="Grid.php" hash="8c1ab115b99ea39900dccd60ee7ac651"/><dir name="History"><dir name="Renderer"><file name="Action.php" hash="edea4e5929b246ff70d063aa5845b3f9"/></dir><dir name="View"><file name="Form.php" hash="9da38c9ec7e580f660155ec62d7e0eeb"/><file name="Tabs.php" hash="94ffa503cf28c9fa63076f84c02b9cee"/></dir><file name="View.php" hash="02be1363be1b4610bdee1dbc7cc2ba34"/></dir></dir><file name="Sourcing.php" hash="d94b0f3a7e4d290d71f69064cbe98282"/><dir name="System"><dir name="Config"><file name="Crontime.php" hash="b81ffae42850e8171d357f911a0e11fc"/><dir name="Fieldset"><file name="Hint.php" hash="72f6124a380765b0142ebecd9cbfb6cf"/></dir><file name="Ftpconnectionbutton.php" hash="f7d562a0e7377c85083f0d2fe14fea08"/><file name="Helplink.php" hash="0d0427b473f8a343efa394c4a0853942"/><file name="Singuplink.php" hash="a6927e292ac86b35339a5029034b5ac2"/><file name="Submitbutton.php" hash="7ce0fade94eede8db6ff04c0dbe50dac"/><file name="Time.php" hash="74a40038b4a50994296b0cb7fce2947f"/></dir></dir><dir name="Upload"><file name="Bulkassign.php" hash="bd462fdca45aec2dc8e762237ceefe1b"/><dir name="Edit"><file name="Button.php" hash="7b98d1326c1f93bc643e1463242224a2"/><file name="Form.php" hash="50eff157cd1fe36cc670786f053ae939"/></dir></dir><file name="Upload.php" hash="42c6c3cdcc0a6a015c567a83997d85a3"/><file name="Vendorproductuploadhistory.php" hash="135610c201ebde49e396ca2685249ccc"/><dir name="Widget"><dir name="Grid"><dir name="Column"><file name="Nameaction.php" hash="bd171423eec53f92fda759bf4d3624f1"/><file name="Orderaction.php" hash="842701da280c25c3c552b05d7c06413e"/><file name="Skuaction.php" hash="0c4477b7bdabcc81da134929b2926ef7"/><file name="Textaction.php" hash="9855312bb0dcac85104f7f0cd4a51054"/></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="ee1785693bb5bddbb4c4452e678960d8"/></dir><dir name="Model"><dir name="Api2"><file name="Createroleandrule.php" hash="71ece80df5c5c87e13075841a1f9f4e1"/><dir name="Inventory"><dir name="Rest"><dir name="Admin"><file name="V1.php" hash="a6a58df3d657dbe8b8f42da5e107a212"/></dir><dir name="Customer"><file name="V1.php" hash="c0327118b69995896f78acd7907fa71f"/></dir><dir name="Guest"><file name="V1.php" hash="1c3f3a1a87ccd9bd1120138d8369229d"/></dir></dir><file name="Rest.php" hash="b7e996ed201e1d1e0239d6d226ef1007"/></dir><file name="Inventory.php" hash="9d08c98e36b9c232b9d796a418aac383"/><dir name="Product"><dir name="Rest"><dir name="Admin"><file name="V1.php" hash="6f4acb240c2875694c9a710bfec844c4"/></dir><dir name="Customer"><file name="V1.php" hash="c0327118b69995896f78acd7907fa71f"/></dir><dir name="Guest"><file name="V1.php" hash="0f4c46ad1ef2e6fefd1fdbda4034ad85"/></dir></dir><file name="Rest.php" hash="f423598eb3ae1871d8b4a326f7dda181"/></dir><file name="Product.php" hash="5ced4e9d325db0cf6f748a13c8384298"/></dir><file name="Csvparser.php" hash="6b4810b688501b741c89bf04b5ab30b6"/><file name="Inventory.php" hash="f9c1489738188804a835641a76e29d85"/><file name="Inventorylog.php" hash="208f743adec62a2d8117120cf42ef342"/><file name="Logicbroker.php" hash="99124a4b0cf794f894e9725bf4d7589b"/><file name="Observer.php" hash="36fb3b2090cab1162a00e0769878b08b"/><dir name="Order"><file name="Api.php" hash="883eb8772a085238c1d87893ad8f326e"/></dir><file name="Orderitems.php" hash="54ed3910268b9a6828f44d0fbde92e12"/><file name="Ordersourcing.php" hash="cb43e6b2763d874c0579c26fdffd6598"/><file name="Productimport.php" hash="7feece453157d3930e7866b48afaa6f6"/><file name="Ranking.php" hash="96905331a59e81a2a0d54cff032c82fc"/><file name="Rankinglog.php" hash="094334cf66c9ce7304c87082570a496d"/><file name="Report.php" hash="ae7188a15da1892667de020648d6b4af"/><dir name="Resource"><dir name="Inventory"><file name="Collection.php" hash="4a0707fc5d728c872a7df48a372e3411"/></dir><file name="Inventory.php" hash="105f54b381ac6cde7ba6e4ff01435083"/><dir name="Inventorylog"><file name="Collection.php" hash="1a24af879a980509fc049106dfa7ed17"/></dir><file name="Inventorylog.php" hash="9821c43afd97cef8608b08c634456dd3"/><dir name="Orderitems"><file name="Collection.php" hash="09ca1baa286ba8dbe2d8636041afc183"/></dir><file name="Orderitems.php" hash="2f5611b00cf0b15994047a85476764d5"/><dir name="Ordersourcing"><file name="Collection.php" hash="a4341add3d2e4ed0d4fec5b5ead2b391"/></dir><file name="Ordersourcing.php" hash="6c9903c47b98b1032ed262578b15d5f2"/><dir name="Ranking"><file name="Collection.php" hash="2c5f73589c3cf1cc61d82ff3184e9180"/></dir><file name="Ranking.php" hash="e728c7db906f4257c9fa2828f3b1889c"/><dir name="Rankinglog"><file name="Collection.php" hash="847f4a313b4c57f1943667a743fb1876"/></dir><file name="Rankinglog.php" hash="280ca665631b7dfdc5fd65bdd37dd977"/><file name="Setup.php" hash="db1b106449549a4d6a94e115b35f36d3"/><dir name="Uploadvendor"><file name="Collection.php" hash="c00c646cd30ea2846eaf64aebfa60d81"/></dir><file name="Uploadvendor.php" hash="cdea6d41186776859dd4ff1b903631e0"/><file name="Vendorimportlog.php" hash="5612cc9ad31e26537854803cf48cd83c"/></dir><dir name="System"><dir name="Config"><dir name="Backend"><dir name="Oudatedinventory"><file name="Email.php" hash="3c0a74ca609f55dcbffb9eec2ec61eaa"/></dir><dir name="Report"><file name="Email.php" hash="b8add0d41e93c027e056103eb2ffd784"/></dir><dir name="Sourcing"><file name="Cronbackorder.php" hash="b653137f284099cda52229ca4a03032a"/><file name="Cronsourcing.php" hash="e344d67cb474c67d39453cbfb90ae010"/></dir><dir name="Uploadvendor"><file name="Cron.php" hash="d7ab43d34129359aaca41be3f8510e7a"/></dir></dir><dir name="Source"><file name="Attributecodes.php" hash="f97c33f5918714fccab7eb49119a8b95"/><file name="Category.php" hash="c5b9a7f9b613f8abe98c2419d802ab5c"/><file name="Ediqualifier.php" hash="ac6c52c324204bd2062c0361c64e27b6"/><file name="Ftptype.php" hash="66fc7d9ba1926a043060557f8ce87061"/><file name="Optionvalues.php" hash="48dc60144b3e8dae327e42c5bb567608"/><file name="Ranktype.php" hash="4a2a731340fd142ab77b75d64ac91ef8"/><file name="Store.php" hash="eaa19dfd1575ac6f851f115dd501fbf2"/><file name="Time.php" hash="7ccf6ebc62220eb3861b6ae3c91e7cfa"/><file name="Vendorlist.php" hash="535eea5a21a3c027a232cd1285a0120b"/></dir></dir></dir><file name="Uploadvendor.php" hash="4f3f408b07c0b06ba1133542257c46a6"/><dir name="Versions"><dir name="Api"><file name="V2.php" hash="6def122e3c99344db1d10dc0b4ccfaa3"/></dir><file name="Api.php" hash="7fc94e25af730bd4b8f48dbc8603bf7b"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="InventoryController.php" hash="8c8df2448896a6dab42e131f1e5dee68"/><file name="LogicbrokerController.php" hash="0cf5f0ef8f84170b3c9f3749d3050128"/><file name="RankingController.php" hash="2a709afdad369cbb29c4dfa5f091fa64"/><file name="ReportController.php" hash="023e1acb60ef84290573df5a05281c90"/><file name="SourcingController.php" hash="35fb58b6b81fa1324ecd95b85abf0429"/><file name="UploadController.php" hash="fc31c7daea4eb49e8ee030fead1f3c50"/></dir></dir><dir name="data"><dir name="dropship360_setup"><file name="data-install-1.0.3.php" hash="571b05db7d7f51ff2a07be017e954285"/><file name="data-upgrade-1.0.3-1.0.4.php" hash="9880908a508362787c703f3ac38d70f0"/><file name="data-upgrade-1.0.4-1.0.5.php" hash="fae385cfd674925b55d148e9d149192a"/><file name="data-upgrade-1.0.5-1.0.6.php" hash="6fc6b8bc7e5023e153db504f9d941089"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="7f6a2b88ab06d3bca8c8ee6dada72f1a"/><file name="api.xml" hash="7154cf55d8e7dc8fd6939ebe0bc8f66f"/><file name="api2.xml" hash="92e6f7bfeee312d5c5d9b5346994b698"/><file name="config.xml" hash="5adcc5e9349a052db5274f9b77abb350"/><file name="jstranslator.xml" hash="8de896de15a8c593a3198d8e2100a71d"/><file name="system.xml" hash="82798d5a2f3463b788715df53b6d1920"/><file name="wsdl.xml" hash="deb338269cb05784cb598725d16685af"/></dir><dir name="sql"><dir name="dropship360_setup"><file name="mysql4-install-1.0.3.php" hash="45e15c99c8041e08bbacd46cb994576d"/><file name="mysql4-upgrade-1.0.3-1.0.4.php" hash="5962486ed85a99c3f866c5854e14c11f"/><file name="mysql4-upgrade-1.0.4-1.0.5.php" hash="7895767223ec16662bc3f92deb7b6d2e"/><file name="mysql4-upgrade-1.0.5-1.0.6.php" hash="ac2243460d31dfa9b73133384a410168"/><file name="mysql4-upgrade-1.0.6-1.0.7.php" hash="1eff97e395c2d0cca92801d253a9b2d3"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="logicbroker"><file name="add_help_js.phtml" hash="21a3ec98fdf3e499aaa66193e1a854a0"/><file name="addvendorfields.phtml" hash="4fda9044642b8e888f7565aa203fb41b"/><dir name="bundle"><file name="renderer.phtml" hash="d529bcca3a13d3dc8b4363e4d67a8a5c"/></dir><dir name="downloadable"><file name="downloadable.phtml" hash="06d6416024d05b49115da28c8b6277b1"/></dir><dir name="html"><file name="pager.phtml" hash="ef0e74e20708b97261197cd067b48e4d"/></dir><dir name="import"><dir name="form"><file name="after.phtml" hash="08085046e6675633ada4009bc000297f"/><file name="before.phtml" hash="3dda3ab8d33e980fb48b3ac8af757bfc"/></dir><dir name="frame"><file name="result.phtml" hash="3593b07a3b9540c7eea44d29fbf3c272"/></dir></dir><file name="inline-edit.phtml" hash="ad39e2d2a306160e69579016493744ba"/><file name="item_order_history.phtml" hash="a76e0a3f2143b7f3d45587bf79f5ab7e"/><file name="popup.phtml" hash="ca4e3467dceb197329cd2593e4d90096"/><file name="process-profile.phtml" hash="9d5708843faf3fffa478d18cd4efee11"/><dir name="reports"><dir name="email"><file name="grid.phtml" hash="5a7b8849ad148208806491c51c39fba5"/></dir><dir name="grid"><file name="container.phtml" hash="8d72e70a1d5feee742e999d5bf4c7bc6"/></dir></dir><file name="result.phtml" hash="0bff64bf35c207c0ab2b0e7607f75ef5"/><dir name="sales"><file name="default.phtml" hash="ef93018d9d64e8f367b4c1d5d446a15b"/><file name="items.phtml" hash="eece06fcdcbc9cb7975577e635191d0a"/></dir><dir name="system"><dir name="config"><dir name="fieldset"><file name="hint.phtml" hash="8169642d4b919af4cc85f2e1834eaec1"/></dir><file name="submitbutton.phtml" hash="ad652c41e879efe23da1a58d963dd197"/></dir></dir><file name="upload_vendor_product.phtml" hash="b39846857de94d50ad399995f2f25bbd"/><file name="vendor_ranking.phtml" hash="69ed0f93a93469fe61bb534c9d287d2d"/><file name="vendor_upload_product_history.phtml" hash="1b4bb192ad3593570b7e0c9dcfbb4322"/><file name="vendorproducttab.phtml" hash="9180e2f4a9f49b6b2372510acba9ad26"/><file name="vendorproducttabhistory.phtml" hash="9c0194bf9e410f46f1941246cdaee363"/><file name="window.phtml" hash="ad67768f1a01644766f1c422f411c5e6"/></dir></dir><dir name="layout"><file name="logicbroker.xml" hash="af72270304150e955deb4fc6e2364abf"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Logicbroker_Dropship360.xml" hash="67068aaea26ac3534322d12dbb7c0c1a"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Logicbroker_Dropship360.csv" hash="34e85a999b73c4a216eed04dfffa756d"/><dir name="template"><dir name="email"><dir name="logicbroker"><file name="activity_report_staticstatus.html" hash="1f060800e62af9aa3ab51916efd228c0"/><file name="first_order_notification.html" hash="bc2f640396d0ac3fc3d3e37bfe65f3a5"/><file name="first_productsetup_notification.html" hash="a2b56627a24975377263cffc594f8219"/><file name="logicbroker.html" hash="f4902b5293a5290c006dbc3522238dd4"/><file name="logicbroker_ftp_con_fail.html" hash="cc946e7665e4f7bca987c4fdd2b62e66"/><file name="oudated_product_inventory_notification.html" hash="f777b863bc1dce0ebddbc63f6e6be0b8"/></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="logicbroker"><dir><dir name="extjs"><file name="bootstrap.js" hash="a82e5f0ee98f60e92bb5774e25c480f7"/><dir name="css"><file name="example.css" hash="7fcbf7ea6c0466ac334f00e12ac4be7e"/><file name="ext-all.css" hash="ecf28869070c6511559c6a5286a6f6cb"/><dir name="images"><dir name="boundlist"><file name="trigger-arrow.png" hash="4655916b183b914b357da69b86414f52"/></dir><dir name="box"><file name="corners-blue.gif" hash="86fd4c5664e0971bfc11959e8442604c"/><file name="corners.gif" hash="d2d1bc2085b369ce35ffd20c0121676e"/><file name="l-blue.gif" hash="ced9ffbf66ea39e77083a591f8257267"/><file name="l.gif" hash="c4d9dbbdc59ae06b5e9e72a6a865c981"/><file name="r-blue.gif" hash="82dbb522a80e3246f6297719371a9494"/><file name="r.gif" hash="bf1e1d4a45f951ae656968a8c834f04a"/><file name="tb-blue.gif" hash="7c4b19eb682afdc1bde0640d2321fb25"/><file name="tb.gif" hash="dd3f63afe7ba90983ba73dad1c66bf2f"/></dir><dir name="button"><file name="arrow.gif" hash="44b6dbf385236a2697932a7a3e20b4a0"/><file name="btn.gif" hash="40ac871755023cc11ad15dcd77b54dbf"/><file name="group-cs.gif" hash="5dc0252bd9ecf72f98d858427054cf08"/><file name="group-lr.gif" hash="cb7813012d6be17e083835d60037029e"/><file name="group-tb.gif" hash="4edf9b7db13b1331282eed298384cab9"/><file name="s-arrow-b-noline.gif" hash="30d04f652551f1df9d59d33a99c9a320"/><file name="s-arrow-b.gif" hash="a957a6d618d19b92a2d1a7a1b50f5235"/><file name="s-arrow-bo.gif" hash="53a15d7907a017122f7f60402c435753"/><file name="s-arrow-light.gif" hash="6576de0eb6bec88f8e37c12829939573"/><file name="s-arrow-noline.gif" hash="13f08a275c58135365b8e58b3177ab1a"/><file name="s-arrow-o.gif" hash="5005d8dea2f9456aaf2ab27ca7bf5651"/><file name="s-arrow.gif" hash="bc71296ddf9c7ef5aa56b09ca3512c8a"/></dir><dir name="datepicker"><file name="datepicker-footer-bg.gif" hash="52e65759b3e8c81d3c3f2d0484ec9e58"/><file name="datepicker-footer-bg.png" hash="deca7c712da61f827c61b6219b3246af"/><file name="datepicker-header-bg.gif" hash="5cda0bb28a42b7023d24d48b9a0e1685"/><file name="datepicker-header-bg.png" hash="93fb8e8f1fb52d38e61ab064187f11de"/></dir><dir name="dd"><file name="drop-add.gif" hash="95eb34ac70a1a3c95ef39ab826a89491"/><file name="drop-no.gif" hash="ae536c37391ba78143b5c8283cec8d13"/><file name="drop-yes.gif" hash="f3216326c00890259e84f1726dd1043f"/></dir><dir name="editor"><file name="tb-sprite.gif" hash="a2f06caddc2fb729db5cbbd874491128"/></dir><dir name="form"><file name="checkbox.gif" hash="75d685cab5665a935660a3d04f71c2be"/><file name="clear-trigger.gif" hash="97b3e5e9edf27b50d63d48098c2f1eae"/><file name="date-trigger.gif" hash="30b5bace9f3dac358716c1415270f874"/><file name="error-tip-corners.gif" hash="364474276178c7b48b6270056b42b808"/><file name="exclamation.gif" hash="37dbe02e3cbde0f6780650bfd8535e38"/><file name="radio.gif" hash="0239bdaef529be68530b86266a24742c"/><file name="search-trigger.gif" hash="559ef372cf27a38678d84e8c0b7237fc"/><file name="spinner-small.gif" hash="122ab763adfc5f379def95269889a876"/><file name="spinner.gif" hash="eee2bdd07a8136d2eff635b721838b4c"/><file name="text-bg.gif" hash="d5ba54c1f417e6a72cbce8b909078727"/><file name="trigger-square.gif" hash="c1cbaecc91209f77e2d20235c137e13e"/><file name="trigger-tpl.gif" hash="d7be20f0dc38f4f46cd318fe32cf3ce3"/><file name="trigger.gif" hash="447d5b600f7527f5c8cc49e7453bbb27"/></dir><dir name="grid"><file name="arrow-left-white.gif" hash="b04e859bdcbd21ad1f06b8bfa7881df8"/><file name="arrow-right-white.gif" hash="714eb00f8134dde3a65c83f3f71ad2c4"/><file name="cell-special-bg.gif" hash="60b05fd8cd98b6109112775a4cf2ad0e"/><file name="cell-special-bg.png" hash="a6487b6bd88ce1a726d41140595235be"/><file name="cell-special-selected-bg.gif" hash="2d4830861beacb8945d22b3bb79ad9c2"/><file name="cell-special-selected-bg.png" hash="df8d68826afb17ab5ed333565f531fdf"/><file name="checked.gif" hash="cb7b3408df56f5585aaa1242cd2f0b45"/><file name="col-move-bottom.gif" hash="9c38bcb5cee1dc9b4ce64ad9ab1386f8"/><file name="col-move-top.gif" hash="c4584202d5172464050f675d396d1c6f"/><file name="column-header-bg.gif" hash="1c0619ef4faf05d33d53e46f164664d0"/><file name="column-header-bg.png" hash="2c8e36b59e78fe93fcc13360bebd7f7f"/><file name="column-header-over-bg.gif" hash="8af4b32e4a033f3ac980277efee1d0b2"/><file name="column-header-over-bg.png" hash="25da418192d7f8bb7fbacc3baf6731fb"/><file name="columns.gif" hash="ef35242fa6514a81d17d5f700f561b7c"/><file name="dd-insert-arrow-left.gif" hash="fee4ee1bfc31c909a83713656497c8b2"/><file name="dd-insert-arrow-left.png" hash="5050c8e897cec907d6319f397a66c474"/><file name="dd-insert-arrow-right.gif" hash="b03355f58b96d167f0770b14358e5d88"/><file name="dd-insert-arrow-right.png" hash="46faba03ba3a35d750b5b758cc3d5d2c"/><file name="dirty.gif" hash="decca3b96e2c37cf6eb04ddb0d9f669b"/><file name="done.gif" hash="365266930a93451414fe51ffc524a196"/><file name="drop-no.gif" hash="b53ca86d60fbcc7a45c8917299218bfd"/><file name="drop-yes.gif" hash="af96f4c3b32a470db2f38abb521b5c97"/><file name="footer-bg.gif" hash="65ed63e44c6149f1127ad3b4be4e0108"/><file name="grid-blue-hd.gif" hash="dd35d5c1202c440c2d1a945b335984d3"/><file name="grid-blue-split.gif" hash="0494ba49974ff2bc1bf81e1d82dfee18"/><file name="grid-hrow.gif" hash="55972a5063d80f35fb6b95a79bb0018a"/><file name="grid-loading.gif" hash="9ac6f737eb9b15272f12b00bfeb3c3c6"/><file name="grid-split.gif" hash="3ef419d4b9421d8e94f673a6238dc4c0"/><file name="grid-vista-hd.gif" hash="675f403e8a9cb5ab4bed725da9fe2023"/><file name="grid3-hd-btn.gif" hash="e3e77072c16a6b27556236961f29c552"/><file name="grid3-hrow-over.gif" hash="a92d8f6c106943995720f2884634670e"/><file name="grid3-hrow.gif" hash="3e4484ea8db10af1320808c8477346ea"/><file name="grid3-rowheader.gif" hash="b4491705564909da7f9eaf749dbbfbb1"/><file name="group-by.gif" hash="3ff8c5936e358cf213227509c9bee95a"/><file name="group-collapse.gif" hash="fd6a72ffa784170d83f9f13322266ca8"/><file name="group-expand-sprite.gif" hash="d0f614a387292177f3acb0c95a4cd760"/><file name="group-expand.gif" hash="8a9ad3ed3d74c2911b7f101268a1843b"/><file name="hd-pop.gif" hash="e5f27a2f68cc2d13b11cf41c46d298dc"/><file name="hmenu-asc.gif" hash="048e0bc30f7c39d473dad5dabcbe03f2"/><file name="hmenu-desc.gif" hash="f0a987b34b003b25a7c82624d41f018a"/><file name="hmenu-lock.gif" hash="bcef18e25342c69c37c44dab87086065"/><file name="hmenu-lock.png" hash="2a3b0b441834f443c1086930939efdae"/><file name="hmenu-unlock.gif" hash="8cc8205dafa587ef02d8a86903ae8074"/><file name="hmenu-unlock.png" hash="c1f61df70b98c5498ea81e7e7b9effbb"/><file name="invalid_line.gif" hash="04a88e97b56e8a8ece4a66d49cc78828"/><file name="loading.gif" hash="00ef871b291bc03a497d608a5bd8ec99"/><file name="mso-hd.gif" hash="37fba9c02f0eefe57f655890eef1c4a1"/><file name="nowait.gif" hash="23c91166dbb16ba8655363321bf5a400"/><file name="page-first-disabled.gif" hash="8d3185028c541cbcce67b5909c04824e"/><file name="page-first.gif" hash="16ec00fa770d860b768cf5034ddfca96"/><file name="page-last-disabled.gif" hash="1d123237ceeb5109a1b9274f0cf19d73"/><file name="page-last.gif" hash="ef524dd0b8dfe4eefecffaa1c0bb8edd"/><file name="page-next-disabled.gif" hash="0f4b8681772c91921fa93ede9c755ea0"/><file name="page-next.gif" hash="f6f9d2209dfc99912ffc9848d97646db"/><file name="page-prev-disabled.gif" hash="eefcbed15c8d37a89618b08f7b224297"/><file name="page-prev.gif" hash="80daad880483eed682b22ec70514ecc4"/><file name="pick-button.gif" hash="b431fdf306f1e2f033d0a431996de93f"/><file name="property-cell-bg.gif" hash="1b65e348d6db0c7b6c9aa5478c15a052"/><file name="property-cell-selected-bg.gif" hash="a94039f89dec164896ceff1fbdf6dbc5"/><file name="refresh-disabled.gif" hash="105c62973ba69710bc2b41b443af5198"/><file name="refresh.gif" hash="f1a2e7df30394c5a30bc76c2d09013b7"/><file name="row-check-sprite.gif" hash="2d0aa7e501c3e6f97a97faf75e35d3c3"/><file name="row-expand-sprite.gif" hash="be81199d9d4fa69bef47a8f036a5a7d8"/><file name="row-over.gif" hash="f639094bd0560aefabc86e51a825f23d"/><file name="row-sel.gif" hash="ca87d6b950386edd5e17c985769d9101"/><file name="sort-hd.gif" hash="2640addef6e987b4c5dfa4c8c2dfb10c"/><file name="sort_asc.gif" hash="2352874b5f636ca331fe9509a2f9bdd7"/><file name="sort_desc.gif" hash="d104fcf119d40c51554ddb8b377142e5"/><file name="unchecked.gif" hash="31846118bddc7945b595ea2090589cf1"/><file name="wait.gif" hash="b0cd5a5dc070c705ebf8814a909802c3"/></dir><dir name="layout"><file name="mini-bottom.gif" hash="ae8e3674fd32997dc5217d5d6199a5a5"/><file name="mini-left.gif" hash="8654fdb45ecf4406af2fce1d3beb7596"/><file name="mini-right.gif" hash="cbdf9fb0c45466b4217ac9f7bd6a9ed4"/><file name="mini-top.gif" hash="fbd91e98576f66fd2702495251b15240"/></dir><dir name="menu"><file name="checked.gif" hash="cb7b3408df56f5585aaa1242cd2f0b45"/><file name="group-checked.gif" hash="f7973443d91e5e074013f1b07ee79479"/><file name="item-over.gif" hash="29055ede2ff0584d0374a2ff5a987382"/><file name="menu-item-active-bg.gif" hash="5956b7cac9aabf4c670c2997bba12d47"/><file name="menu-item-active-corners.gif" hash="9a073e133a65c4e1b3bd4098ca72552a"/><file name="menu-item-active-sides.gif" hash="cf1981c1027a8c962a9d8c0f6d61c098"/><file name="menu-parent.gif" hash="d303ad7e3ced891736e80f77e1d4e51d"/><file name="menu.gif" hash="ae128d5f3f3a39213f3d4e23aec8728f"/><file name="unchecked.gif" hash="31846118bddc7945b595ea2090589cf1"/></dir><dir name="progress"><file name="progress-default-bg.gif" hash="b170dfad9f747e1aca54e47c4415c2d3"/></dir><dir name="shared"><file name="blue-loading.gif" hash="dc2fd7c0ed853c56b4ac65710af3bd0a"/><file name="calendar.gif" hash="81296cff1f97f5365524f2b9dcf626da"/><file name="glass-bg.gif" hash="bc2cd5c5ac9b3874d956c892d23f2119"/><file name="hd-sprite.gif" hash="6a54ae98bef53397d52282201852c204"/><file name="icon-error.gif" hash="f477b54b6b8361362e96c2218dce7ea0"/><file name="icon-info.gif" hash="ec6b7a5d4caeea767c8674689bae47c6"/><file name="icon-question.gif" hash="2713644a8aa582728d71e35eca62fbcd"/><file name="icon-warning.gif" hash="3f20258272af0e00f6b7531b3b9aee35"/><file name="large-loading.gif" hash="d96f6517e00399c37a9765e045eaaf22"/><file name="left-btn.gif" hash="6bf30c6cf0b5d70436c3e463b5532b35"/><file name="loading-balls.gif" hash="ac062b94ed674aaa50a6c18df92acdf3"/><file name="right-btn.gif" hash="e7ad3a7f4814791cecf1b90e77e9e139"/><file name="shadow-c.png" hash="7ab6163237099f2529452b88953a4049"/><file name="shadow-lr.png" hash="986270d8ab4330fa7499dc33ed135598"/><file name="shadow.png" hash="860bf4f690d2ea2aba7b11500925da62"/><file name="warning.gif" hash="448dc934a7f0dd6092b51f88a1e47b2d"/></dir><dir name="sizer"><file name="e-handle-dark.gif" hash="b86289f41d7ad1a7401dd2b2a9b3c3d8"/><file name="e-handle.gif" hash="510edc95ebaa36306916c50ca10596f7"/><file name="ne-handle-dark.gif" hash="115f71b851c7f0b5f354caa7b8dfff15"/><file name="ne-handle.gif" hash="8e268b962dc909d275997b572ff17a72"/><file name="nw-handle-dark.gif" hash="4a361e6920b2e34a39fd425a515c83b9"/><file name="nw-handle.gif" hash="1120600505249c38c3d1cc2ab120cd13"/><file name="s-handle-dark.gif" hash="4a6bf15d308a4ae580dd03cbd431a95c"/><file name="s-handle.gif" hash="5e3338cb09e9df7f52383d6b1423fc86"/><file name="se-handle-dark.gif" hash="f3d8d8aac23e3e9633072e2366cda847"/><file name="se-handle.gif" hash="71edc3f63f79f447d2c81ee09e1fbbc3"/><file name="square.gif" hash="4431ea1954bfd2a9cea0931f07fc7ffa"/><file name="sw-handle-dark.gif" hash="44b2400d873cf8a23d84424827cde44d"/><file name="sw-handle.gif" hash="c3e0befc4208a51180344765fd7deeda"/></dir><dir name="slider"><file name="slider-bg.gif" hash="a6286f74e6de7414663483aa08305a2f"/><file name="slider-bg.png" hash="1fbffa04044bed9262836d2a710f9ee1"/><file name="slider-thumb.gif" hash="e8b6ac40fa2709692ed0d806ef90b0c3"/><file name="slider-thumb.png" hash="24a893c9606f3a6892eb62f29a08870c"/><file name="slider-v-bg.gif" hash="9d8e5f0a4afa0e2256b999c856ba1a9e"/><file name="slider-v-bg.png" hash="0682c28925a7296730f7f221e4a76b96"/><file name="slider-v-thumb.gif" hash="c871f735637e1c383862aacecabb554a"/><file name="slider-v-thumb.png" hash="2fc3430dc351d9a118e048b9aafb7c3c"/></dir><dir name="tab-bar"><file name="scroll-left.gif" hash="611cea625f98ee5c0204dc186da8a05e"/><file name="scroll-right.gif" hash="b31b5bb81129aa52755f7f0becedc624"/><file name="tab-bar-default-bg.gif" hash="d8e4c911af8cf8660fd598b0a004fbb4"/></dir><dir name="tip"><file name="tip-corners.gif" hash="679a8fd0e2d9aa18fedc2f2b4f6001bc"/><file name="tip-sides.gif" hash="f9f434277b451d60474db8756a506736"/></dir><dir name="toolbar"><file name="more.gif" hash="15c7a30d4131305b672fe1e76d962d4d"/><file name="scroll-left.gif" hash="90ed293465f6f6bbb6104e9285f60392"/><file name="scroll-right.gif" hash="086497e95d820d7c58a1be2293e6e4a6"/><file name="toolbar-default-bg.gif" hash="61b9dcfa93a445a8a7dbbfde6efd5ecf"/></dir><dir name="tools"><file name="tool-sprite-tpl.gif" hash="e0449768cd5dce80b18fac904818ab33"/><file name="tool-sprites.gif" hash="75106d9a5ffab255a5bb3792a2a16e16"/><file name="tools-sprites-trans.gif" hash="8331513f15bd26be38974a7d7fc4ee41"/></dir><dir name="tree"><file name="arrows.gif" hash="bd4ecad4870c5b23926742ddd1298584"/><file name="drop-above.gif" hash="d6b303cfa3de8784057d9d7e66cdaa86"/><file name="drop-add.gif" hash="95eb34ac70a1a3c95ef39ab826a89491"/><file name="drop-append.gif" hash="95eb34ac70a1a3c95ef39ab826a89491"/><file name="drop-below.gif" hash="55e5dbc9451cfa91423832260b0753aa"/><file name="drop-between.gif" hash="edb544a0de58547d4a39c526e06e3c82"/><file name="drop-no.gif" hash="67f83ea04a2eb1c50614a96faf625f25"/><file name="drop-over.gif" hash="d6b303cfa3de8784057d9d7e66cdaa86"/><file name="drop-under.gif" hash="55e5dbc9451cfa91423832260b0753aa"/><file name="drop-yes.gif" hash="f3216326c00890259e84f1726dd1043f"/><file name="elbow-end-minus-nl.gif" hash="04025031365f2bdb09169188eae9556b"/><file name="elbow-end-minus.gif" hash="b4ae35ce75b5bbe728fdeeb5ed89ac42"/><file name="elbow-end-plus-nl.gif" hash="d6343055539d3ae503329e65d0927c0d"/><file name="elbow-end-plus.gif" hash="46f4d75f43fff6fcd4b0b9aeda907e9c"/><file name="elbow-end.gif" hash="6748722c117147e321d0af952833109e"/><file name="elbow-line.gif" hash="765c70e58be8064da7ce8c01afb1f6c3"/><file name="elbow-minus-nl.gif" hash="04025031365f2bdb09169188eae9556b"/><file name="elbow-minus.gif" hash="01359f5b57c066f952c1d5a02f21a457"/><file name="elbow-plus-nl.gif" hash="d6343055539d3ae503329e65d0927c0d"/><file name="elbow-plus.gif" hash="e4385b53e7f15b43b74e9c3b46cfee77"/><file name="elbow.gif" hash="53321708a4948539bb8b4c8efeae39c7"/><file name="folder-open.gif" hash="2bf2623696392abc9b2853b59aab3bb5"/><file name="folder.gif" hash="d15144420ee39843bb27feb014ee4442"/><file name="leaf.gif" hash="23757d6e353f343e3c7edfe28428f198"/><file name="loading.gif" hash="00ef871b291bc03a497d608a5bd8ec99"/><file name="s.gif" hash="fc94fb0c3ed8a8f909dbc7630a0987ff"/></dir><dir name="util"><dir name="splitter"><file name="mini-bottom.gif" hash="ae8e3674fd32997dc5217d5d6199a5a5"/><file name="mini-left.gif" hash="8654fdb45ecf4406af2fce1d3beb7596"/><file name="mini-right.gif" hash="cbdf9fb0c45466b4217ac9f7bd6a9ed4"/><file name="mini-top.gif" hash="fbd91e98576f66fd2702495251b15240"/></dir></dir></dir></dir><file name="dnd_grid_to_grid.js" hash="057a8cbf8b255c1955c83ca249bd9ae8"/><file name="examples.js" hash="c34c39a3da1b2216f636778b26e10108"/><file name="ext-all.js" hash="33c8a2191d27ee2812d9e5469f094556"/></dir><dir name="jquery"><file name="jquery.min.js" hash="4c8cfcfcda2e9d34ba0097086a7bc328"/></dir><dir name="resources"><dir name="css"><file name="README.txt" hash="66440774774ca4995ad5137ac9ae48e0"/><file name="basic-dialog.css" hash="4cc973c87f79ea230f372cea597963ba"/><file name="box.css" hash="3809db7ee254d629d52dba0aad472d35"/><file name="button.css" hash="d3f29c8497579832fe5d7aafff7c3544"/><file name="combo.css" hash="483a1a701ca9c7db718e0e767f3d4585"/><file name="core.css" hash="6e82710d5206b6b7c0f70399cf649449"/><file name="date-picker.css" hash="fa68b668561d477e702318fb5d59636c"/><file name="dd.css" hash="f0e5f55969aeda8f65a01033613181c5"/><file name="debug.css" hash="6ef466c0c857e0c405cac7b8911f0824"/><file name="editor.css" hash="2fdb75e85a247c362285d4f079c0a12f"/><file name="ext-all.css" hash="c5e12af950c3ea3a243d0b9ca0dc4dba"/><file name="form.css" hash="38bd5bd602a83075325696af2c447e65"/><file name="grid.css" hash="c6d110f89542c04e4cbf98de73e97e9b"/><file name="layout.css" hash="89251906d248b3756f0ed354491651a6"/><file name="menu.css" hash="88eb8b3754612496ccf9d386694a39e0"/><file name="panel.css" hash="deaf7ccb5526687fadd67c093da9e604"/><file name="qtips.css" hash="2a6e683a7b23cbdf52177d7141d17435"/><file name="reset-min.css" hash="8fddbb1b7930f2817f2d5d215be98d5f"/><file name="resizable.css" hash="a50b8d1ea8e9dfbdd101a43bc63857c3"/><file name="tabs.css" hash="323d6f11f1550a43a02a617e39242ed5"/><file name="toolbar.css" hash="d09eb7507f57178967d217caeaa8b046"/><file name="tree.css" hash="b0104f954fbe1f04ebf49acffcec74ef"/><file name="ytheme-aero.css" hash="c25b48ba1b913f2ea094065fa916e9da"/><file name="ytheme-galdaka.css" hash="8b1917749205e64bdbcecc893e188b09"/><file name="ytheme-gray.css" hash="c45ba874b89038c9c8d9a79a1c591f26"/><file name="ytheme-magento.css" hash="94c3fc72743ad6d1fe7d8e74d713750e"/><file name="ytheme-vista.css" hash="2092ef97154cf5f6b33893bf5e178e21"/></dir><dir name="themes"><dir name="images"><dir name="default"><dir name="basic-dialog"><file name="btn-arrow.gif" hash="9e2365ef98c6096f6b5f411ab618bb4e"/><file name="btn-sprite.gif" hash="73a8327c23c12ed9ec42ac8f52b072e0"/><file name="close.gif" hash="2d54069e9355f295dd27027f7f779eb9"/><file name="collapse.gif" hash="63b2687a2dc81537765a7d22f9e480da"/><file name="e-handle.gif" hash="f9357e6c1dfbd00da007cf6705e08225"/><file name="expand.gif" hash="740af52fb7de6ca9fd888184e86a5308"/><file name="hd-sprite.gif" hash="6a54ae98bef53397d52282201852c204"/><file name="progress.gif" hash="baff9a083b93588fa7ff3548844a9e1a"/><file name="progress2.gif" hash="339036f9eb530c1b180c77f9a109ef3e"/><file name="s-handle.gif" hash="36b90844c0b35da23da21aac599957d4"/><file name="se-handle.gif" hash="668b22581100befcf947e806599dc0ce"/></dir><dir name="box"><file name="corners-blue.gif" hash="86fd4c5664e0971bfc11959e8442604c"/><file name="corners.gif" hash="d2d1bc2085b369ce35ffd20c0121676e"/><file name="l-blue.gif" hash="ced9ffbf66ea39e77083a591f8257267"/><file name="l.gif" hash="c4d9dbbdc59ae06b5e9e72a6a865c981"/><file name="r-blue.gif" hash="82dbb522a80e3246f6297719371a9494"/><file name="r.gif" hash="bf1e1d4a45f951ae656968a8c834f04a"/><file name="tb-blue.gif" hash="7c4b19eb682afdc1bde0640d2321fb25"/><file name="tb.gif" hash="dd3f63afe7ba90983ba73dad1c66bf2f"/></dir><dir name="dd"><file name="drop-add.gif" hash="95eb34ac70a1a3c95ef39ab826a89491"/><file name="drop-no.gif" hash="ae536c37391ba78143b5c8283cec8d13"/><file name="drop-yes.gif" hash="f3216326c00890259e84f1726dd1043f"/></dir><dir name="editor"><file name="tb-sprite.gif" hash="8908365d736426795ce46de7e328b508"/></dir><dir name="form"><file name="clear-trigger.gif" hash="97b3e5e9edf27b50d63d48098c2f1eae"/><file name="date-trigger.gif" hash="9245675ed8931df277184b419cf4cdad"/><file name="error-tip-corners.gif" hash="364474276178c7b48b6270056b42b808"/><file name="exclamation.gif" hash="40491021e901fa801dbbc09b6c59d73e"/><file name="search-trigger.gif" hash="559ef372cf27a38678d84e8c0b7237fc"/><file name="text-bg.gif" hash="d5ba54c1f417e6a72cbce8b909078727"/><file name="trigger-tpl.gif" hash="d7be20f0dc38f4f46cd318fe32cf3ce3"/><file name="trigger.gif" hash="45019efdf75528242c5a68742821dc57"/></dir><file name="gradient-bg.gif" hash="e117fca9d088e4cd5bbbcec7b99a8408"/><dir name="grid"><file name="Thumbs.db" hash="c3affff39ba36b80da43a08c34a61391"/><file name="arrow-left-white.gif" hash="b04e859bdcbd21ad1f06b8bfa7881df8"/><file name="arrow-right-white.gif" hash="714eb00f8134dde3a65c83f3f71ad2c4"/><file name="col-move-bottom.gif" hash="9c38bcb5cee1dc9b4ce64ad9ab1386f8"/><file name="col-move-top.gif" hash="c4584202d5172464050f675d396d1c6f"/><file name="dirty.gif" hash="decca3b96e2c37cf6eb04ddb0d9f669b"/><file name="done.gif" hash="365266930a93451414fe51ffc524a196"/><file name="drop-no.gif" hash="b53ca86d60fbcc7a45c8917299218bfd"/><file name="drop-yes.gif" hash="af96f4c3b32a470db2f38abb521b5c97"/><file name="footer-bg.gif" hash="65ed63e44c6149f1127ad3b4be4e0108"/><file name="grid-blue-hd.gif" hash="dd35d5c1202c440c2d1a945b335984d3"/><file name="grid-blue-split.gif" hash="0494ba49974ff2bc1bf81e1d82dfee18"/><file name="grid-hrow.gif" hash="55972a5063d80f35fb6b95a79bb0018a"/><file name="grid-loading.gif" hash="9ac6f737eb9b15272f12b00bfeb3c3c6"/><file name="grid-split.gif" hash="3ef419d4b9421d8e94f673a6238dc4c0"/><file name="grid-vista-hd.gif" hash="675f403e8a9cb5ab4bed725da9fe2023"/><file name="grid3-hd-btn.gif" hash="e3e77072c16a6b27556236961f29c552"/><file name="grid3-hrow-over.gif" hash="a92d8f6c106943995720f2884634670e"/><file name="grid3-hrow.gif" hash="4c58074bb961c8f184522355f1b0eb90"/><file name="grid3-special-col-bg.gif" hash="c9df03a1c107360128da89fa47066405"/><file name="grid3-special-col-sel-bg.gif" hash="a94039f89dec164896ceff1fbdf6dbc5"/><file name="hd-pop.gif" hash="e5f27a2f68cc2d13b11cf41c46d298dc"/><file name="hmenu-asc.gif" hash="048e0bc30f7c39d473dad5dabcbe03f2"/><file name="hmenu-desc.gif" hash="f0a987b34b003b25a7c82624d41f018a"/><file name="hmenu-lock.gif" hash="bcef18e25342c69c37c44dab87086065"/><file name="hmenu-lock.png" hash="2a3b0b441834f443c1086930939efdae"/><file name="hmenu-unlock.gif" hash="8cc8205dafa587ef02d8a86903ae8074"/><file name="hmenu-unlock.png" hash="c1f61df70b98c5498ea81e7e7b9effbb"/><file name="invalid_line.gif" hash="04a88e97b56e8a8ece4a66d49cc78828"/><file name="loading.gif" hash="00ef871b291bc03a497d608a5bd8ec99"/><file name="mso-hd.gif" hash="37fba9c02f0eefe57f655890eef1c4a1"/><file name="nowait.gif" hash="23c91166dbb16ba8655363321bf5a400"/><file name="page-first-disabled.gif" hash="8d3185028c541cbcce67b5909c04824e"/><file name="page-first.gif" hash="16ec00fa770d860b768cf5034ddfca96"/><file name="page-last-disabled.gif" hash="1d123237ceeb5109a1b9274f0cf19d73"/><file name="page-last.gif" hash="ef524dd0b8dfe4eefecffaa1c0bb8edd"/><file name="page-next-disabled.gif" hash="0f4b8681772c91921fa93ede9c755ea0"/><file name="page-next.gif" hash="f6f9d2209dfc99912ffc9848d97646db"/><file name="page-prev-disabled.gif" hash="eefcbed15c8d37a89618b08f7b224297"/><file name="page-prev.gif" hash="80daad880483eed682b22ec70514ecc4"/><file name="pick-button.gif" hash="b431fdf306f1e2f033d0a431996de93f"/><file name="refresh.gif" hash="8dae08d3581dcd9a04ca73877eab4b53"/><file name="row-check-sprite.gif" hash="2d0aa7e501c3e6f97a97faf75e35d3c3"/><file name="row-expand-sprite.gif" hash="be81199d9d4fa69bef47a8f036a5a7d8"/><file name="row-over.gif" hash="f639094bd0560aefabc86e51a825f23d"/><file name="row-sel.gif" hash="ca87d6b950386edd5e17c985769d9101"/><file name="sort_asc.gif" hash="cc186187e31b0c39abbb7d2394916292"/><file name="sort_desc.gif" hash="fcfe91243fac2e5f24d05bb44f78ded4"/><file name="wait.gif" hash="b0cd5a5dc070c705ebf8814a909802c3"/></dir><dir name="layout"><file name="collapse.gif" hash="dfcec0803d488a783916c750fd83a897"/><file name="expand.gif" hash="c9c9b0ea5311c3dc016c69dc234912bc"/><file name="gradient-bg.gif" hash="e117fca9d088e4cd5bbbcec7b99a8408"/><file name="ns-collapse.gif" hash="efa9fbd7a1f3f0f1f22360391e16126f"/><file name="ns-expand.gif" hash="da1f9d40c091d3b6dc7a8dee4fc02ac6"/><file name="panel-close.gif" hash="b185da1837344529bfb684a96d8371b5"/><file name="panel-title-bg.gif" hash="b66384c309a397963389a76b07e9ecd4"/><file name="panel-title-light-bg.gif" hash="688d3a263442db125da170e5d3aebf70"/><file name="stick.gif" hash="be9e67ae0b61b01cfd15928ca7a3da51"/><file name="stuck.gif" hash="745e0cacb51250ea0216efc4a1cb50cb"/><file name="tab-close-on.gif" hash="0ae2c978e85391a69f0dce8da18d8b23"/><file name="tab-close.gif" hash="f92107cc6b4cb78af084648a628e01d2"/></dir><dir name="menu"><file name="checked.gif" hash="692bc97badf50c05495f6109143b4b11"/><file name="group-checked.gif" hash="f7973443d91e5e074013f1b07ee79479"/><file name="menu-parent.gif" hash="d303ad7e3ced891736e80f77e1d4e51d"/><file name="menu.gif" hash="5d34732294bbe06a862961dd02bcc962"/><file name="unchecked.gif" hash="9b90ed7c9e8f0892ce09f3b35b19db53"/></dir><dir name="panel"><file name="corners-sprite.gif" hash="06daef2335218cdfd900ce8bf7a68738"/><file name="left-right.gif" hash="49344fefef7c6f866f910b9067f0990f"/><file name="tool-sprite-tpl.gif" hash="e0449768cd5dce80b18fac904818ab33"/><file name="tool-sprites.gif" hash="31ccd74ac8dab4b5669887310a2341df"/><file name="top-bottom.gif" hash="d9a86e8466a31bd1cb87aae2cf55faf2"/><file name="white-corners-sprite.gif" hash="de8b3036676d19b9635f319a8a4aad36"/><file name="white-left-right.gif" hash="77a6389c6737ad507ca5330ad8816524"/><file name="white-top-bottom.gif" hash="f865d7237bff3c45fd4a8c448f97d236"/></dir><dir name="qtip"><file name="bg.gif" hash="49c0a530cc16357bb39d51c13065a88f"/><file name="close.gif" hash="0379d036250096cae2e42b427b3df2e7"/><file name="tip-sprite.gif" hash="11637a20b1f3f2331bf0627146c2f433"/></dir><file name="s.gif" hash="fc94fb0c3ed8a8f909dbc7630a0987ff"/><file name="shadow-c.png" hash="3abbfce345687daada53445adf6fddc7"/><file name="shadow-lr.png" hash="986270d8ab4330fa7499dc33ed135598"/><file name="shadow.png" hash="860bf4f690d2ea2aba7b11500925da62"/><dir name="shared"><file name="calendar.gif" hash="81296cff1f97f5365524f2b9dcf626da"/><file name="glass-bg.gif" hash="bc2cd5c5ac9b3874d956c892d23f2119"/><file name="left-btn.gif" hash="6bf30c6cf0b5d70436c3e463b5532b35"/><file name="right-btn.gif" hash="e7ad3a7f4814791cecf1b90e77e9e139"/><file name="warning.gif" hash="448dc934a7f0dd6092b51f88a1e47b2d"/></dir><dir name="sizer"><file name="e-handle-dark.gif" hash="b86289f41d7ad1a7401dd2b2a9b3c3d8"/><file name="e-handle.gif" hash="510edc95ebaa36306916c50ca10596f7"/><file name="ne-handle-dark.gif" hash="115f71b851c7f0b5f354caa7b8dfff15"/><file name="ne-handle.gif" hash="8e268b962dc909d275997b572ff17a72"/><file name="nw-handle-dark.gif" hash="4a361e6920b2e34a39fd425a515c83b9"/><file name="nw-handle.gif" hash="1120600505249c38c3d1cc2ab120cd13"/><file name="s-handle-dark.gif" hash="4a6bf15d308a4ae580dd03cbd431a95c"/><file name="s-handle.gif" hash="5e3338cb09e9df7f52383d6b1423fc86"/><file name="se-handle-dark.gif" hash="f3d8d8aac23e3e9633072e2366cda847"/><file name="se-handle.gif" hash="71edc3f63f79f447d2c81ee09e1fbbc3"/><file name="square.gif" hash="4431ea1954bfd2a9cea0931f07fc7ffa"/><file name="sw-handle-dark.gif" hash="44b2400d873cf8a23d84424827cde44d"/><file name="sw-handle.gif" hash="c3e0befc4208a51180344765fd7deeda"/></dir><dir name="tabs"><file name="tab-btm-inactive-left-bg.gif" hash="4f141a6abf25d3c9409b6c381333c138"/><file name="tab-btm-inactive-right-bg.gif" hash="eb2423d3b9dd072976ce955ab0c683d6"/><file name="tab-btm-left-bg.gif" hash="a36eb9382ed8b858eff2c5d4e5d7011a"/><file name="tab-btm-right-bg.gif" hash="9e4245776f0f7b6b6c7ddbf40a43103a"/><file name="tab-sprite.gif" hash="6a7d481bf5b74acfbfa0b01a35bd6620"/></dir><dir name="toolbar"><file name="btn-arrow-light.gif" hash="fa49b39a0fd88ef26264da44a2b4edea"/><file name="btn-arrow.gif" hash="12bda29a4c8016cfa047e852c4353f59"/><file name="btn-over-bg.gif" hash="faddf9b24cefa721326ba3f87f3ef31f"/><file name="gray-bg.gif" hash="cf2d9408f320e696e607d8472afa7ff0"/><file name="tb-bg.gif" hash="5309337fd7a22cab9d9467fd9eaa0a0c"/><file name="tb-btn-sprite.gif" hash="3aed28dd646d22e215c8a6a3e983322f"/></dir><dir name="tree"><file name="drop-add.gif" hash="95eb34ac70a1a3c95ef39ab826a89491"/><file name="drop-between.gif" hash="edb544a0de58547d4a39c526e06e3c82"/><file name="drop-no.gif" hash="67f83ea04a2eb1c50614a96faf625f25"/><file name="drop-over.gif" hash="d6b303cfa3de8784057d9d7e66cdaa86"/><file name="drop-under.gif" hash="55e5dbc9451cfa91423832260b0753aa"/><file name="drop-yes.gif" hash="f3216326c00890259e84f1726dd1043f"/><file name="elbow-end-minus-nl.gif" hash="5e5bffba157eceee7989db95b919e4d5"/><file name="elbow-end-minus.gif" hash="a469f6a4394d797c2efeffc70409f6db"/><file name="elbow-end-plus-nl.gif" hash="f0f50c0dd3ee6dd4b11c1f245b36eb01"/><file name="elbow-end-plus.gif" hash="ec1482391363612d9e5f8c7087fddaba"/><file name="elbow-end.gif" hash="345551384aa325189ba28a1c20f3405e"/><file name="elbow-line.gif" hash="90e478158df476dc989a60daaafc87e6"/><file name="elbow-minus-nl.gif" hash="5e5bffba157eceee7989db95b919e4d5"/><file name="elbow-minus.gif" hash="71bb1bd44b1274c60d30dba1de472ed7"/><file name="elbow-plus-nl.gif" hash="f0f50c0dd3ee6dd4b11c1f245b36eb01"/><file name="elbow-plus.gif" hash="945572d06a74b5f952251a86c595f2da"/><file name="elbow.gif" hash="27679f3b1222ba95d9925885d7d82d02"/><file name="folder-open.gif" hash="c569141d6ae7c61d838ed8af26aa9380"/><file name="folder.gif" hash="b7209740bb4a825a06beb8698d92c2b1"/><file name="leaf.gif" hash="23757d6e353f343e3c7edfe28428f198"/><file name="loading.gif" hash="00ef871b291bc03a497d608a5bd8ec99"/><file name="s.gif" hash="fc94fb0c3ed8a8f909dbc7630a0987ff"/></dir><dir name="window"><file name="corners-sprite.gif" hash="b485d6e69678822a0fb77cc312487874"/><file name="left-right.gif" hash="3fe626d6ca2f71d36fc62c32cb1cc52a"/><file name="top-bottom.gif" hash="8a227016c401438e602c2f770a611d5b"/></dir></dir><dir name="magento"><dir name="basic-dialog"><file name="collapse-on.gif" hash="b60dfdc0d00cfb30a8a622e0c22eed84"/><file name="collapse.gif" hash="8525b9d2e93d31e0b071b1f9bf9550e5"/><file name="expand-on.gif" hash="0dfb4ac6d626cdcaa931c14dbb45848e"/><file name="expand.gif" hash="0eb5c03da8b8415e0568784c959e536a"/><file name="hd-sprite.gif" hash="035bf2296afd70af7020cf06b60bf3f6"/><file name="ns-collapse-on.gif" hash="88ed8b7578c803f68d9f1eb171454e00"/><file name="ns-collapse.gif" hash="44b91376c040f91672aaa98c1fcc062b"/><file name="ns-expand-on.gif" hash="587c2ce90066280e5e6cd731bb9d346c"/><file name="ns-expand.gif" hash="57b479b168f8a54200bd1770b5591630"/><file name="panel_close.gif" hash="686c6dfcf341de25487ab4d8ea5954ce"/><file name="pop_close.gif" hash="dd3605531f9959901eff6f089f084bdc"/><file name="pop_collapse.gif" hash="2b8007242ae1c9ae9f26c60a878a63f7"/></dir><dir name="grid"><file name="grid-body-bg.gif" hash="b5fe585c01f57b2171a2b723abcc4a38"/><file name="grid-split.gif" hash="32e210451e8dc4295b53cf7ca13bb4a6"/></dir><dir name="layout"><file name="checkered-bg.gif" hash="f0a0cd29a6120377c289fd39e2ee7e80"/><file name="icon-catalog.gif" hash="435ff2300ddefb9f8a4bad8ee806fb1a"/><file name="icon-category.gif" hash="ce2a146851bb5ec1e41670b68183b56a"/><file name="icon-my-tasks.gif" hash="0ecb888b160701845e25a7140d038af0"/><file name="icon-product.gif" hash="a0707878c5221052209e5ae6a4de0bd2"/></dir><file name="loading_bg.gif" hash="e202ef7e03d0ef3e9beac7480dae65bf"/><dir name="tabs"><file name="tab-sprite.gif" hash="049fb2f4186b6dc9de747ad96456b1ab"/></dir><dir name="toolbar"><file name="btn-arrow.gif" hash="938cffb6de5cc8b1febfd1851fd983c2"/><file name="header_bg.gif" hash="3696842a32740fa159484cabc3340d13"/><file name="toolbar-bg.gif" hash="8d1b465c2a75963407b536d9081f649f"/></dir><dir name="tree"><file name="elbow-end-minus-nl.gif" hash="6dc08c43109cc6a365bd0270f05e2f1c"/><file name="elbow-end-minus.gif" hash="3dbdb88a9297fe5631e832f046b0350b"/><file name="elbow-end-plus-nl.gif" hash="6dc08c43109cc6a365bd0270f05e2f1c"/><file name="elbow-end-plus.gif" hash="5470e5712a9742ba666c26cb429baaeb"/><file name="elbow-end.gif" hash="63fe879440e2784e0cc0d316ce017745"/><file name="elbow-line.gif" hash="b316a39455304e20e01dbc437f57fd32"/><file name="elbow-minus-nl.gif" hash="0e3129bff70475c8f7f297e0e59d1608"/><file name="elbow-minus.gif" hash="e7b18ff6800e65c6e171bbb2a911762e"/><file name="elbow-plus-nl.gif" hash="78a8f737941fa658f1e770258a3791cd"/><file name="elbow-plus.gif" hash="b02cb264df55aef2105b1b245d075e56"/><file name="elbow.gif" hash="b6bd0e0237e3cd413fa2dac27701c724"/><file name="folder-open.gif" hash="e3cd196406d4857dc0c926807f16c409"/><file name="folder.gif" hash="03eb26c42137ac792609822862ef4d0f"/><file name="leaf.gif" hash="e3cd196406d4857dc0c926807f16c409"/><file name="s.gif" hash="df3e567d6f16d040326c7a0ea29a4f41"/></dir></dir></dir></dir></dir></dir><file name="ranking.js" hash="bbdbf7077ae6ffeb65b5f0b50bb3204f"/><file name="vendorhistory.css" hash="1c6ac4db45e2f234749b8b71f285fe00"/></dir></dir><dir name="includes"><dir name="src"><dir name="Logicbroker"><dir name="Dropship360"><dir name="controllers"><dir name="Adminhtml"><file name="InventoryController.php" hash="8c8df2448896a6dab42e131f1e5dee68"/><file name="LogicbrokerController.php" hash="0cf5f0ef8f84170b3c9f3749d3050128"/><file name="RankingController.php" hash="2a709afdad369cbb29c4dfa5f091fa64"/><file name="ReportController.php" hash="023e1acb60ef84290573df5a05281c90"/><file name="SourcingController.php" hash="35fb58b6b81fa1324ecd95b85abf0429"/><file name="UploadController.php" hash="fc31c7daea4eb49e8ee030fead1f3c50"/></dir></dir></dir></dir><file name="Logicbroker_Dropship360_Block_Adminhtml_Inventory.php" hash="99a5d1a58c1dc6ef2cc56ae9fc5b6481"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Inventory_Edit_Tab_Addvendorfield.php" hash="af6a5039e07a8f610a50baaceec5465b"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Inventory_Edit_Tab_Lbvendor.php" hash="67d2d2b7e825f63bff4d343bc1cf8aa4"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Inventory_Edit_Tab_Vendortabhistory.php" hash="69fbc5a2cd3fb1d010a613943f7a951c"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Inventory_Edit_Vendortab.php" hash="814752c7c23059c93eb4fdc41a32bdd2"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Inventory_Edit_Vendortabhistory.php" hash="c3a43db297bc516fac6f1a2beb2680c4"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Inventory_Grid.php" hash="55a9058cdf9004c4f944d5722c1e5ede"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Logicbroker.php" hash="239a7cefa7386a8d3b40ad78422d1ae4"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Notification.php" hash="18d8754907908e0262c087d573f934a5"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Ranking.php" hash="42e39843931b6030840f8c3161ec84b6"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Ranking_Grid.php" hash="52407d6d50481bc32c391e3e09e2a7a1"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor.php" hash="750b5adec9792b9bdc593921b3e86a16"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor_Email.php" hash="b153871bad4a1599a2f9b4165c4287f2"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor_Form.php" hash="33d12cac623619efaaac0325f19452b8"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor_Grid.php" hash="fd9a2f6af14688fdc19a72803e319ece"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Reports_Activitymonitor_Periodopen.php" hash="6297aefbe9fc2f7c9449e1b461afe075"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Reports_Form_Timestatus.php" hash="ef5b8206b1c0e71cd1d3ad6c31923a8a"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Reports_Staticemailgrid.php" hash="078130167406426bad0e577d1fc4b0ce"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Sales_Order_View_Items.php" hash="acb46509068da360104a0c8cada453da"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Showhistory.php" hash="a82540104538beaa185238b4931fdb14"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Sourcing.php" hash="d94b0f3a7e4d290d71f69064cbe98282"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Sourcing_Edit.php" hash="767bcde378baf0ff1196598e0c466fc5"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Sourcing_Edit_Form.php" hash="e6b0312f4fc38b771089fbb1815578ef"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Sourcing_Edit_Tab_Form.php" hash="d0d9a417b1e59d06030ff7a65c6cbc88"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Sourcing_Edit_Tabs.php" hash="5298c26c63035ff916a986c8072c8d0b"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Sourcing_Grid.php" hash="8c1ab115b99ea39900dccd60ee7ac651"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Sourcing_History_Renderer_Action.php" hash="edea4e5929b246ff70d063aa5845b3f9"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Sourcing_History_View.php" hash="02be1363be1b4610bdee1dbc7cc2ba34"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Sourcing_History_View_Form.php" hash="9da38c9ec7e580f660155ec62d7e0eeb"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Sourcing_History_View_Tabs.php" hash="94ffa503cf28c9fa63076f84c02b9cee"/><file name="Logicbroker_Dropship360_Block_Adminhtml_System_Config_Crontime.php" hash="b81ffae42850e8171d357f911a0e11fc"/><file name="Logicbroker_Dropship360_Block_Adminhtml_System_Config_Fieldset_Hint.php" hash="72f6124a380765b0142ebecd9cbfb6cf"/><file name="Logicbroker_Dropship360_Block_Adminhtml_System_Config_Ftpconnectionbutton.php" hash="f7d562a0e7377c85083f0d2fe14fea08"/><file name="Logicbroker_Dropship360_Block_Adminhtml_System_Config_Helplink.php" hash="0d0427b473f8a343efa394c4a0853942"/><file name="Logicbroker_Dropship360_Block_Adminhtml_System_Config_Singuplink.php" hash="a6927e292ac86b35339a5029034b5ac2"/><file name="Logicbroker_Dropship360_Block_Adminhtml_System_Config_Submitbutton.php" hash="7ce0fade94eede8db6ff04c0dbe50dac"/><file name="Logicbroker_Dropship360_Block_Adminhtml_System_Config_Time.php" hash="74a40038b4a50994296b0cb7fce2947f"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Upload.php" hash="42c6c3cdcc0a6a015c567a83997d85a3"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Upload_Bulkassign.php" hash="bd462fdca45aec2dc8e762237ceefe1b"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Upload_Edit_Button.php" hash="7b98d1326c1f93bc643e1463242224a2"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Upload_Edit_Form.php" hash="50eff157cd1fe36cc670786f053ae939"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Vendorproductuploadhistory.php" hash="135610c201ebde49e396ca2685249ccc"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Widget_Grid_Column_Nameaction.php" hash="bd171423eec53f92fda759bf4d3624f1"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Widget_Grid_Column_Orderaction.php" hash="842701da280c25c3c552b05d7c06413e"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Widget_Grid_Column_Skuaction.php" hash="0c4477b7bdabcc81da134929b2926ef7"/><file name="Logicbroker_Dropship360_Block_Adminhtml_Widget_Grid_Column_Textaction.php" hash="9855312bb0dcac85104f7f0cd4a51054"/><file name="Logicbroker_Dropship360_Helper_Data.php" hash="ee1785693bb5bddbb4c4452e678960d8"/><file name="Logicbroker_Dropship360_Model_Api2_Createroleandrule.php" hash="71ece80df5c5c87e13075841a1f9f4e1"/><file name="Logicbroker_Dropship360_Model_Api2_Inventory.php" hash="9d08c98e36b9c232b9d796a418aac383"/><file name="Logicbroker_Dropship360_Model_Api2_Inventory_Rest.php" hash="b7e996ed201e1d1e0239d6d226ef1007"/><file name="Logicbroker_Dropship360_Model_Api2_Inventory_Rest_Admin_V1.php" hash="a6a58df3d657dbe8b8f42da5e107a212"/><file name="Logicbroker_Dropship360_Model_Api2_Inventory_Rest_Customer_V1.php" hash="c0327118b69995896f78acd7907fa71f"/><file name="Logicbroker_Dropship360_Model_Api2_Inventory_Rest_Guest_V1.php" hash="1c3f3a1a87ccd9bd1120138d8369229d"/><file name="Logicbroker_Dropship360_Model_Api2_Product.php" hash="5ced4e9d325db0cf6f748a13c8384298"/><file name="Logicbroker_Dropship360_Model_Api2_Product_Rest.php" hash="f423598eb3ae1871d8b4a326f7dda181"/><file name="Logicbroker_Dropship360_Model_Api2_Product_Rest_Admin_V1.php" hash="6f4acb240c2875694c9a710bfec844c4"/><file name="Logicbroker_Dropship360_Model_Api2_Product_Rest_Customer_V1.php" hash="c0327118b69995896f78acd7907fa71f"/><file name="Logicbroker_Dropship360_Model_Api2_Product_Rest_Guest_V1.php" hash="0f4c46ad1ef2e6fefd1fdbda4034ad85"/><file name="Logicbroker_Dropship360_Model_Csvparser.php" hash="6b4810b688501b741c89bf04b5ab30b6"/><file name="Logicbroker_Dropship360_Model_Inventory.php" hash="f9c1489738188804a835641a76e29d85"/><file name="Logicbroker_Dropship360_Model_Inventorylog.php" hash="208f743adec62a2d8117120cf42ef342"/><file name="Logicbroker_Dropship360_Model_Logicbroker.php" hash="99124a4b0cf794f894e9725bf4d7589b"/><file name="Logicbroker_Dropship360_Model_Observer.php" hash="36fb3b2090cab1162a00e0769878b08b"/><file name="Logicbroker_Dropship360_Model_Order_Api.php" hash="883eb8772a085238c1d87893ad8f326e"/><file name="Logicbroker_Dropship360_Model_Orderitems.php" hash="54ed3910268b9a6828f44d0fbde92e12"/><file name="Logicbroker_Dropship360_Model_Ordersourcing.php" hash="cb43e6b2763d874c0579c26fdffd6598"/><file name="Logicbroker_Dropship360_Model_Productimport.php" hash="7feece453157d3930e7866b48afaa6f6"/><file name="Logicbroker_Dropship360_Model_Ranking.php" hash="96905331a59e81a2a0d54cff032c82fc"/><file name="Logicbroker_Dropship360_Model_Rankinglog.php" hash="094334cf66c9ce7304c87082570a496d"/><file name="Logicbroker_Dropship360_Model_Report.php" hash="ae7188a15da1892667de020648d6b4af"/><file name="Logicbroker_Dropship360_Model_Resource_Inventory.php" hash="105f54b381ac6cde7ba6e4ff01435083"/><file name="Logicbroker_Dropship360_Model_Resource_Inventory_Collection.php" hash="4a0707fc5d728c872a7df48a372e3411"/><file name="Logicbroker_Dropship360_Model_Resource_Inventorylog.php" hash="9821c43afd97cef8608b08c634456dd3"/><file name="Logicbroker_Dropship360_Model_Resource_Inventorylog_Collection.php" hash="1a24af879a980509fc049106dfa7ed17"/><file name="Logicbroker_Dropship360_Model_Resource_Orderitems.php" hash="2f5611b00cf0b15994047a85476764d5"/><file name="Logicbroker_Dropship360_Model_Resource_Orderitems_Collection.php" hash="09ca1baa286ba8dbe2d8636041afc183"/><file name="Logicbroker_Dropship360_Model_Resource_Ordersourcing.php" hash="6c9903c47b98b1032ed262578b15d5f2"/><file name="Logicbroker_Dropship360_Model_Resource_Ordersourcing_Collection.php" hash="a4341add3d2e4ed0d4fec5b5ead2b391"/><file name="Logicbroker_Dropship360_Model_Resource_Ranking.php" hash="e728c7db906f4257c9fa2828f3b1889c"/><file name="Logicbroker_Dropship360_Model_Resource_Ranking_Collection.php" hash="2c5f73589c3cf1cc61d82ff3184e9180"/><file name="Logicbroker_Dropship360_Model_Resource_Rankinglog.php" hash="280ca665631b7dfdc5fd65bdd37dd977"/><file name="Logicbroker_Dropship360_Model_Resource_Rankinglog_Collection.php" hash="847f4a313b4c57f1943667a743fb1876"/><file name="Logicbroker_Dropship360_Model_Resource_Setup.php" hash="db1b106449549a4d6a94e115b35f36d3"/><file name="Logicbroker_Dropship360_Model_Resource_Uploadvendor.php" hash="cdea6d41186776859dd4ff1b903631e0"/><file name="Logicbroker_Dropship360_Model_Resource_Uploadvendor_Collection.php" hash="c00c646cd30ea2846eaf64aebfa60d81"/><file name="Logicbroker_Dropship360_Model_Resource_Vendorimportlog.php" hash="5612cc9ad31e26537854803cf48cd83c"/><file name="Logicbroker_Dropship360_Model_System_Config_Backend_Oudatedinventory_Email.php" hash="3c0a74ca609f55dcbffb9eec2ec61eaa"/><file name="Logicbroker_Dropship360_Model_System_Config_Backend_Report_Email.php" hash="b8add0d41e93c027e056103eb2ffd784"/><file name="Logicbroker_Dropship360_Model_System_Config_Backend_Sourcing_Cronbackorder.php" hash="b653137f284099cda52229ca4a03032a"/><file name="Logicbroker_Dropship360_Model_System_Config_Backend_Sourcing_Cronsourcing.php" hash="e344d67cb474c67d39453cbfb90ae010"/><file name="Logicbroker_Dropship360_Model_System_Config_Backend_Uploadvendor_Cron.php" hash="d7ab43d34129359aaca41be3f8510e7a"/><file name="Logicbroker_Dropship360_Model_System_Config_Source_Attributecodes.php" hash="f97c33f5918714fccab7eb49119a8b95"/><file name="Logicbroker_Dropship360_Model_System_Config_Source_Category.php" hash="c5b9a7f9b613f8abe98c2419d802ab5c"/><file name="Logicbroker_Dropship360_Model_System_Config_Source_Ediqualifier.php" hash="ac6c52c324204bd2062c0361c64e27b6"/><file name="Logicbroker_Dropship360_Model_System_Config_Source_Ftptype.php" hash="66fc7d9ba1926a043060557f8ce87061"/><file name="Logicbroker_Dropship360_Model_System_Config_Source_Optionvalues.php" hash="48dc60144b3e8dae327e42c5bb567608"/><file name="Logicbroker_Dropship360_Model_System_Config_Source_Ranktype.php" hash="4a2a731340fd142ab77b75d64ac91ef8"/><file name="Logicbroker_Dropship360_Model_System_Config_Source_Store.php" hash="eaa19dfd1575ac6f851f115dd501fbf2"/><file name="Logicbroker_Dropship360_Model_System_Config_Source_Time.php" hash="7ccf6ebc62220eb3861b6ae3c91e7cfa"/><file name="Logicbroker_Dropship360_Model_System_Config_Source_Vendorlist.php" hash="535eea5a21a3c027a232cd1285a0120b"/><file name="Logicbroker_Dropship360_Model_Uploadvendor.php" hash="4f3f408b07c0b06ba1133542257c46a6"/><file name="Logicbroker_Dropship360_Model_Versions_Api.php" hash="7fc94e25af730bd4b8f48dbc8603bf7b"/><file name="Logicbroker_Dropship360_Model_Versions_Api_V2.php" hash="6def122e3c99344db1d10dc0b4ccfaa3"/></dir></dir><dir name="media"><dir name="logicbroker"><file name="Supplier_Ranking.png" hash="4390fdd6c9a3813ba716d50aa3a0dc2c"/><file name="System_Setup_Update.png" hash="b70cfea7eb0a4b02562d3d851c8a90a0"/><file name="System_Setup_Update_Step2.png" hash="719655c99dbaa771654551e1c496a708"/></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>