Bluefish_Connection - Version 1.1.5

Version Notes

This extension can be used by the users of bluefishretail,by providing appropriate credentials,given to them by bluefishretail.

Download this release

Release Info

Developer J Doyle
Extension Bluefish_Connection
Version 1.1.5
Comparing to
See all releases


Code changes from version 1.1.4 to 1.1.5

app/code/local/Bluefish/Connection/Model/Cronobserver.php CHANGED
@@ -103,9 +103,13 @@ class Bluefish_Connection_Model_Cronobserver extends Bluefish_Connection_Adminht
103
  }
104
  $this->postAction('5');
105
  }
106
- public function categoryCSVExport() ### This Function is used for customer data Export
107
  {
108
  $this->postAction('7');
109
  }
 
 
 
 
110
  }
111
  ?>
103
  }
104
  $this->postAction('5');
105
  }
106
+ public function categoryCSVExport() ### This Function is used for category data Export in csv
107
  {
108
  $this->postAction('7');
109
  }
110
+ public function productCSVExport() ### This Function is used for product data Export in csv
111
+ {
112
+ $this->postAction('10');
113
+ }
114
  }
115
  ?>
app/code/local/Bluefish/Connection/controllers/Adminhtml/BluestoreschedulerController.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Monitor Schedule Task controller
4
  *
5
- * @author Yuvarj Singh
6
  */
7
  class Bluefish_Connection_Adminhtml_BluestoreschedulerController extends Mage_Adminhtml_Controller_Action {
8
 
2
  /**
3
  * Monitor Schedule Task controller
4
  *
5
+ * @author Bluefishretail
6
  */
7
  class Bluefish_Connection_Adminhtml_BluestoreschedulerController extends Mage_Adminhtml_Controller_Action {
8
 
app/code/local/Bluefish/Connection/controllers/Adminhtml/MyformController.php CHANGED
@@ -79,6 +79,12 @@ class Bluefish_Connection_Adminhtml_MyformController extends Mage_Adminhtml_Cont
79
  {
80
  $appBaseDir = Mage::getBaseDir();
81
  $xmlFiles = $appBaseDir."/products_bluestore.xml";
 
 
 
 
 
 
82
  $fh = fopen($xmlFiles, 'w+');
83
  fwrite($fh, $response);
84
  fclose($fh);
@@ -346,16 +352,28 @@ class Bluefish_Connection_Adminhtml_MyformController extends Mage_Adminhtml_Cont
346
  $countSuccess = 0;
347
  foreach($ResposeData as $row)
348
  {
 
 
349
  if($row->batchSuccess == "true")
350
  {
351
- $code = strval($row->transaction['docNo']);
352
- $connection->query("INSERT INTO ".$prefix."bluefish_sale_post(id,order_id,posted_time)
353
- VALUES('','".$code."','".now()."')");
 
 
 
 
 
 
 
 
 
 
354
  $countSuccess++;
355
  }
356
  else
357
  {
358
- $ErrorMsg .= $row->transaction->message.":";
359
  }
360
  }
361
  if($ErrorMsg != "" || $xmlData->message !="")
@@ -810,17 +828,11 @@ class Bluefish_Connection_Adminhtml_MyformController extends Mage_Adminhtml_Cont
810
  {
811
  $categoryCodeValue = $catcodeVal['code'];
812
  $responseValue = "";
 
813
 
814
  $array=array();
815
 
816
- if($mainVersionVal == '0')
817
- {
818
- $array=array('where'=>rawurlencode('categoryCode = '.$categoryCodeValue.''));
819
- }
820
- else
821
- {
822
- $array=array('where'=>rawurlencode('version > '.$mainVersionVal.''));
823
- }
824
 
825
  $auth = build_auth_array($baseurl, $credentials['mycustom_code'],$permFile,$array);
826
 
@@ -839,6 +851,7 @@ class Bluefish_Connection_Adminhtml_MyformController extends Mage_Adminhtml_Cont
839
  curl_setopt($tuCurl, CURLOPT_HTTPHEADER, array("Accept: application/xml"));
840
  $response = curl_exec($tuCurl);
841
  $response1 = curl_getinfo( $tuCurl );
 
842
 
843
  if($response != "")
844
  {
79
  {
80
  $appBaseDir = Mage::getBaseDir();
81
  $xmlFiles = $appBaseDir."/products_bluestore.xml";
82
+
83
+ if(file_exists($xmlFiles))
84
+ {
85
+ unlink($xmlFiles);
86
+ }
87
+
88
  $fh = fopen($xmlFiles, 'w+');
89
  fwrite($fh, $response);
90
  fclose($fh);
352
  $countSuccess = 0;
353
  foreach($ResposeData as $row)
354
  {
355
+ $code = strval($row->transaction['docNo']);
356
+
357
  if($row->batchSuccess == "true")
358
  {
359
+ $resultClosed = $connection->query("SELECT id FROM ".$prefix."bluefish_sale_post WHERE order_id = '".$code."'");
360
+
361
+ $resultSetClosed = $resultClosed->fetchAll(PDO::FETCH_ASSOC);
362
+ $numberRowsClosed = count($resultSetClosed);
363
+
364
+ if($numberRowsClosed == 0)
365
+ {
366
+ $connection->query("INSERT INTO ".$prefix."bluefish_sale_post(id,order_id,posted_time)
367
+ VALUES('','".$code."','".now()."')");
368
+ }
369
+ else{
370
+ $connection->query("UPDATE ".$prefix."bluefish_sale_post SET status= 'closed' WHERE order_id = '".$code."'");
371
+ }
372
  $countSuccess++;
373
  }
374
  else
375
  {
376
+ $ErrorMsg .= "Error in Order# ".$code." ".$row->transaction->message.":";
377
  }
378
  }
379
  if($ErrorMsg != "" || $xmlData->message !="")
828
  {
829
  $categoryCodeValue = $catcodeVal['code'];
830
  $responseValue = "";
831
+ $response = "";
832
 
833
  $array=array();
834
 
835
+ $array=array('where'=>rawurlencode('categoryCode = '.$categoryCodeValue.''));
 
 
 
 
 
 
 
836
 
837
  $auth = build_auth_array($baseurl, $credentials['mycustom_code'],$permFile,$array);
838
 
851
  curl_setopt($tuCurl, CURLOPT_HTTPHEADER, array("Accept: application/xml"));
852
  $response = curl_exec($tuCurl);
853
  $response1 = curl_getinfo( $tuCurl );
854
+ $xmlObj = "";
855
 
856
  if($response != "")
857
  {
app/code/local/Bluefish/Connection/controllers/Adminhtml/MyformexportController.php CHANGED
@@ -93,9 +93,22 @@ class Bluefish_Connection_Adminhtml_MyformexportController extends Mage_Adminhtm
93
  {
94
  if($row->batchSuccess == "true")
95
  {
96
- $code = strval($row->transaction['docNo']);
97
- $connection->query("INSERT INTO ".$prefix."bluefish_sale_post(id,order_id,posted_time)
98
- VALUES('','".$code."','".now()."')");
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  $countSuccess++;
100
  }
101
  }
@@ -658,6 +671,8 @@ class Bluefish_Connection_Adminhtml_MyformexportController extends Mage_Adminhtm
658
  case 7: #### This case handles the category data export in csv
659
  try
660
  {
 
 
661
  $appBaseDir = Mage::getBaseDir();
662
  $mageFilename = $appBaseDir.'/app/Mage.php';
663
  require_once $mageFilename;
@@ -693,7 +708,7 @@ class Bluefish_Connection_Adminhtml_MyformexportController extends Mage_Adminhtm
693
  }
694
  else
695
  {
696
- $string = "INSTANCE,,true,".trim($id).",".trim($category->load($id)->getName()).",en\n";
697
  fputs($fp,"$string",100000);
698
  }
699
  $rowid++;
@@ -718,7 +733,104 @@ class Bluefish_Connection_Adminhtml_MyformexportController extends Mage_Adminhtm
718
  Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
719
  }
720
  break;
721
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
722
  }
723
 
724
  }
93
  {
94
  if($row->batchSuccess == "true")
95
  {
96
+ $code = strval($row->transaction['docNo']);
97
+
98
+ $resultClosed = $connection->query("SELECT id FROM ".$prefix."bluefish_sale_post WHERE order_id = '".$code."'");
99
+
100
+ $resultSetClosed = $resultClosed->fetchAll(PDO::FETCH_ASSOC);
101
+ $numberRowsClosed = count($resultSetClosed);
102
+
103
+ if($numberRowsClosed == 0)
104
+ {
105
+ $connection->query("INSERT INTO ".$prefix."bluefish_sale_post(id,order_id,posted_time)
106
+ VALUES('','".$code."','".now()."')");
107
+ }
108
+ else{
109
+ $connection->query("UPDATE ".$prefix."bluefish_sale_post SET status= 'closed' WHERE order_id = '".$code."'");
110
+ }
111
+
112
  $countSuccess++;
113
  }
114
  }
671
  case 7: #### This case handles the category data export in csv
672
  try
673
  {
674
+ ini_set("memory_limit","10000M");
675
+ set_time_limit(0);
676
  $appBaseDir = Mage::getBaseDir();
677
  $mageFilename = $appBaseDir.'/app/Mage.php';
678
  require_once $mageFilename;
708
  }
709
  else
710
  {
711
+ $string = "INSTANCE,,true,".trim($id).",".trim(substr($category->load($id)->getName(),0,30)).",en\n";
712
  fputs($fp,"$string",100000);
713
  }
714
  $rowid++;
733
  Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
734
  }
735
  break;
736
+ case 10: #### This case handles the product data export in csv
737
+ try
738
+ {
739
+ ini_set("memory_limit","10000M");
740
+ set_time_limit(0);
741
+ $appBaseDir = Mage::getBaseDir();
742
+ $mageFilename = $appBaseDir.'/app/Mage.php';
743
+ require_once $mageFilename;
744
+
745
+ $credentialsSales = Mage::getStoreConfig('mycustom_section/mycustom_sales_import_group');
746
+ $salesMappingFlag = $credentialsSales['mycustom_sales_mapping_method'];
747
+ $unserielVal = unserialize($salesMappingFlag);
748
+
749
+ $credentialsTaxclass = Mage::getStoreConfig('mycustom_section/mycustom_taxclass_group');
750
+ $taxClassSerialArr = $credentialsTaxclass['mycustom_taxclass_magento'];
751
+ $unserielTaxClass = unserialize($taxClassSerialArr);
752
+
753
+ $credentialsExport = Mage::getStoreConfig('mycustom_section/mycustom_product_export_group');
754
+ $unitOfMeasureCode = $credentialsExport['mycustom_unitofmeasure'];
755
+
756
+ $fileName = "product_dump_".date('Y-m-d').".csv";
757
+ $fileHandle = fopen($fileName, "w");
758
+
759
+ $header = "#,imageName,saleable,productCategory,code,productType,taxClass,active,unitOfMeasure,discountAllowed,returnable,barcode,price,currency,startDate,description,language,age,ageRestricted,soldByWeight,requestPrice";
760
+ fputs($fileHandle,"$header\n",10000);
761
+
762
+ $string = "PRODUCT,1.0\n";
763
+ fputs($fileHandle,"$string",100000);
764
+
765
+ $productObj = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('*'); // you can add * or field name here eg. ('sku','product_name','description')
766
+
767
+ foreach ($productObj as $productRow) {
768
+
769
+ foreach($unserielTaxClass as $key => $valueTax)
770
+ {
771
+ if($productRow->getTaxClassId() == $valueTax['magentotaxclass'])
772
+ {
773
+ $bluestoreTaxclassCode = $valueTax['bluestoretaxclass'];
774
+ }
775
+ }
776
+
777
+ $getCategoryIdsArr = $productRow->getCategoryIds();
778
+ $productCategory = $getCategoryIdsArr['0'];
779
+
780
+ if($unserielVal['#{_id}']['Salemapping'] == 'Productcode')
781
+ {
782
+ $productCode = $productRow->getSku();
783
+ }
784
+ else{
785
+ $productCode = $productRow->getId();
786
+ }
787
+
788
+ $ProductStatus = ($productRow->getStatus() == "1")?'true':'false';
789
+
790
+ $createdDate = date("d.m.Y",strtotime($productRow->getCreatedAt()));
791
+
792
+ $dataCollection = array(
793
+ "INSTANCE",
794
+ '',
795
+ "true",
796
+ $productCategory,
797
+ $productCode,
798
+ "Standard",
799
+ $bluestoreTaxclassCode,
800
+ $ProductStatus,
801
+ $unitOfMeasureCode,
802
+ "true",
803
+ "true",
804
+ '',
805
+ $productRow->getPrice(),
806
+ $currencyCode,
807
+ $createdDate,
808
+ substr($productRow->getName(),0,30),
809
+ "en",
810
+ '',
811
+ "false",
812
+ "false",
813
+ "false"
814
+ );
815
+ fputcsv($fileHandle, $dataCollection);
816
+ }
817
+
818
+ fclose($fileHandle);
819
+ ob_clean();
820
+ header("Content-type: application/csv");
821
+ header("Content-Disposition: attachment; filename=$fileName");
822
+ header("Pragma: no-cache");
823
+ header("Expires: 0");
824
+ $content = file_get_contents("$appBaseDir/$fileName");
825
+ echo $content;
826
+ die;
827
+ }
828
+ catch (Exception $e)
829
+ {
830
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
831
+ }
832
+ break;
833
+
834
  }
835
 
836
  }
app/code/local/Bluefish/Connection/controllers/Adminhtml/Xml.php CHANGED
@@ -370,15 +370,6 @@ function insert_update_database2()
370
  $xmlObj = new Varien_Simplexml_Config($xmlPath);
371
  $xmlData = $xmlObj->getNode();
372
 
373
- /*$mageFilename = $appBaseDir.'/app/Mage.php';
374
- require_once $mageFilename;
375
- Mage::setIsDeveloperMode(true);
376
-
377
- umask(0);
378
- Mage::app('admin');
379
- Mage::register('isSecureArea', 1);
380
- Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);*/
381
-
382
  Mage::log('Stock Import started ......', null, './Bluestore_stock.log.text');
383
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
384
 
@@ -498,7 +489,17 @@ function insert_update_database2()
498
  $connection->query("INSERT INTO ".$prefix."bluefish_cron_schedule_logs(id,schedule_id,error)
499
  VALUES('','".$ScheduledID."','".$ErrorMsg."')");
500
  }
501
- }
 
 
 
 
 
 
 
 
 
 
502
  $flag = "success";
503
  return $flag;
504
  }
@@ -584,10 +585,11 @@ function insert_update_database1()
584
  $resultSetProduct = $resultProduct->fetchAll(PDO::FETCH_ASSOC);
585
  $numberProductRows = count($resultSetProduct);
586
 
587
- if($resultSetProduct[0]['product_id'] != "")
588
  {
589
  try
590
  {
 
591
  $resultProductInfo = $soap->call($sessionId, 'catalog_product.info', $resultSetProduct[0]['product_id']);
592
 
593
  if (!in_array($resultSet[0]['category_id'],$resultProductInfo['categories']))
@@ -704,17 +706,23 @@ function insert_update_database1()
704
  $resultDirect = $connection->query("select code,category_id from ".$prefix."bluefish_category WHERE code = '".$categoryCode."'");
705
  $resultSetDirect = $resultDirect->fetchAll(PDO::FETCH_ASSOC);
706
  $numberRowsDirect = count($resultSetDirect);
 
707
 
708
  $DirectcategoryCode = ($numberRowsDirect > 0)?$resultSetDirect[0][category_id]:$categoryCode;
709
 
710
  try
711
  {
712
  $productMainID = Mage::getModel('catalog/product')->getIdBySku("$codeSKU");
713
-
714
- $resultProductInfoDirect = $soap->call($sessionId, 'catalog_product.info', $productMainID);
715
- if(!in_array($DirectcategoryCode,$resultProductInfoDirect['categories']))
716
  {
717
- array_push($resultProductInfoDirect['categories'],$DirectcategoryCode);
 
 
 
 
 
 
718
  }
719
  }
720
  catch(Exception $e)
@@ -723,8 +731,9 @@ function insert_update_database1()
723
  $returnmessage = $flag;
724
  }
725
  try
726
- {
727
  $ProductStatus = ($status == "true")?'1':'2';
 
728
  $resultProductUpdate = $soap->call($sessionId, 'catalog_product.update', array($productMainID, array(
729
  'categories' => $resultProductInfoDirect['categories'],
730
  'websites' => array(1),
@@ -771,11 +780,6 @@ function insert_update_database1()
771
  }
772
  }
773
  }
774
- /*else
775
- {
776
- $flag = "noProduct";
777
- return $flag;
778
- }*/
779
  }
780
  if($ErrorMsg != "")
781
  {
@@ -801,6 +805,16 @@ function insert_update_database1()
801
  {
802
  $returnmessage = "noProduct";
803
  }
 
 
 
 
 
 
 
 
 
 
804
  return $returnmessage;
805
  }
806
 
@@ -1719,38 +1733,57 @@ function importBluestoreSales($transactionNumber)
1719
  $item_id = array();
1720
 
1721
  foreach($item_array as $item_key=>$item_val){
1722
- $item_id[] = $item_val[item_id];
1723
  }
1724
 
 
1725
  for($k=0;$k<count($xmlData->sale[$i]->items->item);$k++){
1726
 
1727
- $finalAmount = "";
1728
- $finalAmountExclTax = "";
1729
- $quantity = "";
1730
- $quantity = (int)$xmlData->sale[$i]->items->item[$k]->quantity;
1731
- $finalAmountExclTax = (float)$xmlData->sale[$i]->items->item[$k]->finalAmountExclTax;
 
 
 
1732
 
1733
-
1734
- $finalAmount = (float)($finalAmountExclTax / $quantity);
1735
 
1736
- if ($quantity < 1) {
1737
- $finalAmount = -$finalAmount;
 
 
 
 
 
1738
  }
1739
 
 
 
 
 
 
 
1740
 
 
 
 
 
1741
  $connection->query("UPDATE ".$prefix."sales_flat_quote_item SET
1742
  `custom_price` = '$finalAmount',
1743
  `original_custom_price` = '$finalAmount',
1744
- `qty` = '$quantity'
1745
- WHERE `sales_flat_quote_item`.`item_id` =".$item_id[$k]);
1746
  }
1747
-
1748
  }
1749
  catch(Exception $e){
1750
  $error .= $e->getMessage()."<br>";
1751
  }
1752
-
1753
- if($error == "") ### checking when there is in cart info API
1754
  {
1755
  $licenseForOrderCreation = null;
1756
 
@@ -1770,57 +1803,74 @@ function importBluestoreSales($transactionNumber)
1770
  ->addObject($invoice->getOrder());
1771
 
1772
  $transaction_save->save();
1773
-
1774
- //now create shipment
1775
- //after creation of shipment, the order auto gets status COMPLETE
1776
- $shipment = $order->prepareShipment();
1777
- if( $shipment ) {
1778
- $shipment->register();
1779
- $order->setIsInProcess(true);
1780
-
1781
- $transaction_save = Mage::getModel('core/resource_transaction')
1782
- ->addObject($shipment)
1783
- ->addObject($shipment->getOrder())
1784
- ->save();
1785
- }
1786
-
1787
- ###### For credit memo only
1788
- if($orderIncrementId != "" && count($arrQtyRefund) > 0)
1789
- {
1790
- foreach($arrQtyRefund as $keyProductID => $valProductQTY)
1791
- {
1792
- $newQty = "";
1793
- $productId = "";
1794
- $availableStockQty = "";
1795
-
1796
- $_product = Mage::getModel('catalog/product')->load($keyProductID);
1797
-
1798
- $stockAvail = Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product);
1799
- $availableStockQty = $stockAvail->getQty();
1800
-
1801
- $newQty = $valProductQTY * (-2);
1802
- $newQty = $newQty + $availableStockQty;
1803
- $productId = $keyProductID;
1804
-
1805
- $sql = "UPDATE ".$prefix."cataloginventory_stock_item csi,
1806
- " .$prefix."cataloginventory_stock_status css
1807
- SET
1808
- csi.qty = ?,
1809
- csi.is_in_stock = ?,
1810
- css.qty = ?,
1811
- css.stock_status = ?
1812
- WHERE
1813
- csi.product_id = ?
1814
- AND csi.product_id = css.product_id";
1815
- $isInStock = $newQty > 0 ? 1 : 0;
1816
- $stockStatus = $newQty > 0 ? 1 : 0;
1817
- $connection->query($sql, array($newQty, $isInStock, $newQty, $stockStatus, $productId));
1818
- }
1819
- }
1820
  }
1821
  catch(Exception $e){
1822
  $error .= $e->getMessage()."<br>";
1823
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1824
  }
1825
  }
1826
  }
@@ -1849,7 +1899,11 @@ function importBluestoreSales($transactionNumber)
1849
  if((count($xmlData) > 0) && ($transactionNumber == ""))
1850
  {
1851
  $updateLastDateVal = max($updateLastDateArr);
1852
- Mage::getModel('core/config')->saveConfig('mycustom_section/mycustom_sales_import_group/mycustom_bluestore_enddatetime', $updateLastDateVal);
 
 
 
 
1853
  }
1854
 
1855
  if($errorNum > 0){
@@ -1901,6 +1955,7 @@ function ExportOrderData()
1901
  $commonschedule_Sale = $credentials['mycustom_sales_commonschedule'];
1902
  $unserielSaleVal = unserialize($commonschedule_Sale);
1903
  $lastUpdatedDate = $credentials['mycustom_sales_last_export'];
 
1904
 
1905
  $SaleCount = 0;
1906
 
@@ -1953,13 +2008,22 @@ function ExportOrderData()
1953
  if($lastUpdatedDate !="")
1954
  {
1955
  $thesearch =array(array('updated_at'=>array('gt'=>$lastUpdatedDate), 'status'=>array('eq'=>"complete")));
1956
- $resultOrderList = $soap->call($sessionId, 'order.list',$thesearch);
1957
  }
1958
  else
1959
  {
1960
  $thesearch =array(array('status'=>array('eq'=>"complete")));
1961
- $resultOrderList = $soap->call($sessionId, 'order.list',$thesearch);
1962
  }
 
 
 
 
 
 
 
 
 
1963
  }
1964
  catch(Exception $e)
1965
  {
@@ -1967,8 +2031,7 @@ function ExportOrderData()
1967
  $flag = $e->getMessage();
1968
  $responeXml = "fail";
1969
  }
1970
-
1971
- $zz = 0;
1972
  /*echo "<pre>";
1973
  print_r($resultOrderList);
1974
  exit;*/
@@ -1979,7 +2042,7 @@ function ExportOrderData()
1979
  $catchError = "";
1980
  $catchProductError = "";
1981
 
1982
- $result = $connection->query("SELECT id FROM ".$prefix."bluefish_sale_post WHERE order_id = '".$resultOrderList[$i][increment_id]."'");
1983
 
1984
  $resultSet = $result->fetchAll(PDO::FETCH_ASSOC);
1985
  $numberRows = count($resultSet);
@@ -1999,7 +2062,9 @@ function ExportOrderData()
1999
  $customerCodeafterCheck = $credentials['mycustom_customer_number'];
2000
  }
2001
 
2002
- if(($numberRows == 0) && (($customerCodeafterCheck != "") || ($resultOrderList[$i][customer_is_guest] == '1')))
 
 
2003
  {
2004
  ### For sale order info
2005
  try
@@ -2055,17 +2120,29 @@ function ExportOrderData()
2055
  <saleHeader>
2056
  <terminalTransactionNo>".$resultOrderList[$i][increment_id]."</terminalTransactionNo>
2057
  <storeCode>".$mycustom_bluestorecode."</storeCode>
2058
- <terminalCode>1</terminalCode>
2059
- <startDateTime>".$resultOrderList[$i][created_at]."</startDateTime>
2060
- <endDateTime>".$resultOrderList[$i][updated_at]."</endDateTime>
 
 
 
 
 
 
2061
  <sessionID>".$sessionId."</sessionID>
2062
  <userCode>".$resultcustomer_id."</userCode>
2063
- <orderCurrencyCode>".$resultOrderList[$i][base_currency_code]."</orderCurrencyCode>
2064
- <saleAmount>".$saleAmountIncludeTax."</saleAmount>
2065
- <totalTax>".$resultOrderList[$i][tax_amount]."</totalTax>
2066
- <amountsIncludeTax>".$AmountsIncludeTax."</amountsIncludeTax>
2067
- </saleHeader>
2068
- ";
 
 
 
 
 
 
2069
 
2070
 
2071
  ### For sale order info
@@ -2165,11 +2242,22 @@ function ExportOrderData()
2165
  <categoryCode>".$updateCategoryCode."</categoryCode>
2166
  <categoryDescription>".$categoryDescription."</categoryDescription>
2167
  <price>".$resultSalesOrder[items][$j][price]."</price>
2168
- <currencyCode>".$resultSalesOrder[order_currency_code]."</currencyCode>
2169
- <quantity>".number_format($resultSalesOrder[items][$j][qty_invoiced])."</quantity>
2170
- <unitOfMeasure>EA</unitOfMeasure>
2171
- <finalAmount>".$TotalfinalAmount."</finalAmount>
2172
- <saleItemTaxes>
 
 
 
 
 
 
 
 
 
 
 
2173
  <saleItemTax>
2174
  <saleItemTaxNo>1</saleItemTaxNo>
2175
  <taxCode>".$TAXCODE_VAL."</taxCode>
@@ -2218,9 +2306,15 @@ function ExportOrderData()
2218
  <payment>
2219
  <paymentNo>".$resultSalesOrder[increment_id]."</paymentNo>
2220
  <tenderType>2</tenderType>
2221
- <paymentMethodCode>".$PAYMENTCODE_VAL."</paymentMethodCode>
2222
- <amount>".$resultSalesOrder[payment][amount_ordered]."</amount>
2223
- <currencyCode>".$resultSalesOrder[order_currency_code]."</currencyCode>
 
 
 
 
 
 
2224
  </payment>
2225
  </payments>
2226
  </transactionSale>
@@ -2253,7 +2347,7 @@ function ExportOrderData()
2253
  $lastUpdatedDateVal = max($updatedTimeArray);
2254
  Mage::getModel('core/config')->saveConfig('mycustom_section/mycustom_sales_group/mycustom_sales_last_export', $lastUpdatedDateVal);
2255
  }
2256
-
2257
  return $responeXml;
2258
  }
2259
 
@@ -2570,7 +2664,7 @@ function ExportProductData()
2570
  }
2571
  else
2572
  {
2573
- $productListResult = $connection->query("SELECT `sku` FROM ".$prefix."catalog_product_entity");
2574
  }
2575
  $productList = $productListResult->fetchAll(PDO::FETCH_ASSOC);
2576
 
370
  $xmlObj = new Varien_Simplexml_Config($xmlPath);
371
  $xmlData = $xmlObj->getNode();
372
 
 
 
 
 
 
 
 
 
 
373
  Mage::log('Stock Import started ......', null, './Bluestore_stock.log.text');
374
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
375
 
489
  $connection->query("INSERT INTO ".$prefix."bluefish_cron_schedule_logs(id,schedule_id,error)
490
  VALUES('','".$ScheduledID."','".$ErrorMsg."')");
491
  }
492
+ }
493
+
494
+ if(php_sapi_name() == 'cli' || empty($_SERVER['REMOTE_ADDR'])) {
495
+ /**** For reindex all the data ****/
496
+ $indexCollection = Mage::getModel('index/process')->getCollection();
497
+ foreach ($indexCollection as $index) {
498
+ /* @var $index Mage_Index_Model_Process */
499
+ $index->reindexAll();
500
+ }
501
+ }
502
+
503
  $flag = "success";
504
  return $flag;
505
  }
585
  $resultSetProduct = $resultProduct->fetchAll(PDO::FETCH_ASSOC);
586
  $numberProductRows = count($resultSetProduct);
587
 
588
+ if($resultSetProduct[0]['product_id'] != "" && $numberProductRows > 0 )
589
  {
590
  try
591
  {
592
+ $resultProductInfo = "";
593
  $resultProductInfo = $soap->call($sessionId, 'catalog_product.info', $resultSetProduct[0]['product_id']);
594
 
595
  if (!in_array($resultSet[0]['category_id'],$resultProductInfo['categories']))
706
  $resultDirect = $connection->query("select code,category_id from ".$prefix."bluefish_category WHERE code = '".$categoryCode."'");
707
  $resultSetDirect = $resultDirect->fetchAll(PDO::FETCH_ASSOC);
708
  $numberRowsDirect = count($resultSetDirect);
709
+ $DirectcategoryCode = "";
710
 
711
  $DirectcategoryCode = ($numberRowsDirect > 0)?$resultSetDirect[0][category_id]:$categoryCode;
712
 
713
  try
714
  {
715
  $productMainID = Mage::getModel('catalog/product')->getIdBySku("$codeSKU");
716
+
717
+ if($productMainID != "")
 
718
  {
719
+ $resultProductInfoDirect = "";
720
+
721
+ $resultProductInfoDirect = $soap->call($sessionId, 'catalog_product.info', $productMainID);
722
+ if(!in_array($DirectcategoryCode,$resultProductInfoDirect['categories']))
723
+ {
724
+ array_push($resultProductInfoDirect['categories'],$DirectcategoryCode);
725
+ }
726
  }
727
  }
728
  catch(Exception $e)
731
  $returnmessage = $flag;
732
  }
733
  try
734
+ {
735
  $ProductStatus = ($status == "true")?'1':'2';
736
+
737
  $resultProductUpdate = $soap->call($sessionId, 'catalog_product.update', array($productMainID, array(
738
  'categories' => $resultProductInfoDirect['categories'],
739
  'websites' => array(1),
780
  }
781
  }
782
  }
 
 
 
 
 
783
  }
784
  if($ErrorMsg != "")
785
  {
805
  {
806
  $returnmessage = "noProduct";
807
  }
808
+
809
+ if(php_sapi_name() == 'cli' || empty($_SERVER['REMOTE_ADDR'])) {
810
+ /**** For reindex all the data ****/
811
+ $indexCollection = Mage::getModel('index/process')->getCollection();
812
+ foreach ($indexCollection as $index) {
813
+ /* @var $index Mage_Index_Model_Process */
814
+ $index->reindexAll();
815
+ }
816
+ }
817
+
818
  return $returnmessage;
819
  }
820
 
1733
  $item_id = array();
1734
 
1735
  foreach($item_array as $item_key=>$item_val){
1736
+ $item_id[$item_val['product_id']] = $item_val['item_id'];
1737
  }
1738
 
1739
+ $bluestoreProductArr = array();
1740
  for($k=0;$k<count($xmlData->sale[$i]->items->item);$k++){
1741
 
1742
+ $pCode = (int)$xmlData->sale[$i]->items->item[$k]->productCode;
1743
+ if($unserielVal['#{_id}']['Salemapping'] == 'Productcode')
1744
+ {
1745
+ $magento_ProductId = Mage::getModel("catalog/product")->getIdBySku($pCode);
1746
+ }
1747
+ else{
1748
+ $magento_ProductId = $pCode;
1749
+ }
1750
 
1751
+ $pQty = (int)$xmlData->sale[$i]->items->item[$k]->quantity;
1752
+ $pAmt = (float)$xmlData->sale[$i]->items->item[$k]->finalAmountExclTax;
1753
 
1754
+ if(is_array($bluestoreProductArr[$magento_ProductId]))
1755
+ {
1756
+ $bluestoreProductArr[$magento_ProductId]['qty'] += $pQty;
1757
+ $bluestoreProductArr[$magento_ProductId]['amt'] += $pAmt;
1758
+ } else {
1759
+ $bluestoreProductArr[$magento_ProductId]['qty'] = $pQty;
1760
+ $bluestoreProductArr[$magento_ProductId]['amt'] = $pAmt;
1761
  }
1762
 
1763
+ }
1764
+
1765
+ foreach($bluestoreProductArr as $KeyArr => $keyVal){
1766
+
1767
+ $finalAmount = "";
1768
+ $finalAmount = (float)($keyVal['amt'] / $keyVal['qty']);
1769
 
1770
+ if ($keyVal['qty'] < 1) {
1771
+ $finalAmount = -$finalAmount;
1772
+ }
1773
+
1774
  $connection->query("UPDATE ".$prefix."sales_flat_quote_item SET
1775
  `custom_price` = '$finalAmount',
1776
  `original_custom_price` = '$finalAmount',
1777
+ `qty` = '".$keyVal['qty']."'
1778
+ WHERE `sales_flat_quote_item`.`item_id` =".$item_id[$KeyArr]);
1779
  }
1780
+
1781
  }
1782
  catch(Exception $e){
1783
  $error .= $e->getMessage()."<br>";
1784
  }
1785
+
1786
+ if($error == "") ### checking when there is no error in cart info API
1787
  {
1788
  $licenseForOrderCreation = null;
1789
 
1803
  ->addObject($invoice->getOrder());
1804
 
1805
  $transaction_save->save();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1806
  }
1807
  catch(Exception $e){
1808
  $error .= $e->getMessage()."<br>";
1809
  }
1810
+
1811
+ if($error == "") ### checking when there is no error in save transaction
1812
+ {
1813
+ try{
1814
+
1815
+ //now create shipment
1816
+ //after creation of shipment, the order auto gets status COMPLETE
1817
+ $shipment = $order->prepareShipment();
1818
+ if( $shipment ) {
1819
+ $shipment->register();
1820
+ $order->setIsInProcess(true);
1821
+
1822
+ $transaction_save = Mage::getModel('core/resource_transaction')
1823
+ ->addObject($shipment)
1824
+ ->addObject($shipment->getOrder())
1825
+ ->save();
1826
+ }
1827
+
1828
+ }
1829
+ catch(Exception $e){
1830
+ $error .= $e->getMessage()."<br>";
1831
+ }
1832
+ if($error == "") ### checking when there is no error in set shipment status
1833
+ {
1834
+ try{
1835
+ ###### For credit memo only
1836
+ if($orderIncrementId != "" && count($arrQtyRefund) > 0)
1837
+ {
1838
+ foreach($arrQtyRefund as $keyProductID => $valProductQTY)
1839
+ {
1840
+ $newQty = "";
1841
+ $productId = "";
1842
+ $availableStockQty = "";
1843
+
1844
+ $_product = Mage::getModel('catalog/product')->load($keyProductID);
1845
+
1846
+ $stockAvail = Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product);
1847
+ $availableStockQty = $stockAvail->getQty();
1848
+
1849
+ $newQty = $valProductQTY * (-2);
1850
+ $newQty = $newQty + $availableStockQty;
1851
+ $productId = $keyProductID;
1852
+
1853
+ $sql = "UPDATE ".$prefix."cataloginventory_stock_item csi,
1854
+ " .$prefix."cataloginventory_stock_status css
1855
+ SET
1856
+ csi.qty = ?,
1857
+ csi.is_in_stock = ?,
1858
+ css.qty = ?,
1859
+ css.stock_status = ?
1860
+ WHERE
1861
+ csi.product_id = ?
1862
+ AND csi.product_id = css.product_id";
1863
+ $isInStock = $newQty > 0 ? 1 : 0;
1864
+ $stockStatus = $newQty > 0 ? 1 : 0;
1865
+ $connection->query($sql, array($newQty, $isInStock, $newQty, $stockStatus, $productId));
1866
+ }
1867
+ }
1868
+ }
1869
+ catch(Exception $e){
1870
+ $error .= $e->getMessage()."<br>";
1871
+ }
1872
+ }
1873
+ }
1874
  }
1875
  }
1876
  }
1899
  if((count($xmlData) > 0) && ($transactionNumber == ""))
1900
  {
1901
  $updateLastDateVal = max($updateLastDateArr);
1902
+
1903
+ if(($updateLastDateVal != "") && (count($updateLastDateArr) > 0))
1904
+ {
1905
+ Mage::getModel('core/config')->saveConfig('mycustom_section/mycustom_sales_import_group/mycustom_bluestore_enddatetime', $updateLastDateVal);
1906
+ }
1907
  }
1908
 
1909
  if($errorNum > 0){
1955
  $commonschedule_Sale = $credentials['mycustom_sales_commonschedule'];
1956
  $unserielSaleVal = unserialize($commonschedule_Sale);
1957
  $lastUpdatedDate = $credentials['mycustom_sales_last_export'];
1958
+ $bluestoreUserName = $credentials['mycustom_sale_username'];
1959
 
1960
  $SaleCount = 0;
1961
 
2008
  if($lastUpdatedDate !="")
2009
  {
2010
  $thesearch =array(array('updated_at'=>array('gt'=>$lastUpdatedDate), 'status'=>array('eq'=>"complete")));
2011
+ $resultOrderListCompleted = $soap->call($sessionId, 'order.list',$thesearch);
2012
  }
2013
  else
2014
  {
2015
  $thesearch =array(array('status'=>array('eq'=>"complete")));
2016
+ $resultOrderListCompleted = $soap->call($sessionId, 'order.list',$thesearch);
2017
  }
2018
+
2019
+ $minusInDateTime = strtotime(date("Y-m-d h:m:s", strtotime("$lastUpdatedDate")) . " -1 month");
2020
+ $creditDateTime = date('Y-m-d h:m:s',$minusInDateTime);
2021
+
2022
+ $thesearchForClosed = array(array('updated_at'=>array('gt'=>$creditDateTime), 'status'=>array('eq'=>"closed")));
2023
+ $resultOrderListClosed = $soap->call($sessionId, 'order.list',$thesearchForClosed);
2024
+
2025
+
2026
+ $resultOrderList = array_merge($resultOrderListCompleted, $resultOrderListClosed);
2027
  }
2028
  catch(Exception $e)
2029
  {
2031
  $flag = $e->getMessage();
2032
  $responeXml = "fail";
2033
  }
2034
+
 
2035
  /*echo "<pre>";
2036
  print_r($resultOrderList);
2037
  exit;*/
2042
  $catchError = "";
2043
  $catchProductError = "";
2044
 
2045
+ $result = $connection->query("SELECT id,status FROM ".$prefix."bluefish_sale_post WHERE order_id = '".$resultOrderList[$i][increment_id]."'");
2046
 
2047
  $resultSet = $result->fetchAll(PDO::FETCH_ASSOC);
2048
  $numberRows = count($resultSet);
2062
  $customerCodeafterCheck = $credentials['mycustom_customer_number'];
2063
  }
2064
 
2065
+ $orderStatus = $resultOrderList[$i][status];
2066
+
2067
+ if((($numberRows == 0 && $orderStatus != "closed") || (($numberRows > 0) && ($orderStatus != $resultSet[0][status]))) && (($customerCodeafterCheck != "") || ($resultOrderList[$i][customer_is_guest] == '1')))
2068
  {
2069
  ### For sale order info
2070
  try
2120
  <saleHeader>
2121
  <terminalTransactionNo>".$resultOrderList[$i][increment_id]."</terminalTransactionNo>
2122
  <storeCode>".$mycustom_bluestorecode."</storeCode>
2123
+ <terminalCode>1</terminalCode>";
2124
+
2125
+ if($orderStatus == "closed")
2126
+ $xmlRequest .= "<startDateTime>".$resultOrderList[$i][updated_at]."</startDateTime>";
2127
+ else
2128
+ $xmlRequest .= "<startDateTime>".$resultOrderList[$i][created_at]."</startDateTime>";
2129
+
2130
+
2131
+ $xmlRequest .= "<endDateTime>".$resultOrderList[$i][updated_at]."</endDateTime>
2132
  <sessionID>".$sessionId."</sessionID>
2133
  <userCode>".$resultcustomer_id."</userCode>
2134
+ <userName>".$bluestoreUserName."</userName>
2135
+ <orderCurrencyCode>".$resultOrderList[$i][base_currency_code]."</orderCurrencyCode>";
2136
+
2137
+ if($orderStatus == "closed")
2138
+ $xmlRequest .= "<saleAmount>-".$saleAmountIncludeTax."</saleAmount>
2139
+ <totalTax>-".$resultOrderList[$i][tax_amount]."</totalTax>";
2140
+ else
2141
+ $xmlRequest .= "<saleAmount>".$saleAmountIncludeTax."</saleAmount>
2142
+ <totalTax>".$resultOrderList[$i][tax_amount]."</totalTax>";
2143
+
2144
+ $xmlRequest .= "<amountsIncludeTax>".$AmountsIncludeTax."</amountsIncludeTax>
2145
+ </saleHeader>";
2146
 
2147
 
2148
  ### For sale order info
2242
  <categoryCode>".$updateCategoryCode."</categoryCode>
2243
  <categoryDescription>".$categoryDescription."</categoryDescription>
2244
  <price>".$resultSalesOrder[items][$j][price]."</price>
2245
+ <currencyCode>".$resultSalesOrder[order_currency_code]."</currencyCode>";
2246
+
2247
+ if($orderStatus == "closed")
2248
+ $xmlRequest .= "<quantity>-".number_format($resultSalesOrder[items][$j][qty_invoiced])."</quantity>";
2249
+ else
2250
+ $xmlRequest .= "<quantity>".number_format($resultSalesOrder[items][$j][qty_invoiced])."</quantity>";
2251
+
2252
+ $xmlRequest .= "<unitOfMeasure>EA</unitOfMeasure>";
2253
+
2254
+ if($orderStatus == "closed")
2255
+ $xmlRequest .= "<finalAmount>-".$TotalfinalAmount."</finalAmount>";
2256
+ else
2257
+ $xmlRequest .= "<finalAmount>".$TotalfinalAmount."</finalAmount>";
2258
+
2259
+
2260
+ $xmlRequest .= "<saleItemTaxes>
2261
  <saleItemTax>
2262
  <saleItemTaxNo>1</saleItemTaxNo>
2263
  <taxCode>".$TAXCODE_VAL."</taxCode>
2306
  <payment>
2307
  <paymentNo>".$resultSalesOrder[increment_id]."</paymentNo>
2308
  <tenderType>2</tenderType>
2309
+ <paymentMethodCode>".$PAYMENTCODE_VAL."</paymentMethodCode>";
2310
+
2311
+ if($orderStatus == "closed")
2312
+ $xmlRequest .= "<amount>-".$resultSalesOrder[payment][amount_ordered]."</amount>";
2313
+ else
2314
+ $xmlRequest .= "<amount>".$resultSalesOrder[payment][amount_ordered]."</amount>";
2315
+
2316
+
2317
+ $xmlRequest .= "<currencyCode>".$resultSalesOrder[order_currency_code]."</currencyCode>
2318
  </payment>
2319
  </payments>
2320
  </transactionSale>
2347
  $lastUpdatedDateVal = max($updatedTimeArray);
2348
  Mage::getModel('core/config')->saveConfig('mycustom_section/mycustom_sales_group/mycustom_sales_last_export', $lastUpdatedDateVal);
2349
  }
2350
+
2351
  return $responeXml;
2352
  }
2353
 
2664
  }
2665
  else
2666
  {
2667
+ $productListResult = $connection->query("SELECT `entity_id`,`sku`,`updated_at` FROM ".$prefix."catalog_product_entity");
2668
  }
2669
  $productList = $productListResult->fetchAll(PDO::FETCH_ASSOC);
2670
 
app/code/local/Bluefish/Connection/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Bluefish_Connection>
5
- <version>1.1.4</version>
6
  <depends>
7
  <Mage_Shipping/>
8
  </depends>
@@ -188,15 +188,15 @@
188
  <crontab>
189
  <jobs>
190
  <bluefish_connection_category>
191
- <schedule><cron_expr>0 0 * * *</cron_expr></schedule>
192
  <run><model>connection/cronobserver::categoryImport</model></run>
193
  </bluefish_connection_category>
194
  <bluefish_connection_product>
195
- <schedule><cron_expr>55 9 * * *</cron_expr></schedule>
196
  <run><model>connection/cronobserver::productImport</model></run>
197
  </bluefish_connection_product>
198
  <bluefish_connection_productexport>
199
- <schedule><cron_expr>55 9 * * *</cron_expr></schedule>
200
  <run><model>connection/cronobserver::productEmport</model></run>
201
  </bluefish_connection_productexport>
202
  <bluefish_connection_stock>
@@ -212,11 +212,11 @@
212
  <run><model>connection/cronobserver::customerExport</model></run>
213
  </bluefish_connection_customerexport>
214
  <bluefish_connection_orderimport>
215
- <schedule><cron_expr>0 0 * * *</cron_expr></schedule>
216
  <run><model>connection/cronobserver::salesImport</model></run>
217
  </bluefish_connection_orderimport>
218
  <bluefish_connection_orderexport>
219
- <schedule><cron_expr>0 0 * * *</cron_expr></schedule>
220
  <run><model>connection/cronobserver::salesExport</model></run>
221
  </bluefish_connection_orderexport>
222
  </jobs>
2
  <config>
3
  <modules>
4
  <Bluefish_Connection>
5
+ <version>1.1.5</version>
6
  <depends>
7
  <Mage_Shipping/>
8
  </depends>
188
  <crontab>
189
  <jobs>
190
  <bluefish_connection_category>
191
+ <schedule><cron_expr>22 9 * * *</cron_expr></schedule>
192
  <run><model>connection/cronobserver::categoryImport</model></run>
193
  </bluefish_connection_category>
194
  <bluefish_connection_product>
195
+ <schedule><cron_expr>15 */4 * * *</cron_expr></schedule>
196
  <run><model>connection/cronobserver::productImport</model></run>
197
  </bluefish_connection_product>
198
  <bluefish_connection_productexport>
199
+ <schedule><cron_expr>15 */4 * * *</cron_expr></schedule>
200
  <run><model>connection/cronobserver::productEmport</model></run>
201
  </bluefish_connection_productexport>
202
  <bluefish_connection_stock>
212
  <run><model>connection/cronobserver::customerExport</model></run>
213
  </bluefish_connection_customerexport>
214
  <bluefish_connection_orderimport>
215
+ <schedule><cron_expr>25 15 * * *</cron_expr></schedule>
216
  <run><model>connection/cronobserver::salesImport</model></run>
217
  </bluefish_connection_orderimport>
218
  <bluefish_connection_orderexport>
219
+ <schedule><cron_expr>25 15 * * *</cron_expr></schedule>
220
  <run><model>connection/cronobserver::salesExport</model></run>
221
  </bluefish_connection_orderexport>
222
  </jobs>
app/code/local/Bluefish/Connection/etc/system.xml CHANGED
@@ -238,10 +238,18 @@
238
  <show_in_website>1</show_in_website>
239
  <show_in_store>1</show_in_store>
240
  </mycustom_sale_chargescode>
 
 
 
 
 
 
 
 
241
  <mycustom_sales_last_export translate="label">
242
  <label>Last Export of Completed Sales</label>
243
  <frontend_type>text</frontend_type>
244
- <sort_order>90</sort_order>
245
  <comment><![CDATA[(YYYY-MM-DD hh:mm:ss)]]></comment>
246
  <show_in_default>1</show_in_default>
247
  <show_in_website>1</show_in_website>
238
  <show_in_website>1</show_in_website>
239
  <show_in_store>1</show_in_store>
240
  </mycustom_sale_chargescode>
241
+ <mycustom_sale_username translate="label">
242
+ <label>Bluestore User Name</label>
243
+ <frontend_type>text</frontend_type>
244
+ <sort_order>70</sort_order>
245
+ <show_in_default>1</show_in_default>
246
+ <show_in_website>1</show_in_website>
247
+ <show_in_store>1</show_in_store>
248
+ </mycustom_sale_username>
249
  <mycustom_sales_last_export translate="label">
250
  <label>Last Export of Completed Sales</label>
251
  <frontend_type>text</frontend_type>
252
+ <sort_order>80</sort_order>
253
  <comment><![CDATA[(YYYY-MM-DD hh:mm:ss)]]></comment>
254
  <show_in_default>1</show_in_default>
255
  <show_in_website>1</show_in_website>
app/code/local/Bluefish/Connection/sql/connection_setup/mysql4-upgrade-1.1.3-1.1.5.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /****************************/
3
+ ##### This File Helps To Generate The Log Tables
4
+ ##### Log Tables Only Generated If Already Not Exist
5
+ /****************************/
6
+
7
+ $installer = $this;
8
+
9
+ $installer->startSetup();
10
+
11
+ $installer->run("
12
+ ALTER TABLE `{$this->getTable('bluefish_sale_post')}`
13
+ ADD `status` ENUM('complete','closed') NOT NULL DEFAULT 'complete' AFTER `order_id`
14
+ ");
15
+
16
+ $installer->endSetup();
app/design/adminhtml/default/default/template/connection/myformexport.phtml CHANGED
@@ -53,11 +53,16 @@ function checkForm(form)
53
  <h4 style="color: white; margin-left: 20px; padding: 8px 0px 0px;"><?php echo $this->__('Download to File')?></h4>
54
  <fieldset id="my-fieldset" style="background:white;">
55
  <table cellspacing="0" class="form-list">
56
- <tr>
57
  <td class="label"><?php echo $this->__('Download categories in csv format')?> </td>
58
  <td class="input-ele"> <button onclick="return checkForm(this);" class="scalable save" value="7" type="button"><span>Export</span></button></td>
59
  </tr>
60
- </table>
 
 
 
 
 
61
  </fieldset>
62
  </form>
63
  </div>
53
  <h4 style="color: white; margin-left: 20px; padding: 8px 0px 0px;"><?php echo $this->__('Download to File')?></h4>
54
  <fieldset id="my-fieldset" style="background:white;">
55
  <table cellspacing="0" class="form-list">
56
+ <tr>
57
  <td class="label"><?php echo $this->__('Download categories in csv format')?> </td>
58
  <td class="input-ele"> <button onclick="return checkForm(this);" class="scalable save" value="7" type="button"><span>Export</span></button></td>
59
  </tr>
60
+ <tr>
61
+ <td class="label"><?php echo $this->__('Download products in csv format')?> </td>
62
+ <td class="input-ele"> <button onclick="return checkForm(this);" class="scalable save" value="10" type="button"><span>Export</span></button></td>
63
+ </tr>
64
+ </table>
65
+ <i>(Before downloading products please select either sku mapping or product id mapping with sales import section of configuration settings)</i>
66
  </fieldset>
67
  </form>
68
  </div>
app/etc/modules/Bluefish_Connection.xml CHANGED
@@ -4,7 +4,7 @@
4
  <Bluefish_Connection>
5
  <active>true</active>
6
  <codePool>local</codePool>
7
- <version>1.1.4</version>
8
  </Bluefish_Connection>
9
  </modules>
10
  </config>
4
  <Bluefish_Connection>
5
  <active>true</active>
6
  <codePool>local</codePool>
7
+ <version>1.1.5</version>
8
  </Bluefish_Connection>
9
  </modules>
10
  </config>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Bluefish_Connection</name>
4
- <version>1.1.4</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
@@ -19,9 +19,9 @@ http://support.bluefishretail.com/entries/30115203-Installation-and-set-up&#xD;
19
  We are on hand to help you get setup, contact us through our website www.bluefishretail.com</description>
20
  <notes>This extension can be used by the users of bluefishretail,by providing appropriate credentials,given to them by bluefishretail.</notes>
21
  <authors><author><name>JDoyle</name><user>jdoyle</user><email>jdoyle@bluefishretail.com</email></author></authors>
22
- <date>2014-12-18</date>
23
- <time>14:05:15</time>
24
- <contents><target name="mageetc"><dir name="modules"><file name="Bluefish_Connection.xml" hash="d7c5ec7ed43eb33ef3ecae13b6c3f4f5"/></dir></target><target name="magelocal"><dir name="Bluefish"><dir name="Connection"><dir name="Block"><dir name="Adminhtml"><dir name="Bluestorecron"><file name="Grid.php" hash="607f11628693a178bf3b24a1fa00d186"/></dir><file name="Bluestorecron.php" hash="9ed58d66971718270d9bedffe3f577fa"/><dir name="Bluestorescheduler"><file name="Grid.php" hash="5c86b64f9af2a02ea9e9a64111274b72"/></dir><file name="Bluestorescheduler.php" hash="15aaa462a00aea87da5c7606767c7d26"/><dir name="Errorsaleimport"><file name="Grid.php" hash="a70ff1d4899e013d7c08480f15be87e7"/></dir><file name="Errorsaleimport.php" hash="3968634c28963ec4f87854b1dfbcbbf1"/></dir><file name="Bluestoreproducttype.php" hash="4ea7535123b172c7467b66134d08f167"/><file name="Bluestoretaxclass.php" hash="d1777a291e91fef8d23ace0de9e68921"/><file name="Bluestoretaxcode.php" hash="a969e969aab9846a9019072162d215ab"/><file name="Cronschedule.php" hash="4062fd7c8fac5605670b559734767188"/><file name="Databasemapping.php" hash="e1f41279da9fbb1a79eb5184a5ee769e"/><file name="Outofstocksale.php" hash="7e0d652af931910dff6d808ce3295dd7"/><file name="Paymentmethodcode.php" hash="fd4c33ee96330ee1d75841aa09de8774"/><file name="Productdatabasemapping.php" hash="946ad48493133aecf13adc56a6a8f389"/><file name="Salesmapping.php" hash="a842151ccde98cd5bd072038925872c6"/></dir><dir name="Helper"><file name="Data.php" hash="2cd2e9cf9728228d68be3280bbebf7ff"/></dir><dir name="Model"><file name="Bluestoreschedule.php" hash="840d1c3dadd60eeb4787a43b4d870d66"/><dir name="Carrier"><file name="Bsaleshippingmethod.php" hash="8586350fc9ca245ee23af8ab7cb3f264"/></dir><dir name="CatalogInventory"><dir name="Stock"><file name="Item.php" hash="fac3729dd265ce1857e03c4c2e2f5f94"/></dir></dir><dir name="Checkout"><dir name="Cart"><file name="Api.php" hash="031771c7af6a9ac668e6a545957bdeeb"/></dir></dir><dir name="Collection"><file name="Crons.php" hash="86aba02a88fc122f9641c89a4fcd434c"/></dir><file name="Configuration.php" hash="7dd9b00e905b7f260c4a9becc82438ff"/><file name="Connection.php" hash="76da5fa34acfb6294ca712e76b22e223"/><file name="Cronobserver.php" hash="2f84a301ec60018a19c7653c9aa83385"/><file name="Errorsaleimport.php" hash="a332ee81b77c2852ce50743b2f5dfcd1"/><dir name="Mysql4"><dir name="Connection"><file name="Collection.php" hash="0c9166e76131a7092872871b2444754b"/></dir><file name="Connection.php" hash="2c982c25bb2dc863a2693433063a0050"/><dir name="Errorsaleimport"><file name="Collection.php" hash="2717a8f56f9bdef64543bfb1ae6d094c"/></dir><file name="Errorsaleimport.php" hash="3aa550d191ae384d7d263b27e6118fa3"/></dir><file name="Observer.php" hash="b374e815b000f34b77baf16bacccf9fc"/><file name="Paymentmethod.php" hash="fb54e7fd83236aaa7824a773b94afe74"/><file name="Status.php" hash="4fdeede680b4420331aae6fda74d36d9"/><file name="Store.php" hash="7b829fe08727d0d7ac2c59abcd34c4b2"/><file name="Validationcrontime.php" hash="525b215224b7e42c945c2b53d3b00c20"/><file name="Validationpaymentmap.php" hash="34eca47cafbe547e9cbb019f61e3de83"/><file name="Validationtaxclass.php" hash="52ef2ddc4cc6e1a7c146c664e2b88ed3"/><file name="Validationtaxcode.php" hash="42f2fc5dcecfb65ce3a56ed167f41266"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="Bluefish_API.php" hash="c07d056ffe4561dc211cc4a946807770"/><file name="Bluefish_Error_Reporting.php" hash="ae152b9b57c4dfee907a4e7f2b7fec1f"/><file name="BluestorecronController.php" hash="371f55c62d4d19151ee11211e82e85c2"/><file name="BluestoreschedulerController.php" hash="198366aa10c1f2bea714a587dc0fb10a"/><file name="CategorydataController.php" hash="7dc83d091cba0bf402f0d8d5c349859f"/><file name="ErrorsaleimportController.php" hash="17a0b262ac68095083ba6180b5c85a1b"/><file name="MyformController.php" hash="a280cc7f57f8e1a1683b1beb815d038f"/><file name="MyformexportController.php" hash="cc856e317b89f29fc35cc789918ceebe"/><file name="ProductdataController.php" hash="9bdedff5d6650a71aafa0cd4195cc002"/><file name="Xml.php" hash="e235cdd526e005e4f4f9e7fa0eade89d"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="f958df2fe25675db0cfa466a13d21317"/><file name="config.xml" hash="9abec081e2091801aa3e0c15fadbb57e"/><file name="system.xml" hash="ff36332cfbb1748a943affbab6db5f65"/></dir><dir name="sql"><dir name="connection_setup"><file name="mysql4-install-0.1.0.php" hash="6badacdb48b9a868da95e2c1761732c4"/><file name="mysql4-upgrade-0.1.0-1.1.1.php" hash="f4d1a592ab45d034f6b40c3712accb63"/><file name="mysql4-upgrade-1.1.1-1.1.2.php" hash="e32a7745adad592cd3fb9a64257d1359"/><file name="mysql4-upgrade-1.1.2-1.1.3.php" hash="a418dfa877ade09191aa57a6a7178933"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="connection"><file name="array_dropdown.phtml" hash="a7570dbb97b61c7f55d40bca280043b8"/><file name="cronschedule.phtml" hash="c503011206bc0b7ca2b7e6fe2fef401c"/><file name="custom_product_radioinput.phtml" hash="50acd5bf82b7926e56f91246cbefb3cf"/><file name="custom_radioinput.phtml" hash="203c94df69e858acdc776d4b10fa812c"/><file name="myform.phtml" hash="016a79f18b4483c697bfbe57ee27e5ee"/><file name="myformexport.phtml" hash="b377f1ac593f43f7b160b7ade7c472da"/><file name="outofstocksale.phtml" hash="e3c1641d1ff1362f3f1845bdd161f3bf"/><file name="salesmapping_radioinput.phtml" hash="e3c1641d1ff1362f3f1845bdd161f3bf"/></dir></dir><dir name="layout"><file name="connection.xml" hash="ae5bb64dd8522cda5c87a075dcdf070c"/></dir></dir></dir></dir></target></contents>
25
  <compatible/>
26
  <dependencies><required><php><min>5.1.0</min><max>5.6.0</max></php></required></dependencies>
27
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Bluefish_Connection</name>
4
+ <version>1.1.5</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
19
  We are on hand to help you get setup, contact us through our website www.bluefishretail.com</description>
20
  <notes>This extension can be used by the users of bluefishretail,by providing appropriate credentials,given to them by bluefishretail.</notes>
21
  <authors><author><name>JDoyle</name><user>jdoyle</user><email>jdoyle@bluefishretail.com</email></author></authors>
22
+ <date>2015-04-22</date>
23
+ <time>10:40:37</time>
24
+ <contents><target name="mageetc"><dir name="modules"><file name="Bluefish_Connection.xml" hash="3bc6e3ec98be70ee60a5ffa08ffb4f86"/></dir></target><target name="magelocal"><dir name="Bluefish"><dir name="Connection"><dir name="Block"><dir name="Adminhtml"><dir name="Bluestorecron"><file name="Grid.php" hash="607f11628693a178bf3b24a1fa00d186"/></dir><file name="Bluestorecron.php" hash="9ed58d66971718270d9bedffe3f577fa"/><dir name="Bluestorescheduler"><file name="Grid.php" hash="5c86b64f9af2a02ea9e9a64111274b72"/></dir><file name="Bluestorescheduler.php" hash="15aaa462a00aea87da5c7606767c7d26"/><dir name="Errorsaleimport"><file name="Grid.php" hash="a70ff1d4899e013d7c08480f15be87e7"/></dir><file name="Errorsaleimport.php" hash="3968634c28963ec4f87854b1dfbcbbf1"/></dir><file name="Bluestoreproducttype.php" hash="4ea7535123b172c7467b66134d08f167"/><file name="Bluestoretaxclass.php" hash="d1777a291e91fef8d23ace0de9e68921"/><file name="Bluestoretaxcode.php" hash="a969e969aab9846a9019072162d215ab"/><file name="Cronschedule.php" hash="4062fd7c8fac5605670b559734767188"/><file name="Databasemapping.php" hash="e1f41279da9fbb1a79eb5184a5ee769e"/><file name="Outofstocksale.php" hash="7e0d652af931910dff6d808ce3295dd7"/><file name="Paymentmethodcode.php" hash="fd4c33ee96330ee1d75841aa09de8774"/><file name="Productdatabasemapping.php" hash="946ad48493133aecf13adc56a6a8f389"/><file name="Salesmapping.php" hash="a842151ccde98cd5bd072038925872c6"/></dir><dir name="Helper"><file name="Data.php" hash="2cd2e9cf9728228d68be3280bbebf7ff"/></dir><dir name="Model"><file name="Bluestoreschedule.php" hash="840d1c3dadd60eeb4787a43b4d870d66"/><dir name="Carrier"><file name="Bsaleshippingmethod.php" hash="8586350fc9ca245ee23af8ab7cb3f264"/></dir><dir name="CatalogInventory"><dir name="Stock"><file name="Item.php" hash="fac3729dd265ce1857e03c4c2e2f5f94"/></dir></dir><dir name="Checkout"><dir name="Cart"><file name="Api.php" hash="031771c7af6a9ac668e6a545957bdeeb"/></dir></dir><dir name="Collection"><file name="Crons.php" hash="86aba02a88fc122f9641c89a4fcd434c"/></dir><file name="Configuration.php" hash="7dd9b00e905b7f260c4a9becc82438ff"/><file name="Connection.php" hash="76da5fa34acfb6294ca712e76b22e223"/><file name="Cronobserver.php" hash="5184d3827ec55aa9eb93ba84fc8d2616"/><file name="Errorsaleimport.php" hash="a332ee81b77c2852ce50743b2f5dfcd1"/><dir name="Mysql4"><dir name="Connection"><file name="Collection.php" hash="0c9166e76131a7092872871b2444754b"/></dir><file name="Connection.php" hash="2c982c25bb2dc863a2693433063a0050"/><dir name="Errorsaleimport"><file name="Collection.php" hash="2717a8f56f9bdef64543bfb1ae6d094c"/></dir><file name="Errorsaleimport.php" hash="3aa550d191ae384d7d263b27e6118fa3"/></dir><file name="Observer.php" hash="b374e815b000f34b77baf16bacccf9fc"/><file name="Paymentmethod.php" hash="fb54e7fd83236aaa7824a773b94afe74"/><file name="Status.php" hash="4fdeede680b4420331aae6fda74d36d9"/><file name="Store.php" hash="7b829fe08727d0d7ac2c59abcd34c4b2"/><file name="Validationcrontime.php" hash="525b215224b7e42c945c2b53d3b00c20"/><file name="Validationpaymentmap.php" hash="34eca47cafbe547e9cbb019f61e3de83"/><file name="Validationtaxclass.php" hash="52ef2ddc4cc6e1a7c146c664e2b88ed3"/><file name="Validationtaxcode.php" hash="42f2fc5dcecfb65ce3a56ed167f41266"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="Bluefish_API.php" hash="c07d056ffe4561dc211cc4a946807770"/><file name="Bluefish_Error_Reporting.php" hash="ae152b9b57c4dfee907a4e7f2b7fec1f"/><file name="BluestorecronController.php" hash="371f55c62d4d19151ee11211e82e85c2"/><file name="BluestoreschedulerController.php" hash="3995ffe7faf68619a09509c9192943cf"/><file name="CategorydataController.php" hash="7dc83d091cba0bf402f0d8d5c349859f"/><file name="ErrorsaleimportController.php" hash="17a0b262ac68095083ba6180b5c85a1b"/><file name="MyformController.php" hash="53b8b51da382b6327089824e67cc8d57"/><file name="MyformexportController.php" hash="83a832f12537c5efa7f3b7241dfa48e2"/><file name="ProductdataController.php" hash="9bdedff5d6650a71aafa0cd4195cc002"/><file name="Xml.php" hash="563425ac3aa721dd6534e91c2bad932a"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="f958df2fe25675db0cfa466a13d21317"/><file name="config.xml" hash="ec0ccffd551d001ed200eb9e979fe2e7"/><file name="system.xml" hash="db078d0901f0f76151ae04f8488d7091"/></dir><dir name="sql"><dir name="connection_setup"><file name="mysql4-install-0.1.0.php" hash="6badacdb48b9a868da95e2c1761732c4"/><file name="mysql4-upgrade-0.1.0-1.1.1.php" hash="f4d1a592ab45d034f6b40c3712accb63"/><file name="mysql4-upgrade-1.1.1-1.1.2.php" hash="e32a7745adad592cd3fb9a64257d1359"/><file name="mysql4-upgrade-1.1.2-1.1.3.php" hash="a418dfa877ade09191aa57a6a7178933"/><file name="mysql4-upgrade-1.1.3-1.1.5.php" hash="2fd1948687bf0f1ff53bcd032e0dd636"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="connection"><file name="array_dropdown.phtml" hash="a7570dbb97b61c7f55d40bca280043b8"/><file name="cronschedule.phtml" hash="c503011206bc0b7ca2b7e6fe2fef401c"/><file name="custom_product_radioinput.phtml" hash="50acd5bf82b7926e56f91246cbefb3cf"/><file name="custom_radioinput.phtml" hash="203c94df69e858acdc776d4b10fa812c"/><file name="myform.phtml" hash="016a79f18b4483c697bfbe57ee27e5ee"/><file name="myformexport.phtml" hash="c6b1c7d578d12da74a0622f5264a08ba"/><file name="outofstocksale.phtml" hash="e3c1641d1ff1362f3f1845bdd161f3bf"/><file name="salesmapping_radioinput.phtml" hash="e3c1641d1ff1362f3f1845bdd161f3bf"/></dir></dir><dir name="layout"><file name="connection.xml" hash="ae5bb64dd8522cda5c87a075dcdf070c"/></dir></dir></dir></dir></target></contents>
25
  <compatible/>
26
  <dependencies><required><php><min>5.1.0</min><max>5.6.0</max></php></required></dependencies>
27
  </package>