Version Notes
Public release-1.1.0.0
Download this release
Release Info
| Developer | MageWare |
| Extension | MageWare_SalesGrids |
| Version | 1.1.0.0 |
| Comparing to | |
| See all releases | |
Code changes from version 1.0.0.0 to 1.1.0.0
- app/code/community/MageWare/SalesGrids/Model/Observer.php +8 -8
- app/code/community/MageWare/SalesGrids/Model/Resource/Order.php +24 -0
- app/code/community/MageWare/SalesGrids/Model/Resource/Order/Creditmemo.php +24 -0
- app/code/community/MageWare/SalesGrids/Model/Resource/Order/Invoice.php +24 -0
- app/code/community/MageWare/SalesGrids/Model/Resource/Order/Shipment.php +24 -0
- app/code/community/MageWare/SalesGrids/data/salesgrids_setup/data-upgrade-1.0.0.0-1.1.0.0.php +163 -0
- app/code/community/MageWare/SalesGrids/etc/config.xml +1 -1
- package.xml +5 -5
app/code/community/MageWare/SalesGrids/Model/Observer.php
CHANGED
|
@@ -10,14 +10,14 @@ class MageWare_SalesGrids_Model_Observer
|
|
| 10 |
'product_sku',
|
| 11 |
'sales/order_item',
|
| 12 |
array('entity_id' => 'order_id'),
|
| 13 |
-
'GROUP_CONCAT(DISTINCT {{table}}.sku ORDER BY {{table}}.
|
| 14 |
);
|
| 15 |
|
| 16 |
$resource->addVirtualGridColumn(
|
| 17 |
'product_name',
|
| 18 |
'sales/order_item',
|
| 19 |
array('entity_id' => 'order_id'),
|
| 20 |
-
'GROUP_CONCAT(DISTINCT {{table}}.name ORDER BY {{table}}.
|
| 21 |
);
|
| 22 |
|
| 23 |
$resource->addVirtualGridColumn(
|
|
@@ -43,14 +43,14 @@ class MageWare_SalesGrids_Model_Observer
|
|
| 43 |
'product_sku',
|
| 44 |
'sales/invoice_item',
|
| 45 |
array('entity_id' => 'parent_id'),
|
| 46 |
-
'GROUP_CONCAT(DISTINCT {{table}}.sku ORDER BY {{table}}.
|
| 47 |
);
|
| 48 |
|
| 49 |
$resource->addVirtualGridColumn(
|
| 50 |
'product_name',
|
| 51 |
'sales/invoice_item',
|
| 52 |
array('entity_id' => 'parent_id'),
|
| 53 |
-
'GROUP_CONCAT(DISTINCT {{table}}.name ORDER BY {{table}}.
|
| 54 |
);
|
| 55 |
}
|
| 56 |
|
|
@@ -69,14 +69,14 @@ class MageWare_SalesGrids_Model_Observer
|
|
| 69 |
'product_sku',
|
| 70 |
'sales/shipment_item',
|
| 71 |
array('entity_id' => 'parent_id'),
|
| 72 |
-
'GROUP_CONCAT(DISTINCT {{table}}.sku ORDER BY {{table}}.
|
| 73 |
);
|
| 74 |
|
| 75 |
$resource->addVirtualGridColumn(
|
| 76 |
'product_name',
|
| 77 |
'sales/shipment_item',
|
| 78 |
array('entity_id' => 'parent_id'),
|
| 79 |
-
'GROUP_CONCAT(DISTINCT {{table}}.name ORDER BY {{table}}.
|
| 80 |
);
|
| 81 |
}
|
| 82 |
|
|
@@ -95,14 +95,14 @@ class MageWare_SalesGrids_Model_Observer
|
|
| 95 |
'product_sku',
|
| 96 |
'sales/creditmemo_item',
|
| 97 |
array('entity_id' => 'parent_id'),
|
| 98 |
-
'GROUP_CONCAT(DISTINCT {{table}}.sku ORDER BY {{table}}.
|
| 99 |
);
|
| 100 |
|
| 101 |
$resource->addVirtualGridColumn(
|
| 102 |
'product_name',
|
| 103 |
'sales/creditmemo_item',
|
| 104 |
array('entity_id' => 'parent_id'),
|
| 105 |
-
'GROUP_CONCAT(DISTINCT {{table}}.name ORDER BY {{table}}.
|
| 106 |
);
|
| 107 |
}
|
| 108 |
}
|
| 10 |
'product_sku',
|
| 11 |
'sales/order_item',
|
| 12 |
array('entity_id' => 'order_id'),
|
| 13 |
+
'GROUP_CONCAT(DISTINCT {{table}}.sku ORDER BY {{table}}.item_id ASC SEPARATOR "\n")'
|
| 14 |
);
|
| 15 |
|
| 16 |
$resource->addVirtualGridColumn(
|
| 17 |
'product_name',
|
| 18 |
'sales/order_item',
|
| 19 |
array('entity_id' => 'order_id'),
|
| 20 |
+
'GROUP_CONCAT(DISTINCT {{table}}.name ORDER BY {{table}}.item_id ASC SEPARATOR "\n")'
|
| 21 |
);
|
| 22 |
|
| 23 |
$resource->addVirtualGridColumn(
|
| 43 |
'product_sku',
|
| 44 |
'sales/invoice_item',
|
| 45 |
array('entity_id' => 'parent_id'),
|
| 46 |
+
'GROUP_CONCAT(DISTINCT {{table}}.sku ORDER BY {{table}}.entity_id ASC SEPARATOR "\n")'
|
| 47 |
);
|
| 48 |
|
| 49 |
$resource->addVirtualGridColumn(
|
| 50 |
'product_name',
|
| 51 |
'sales/invoice_item',
|
| 52 |
array('entity_id' => 'parent_id'),
|
| 53 |
+
'GROUP_CONCAT(DISTINCT {{table}}.name ORDER BY {{table}}.entity_id ASC SEPARATOR "\n")'
|
| 54 |
);
|
| 55 |
}
|
| 56 |
|
| 69 |
'product_sku',
|
| 70 |
'sales/shipment_item',
|
| 71 |
array('entity_id' => 'parent_id'),
|
| 72 |
+
'GROUP_CONCAT(DISTINCT {{table}}.sku ORDER BY {{table}}.entity_id ASC SEPARATOR "\n")'
|
| 73 |
);
|
| 74 |
|
| 75 |
$resource->addVirtualGridColumn(
|
| 76 |
'product_name',
|
| 77 |
'sales/shipment_item',
|
| 78 |
array('entity_id' => 'parent_id'),
|
| 79 |
+
'GROUP_CONCAT(DISTINCT {{table}}.name ORDER BY {{table}}.entity_id ASC SEPARATOR "\n")'
|
| 80 |
);
|
| 81 |
}
|
| 82 |
|
| 95 |
'product_sku',
|
| 96 |
'sales/creditmemo_item',
|
| 97 |
array('entity_id' => 'parent_id'),
|
| 98 |
+
'GROUP_CONCAT(DISTINCT {{table}}.sku ORDER BY {{table}}.entity_id ASC SEPARATOR "\n")'
|
| 99 |
);
|
| 100 |
|
| 101 |
$resource->addVirtualGridColumn(
|
| 102 |
'product_name',
|
| 103 |
'sales/creditmemo_item',
|
| 104 |
array('entity_id' => 'parent_id'),
|
| 105 |
+
'GROUP_CONCAT(DISTINCT {{table}}.name ORDER BY {{table}}.entity_id ASC SEPARATOR "\n")'
|
| 106 |
);
|
| 107 |
}
|
| 108 |
}
|
app/code/community/MageWare/SalesGrids/Model/Resource/Order.php
CHANGED
|
@@ -11,4 +11,28 @@ class MageWare_SalesGrids_Model_Resource_Order
|
|
| 11 |
|
| 12 |
return $select;
|
| 13 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
}
|
| 11 |
|
| 12 |
return $select;
|
| 13 |
}
|
| 14 |
+
|
| 15 |
+
public function updateOnRelatedRecordChanged($field, $entityId)
|
| 16 |
+
{
|
| 17 |
+
$adapter = $this->_getWriteAdapter();
|
| 18 |
+
$column = array();
|
| 19 |
+
|
| 20 |
+
$select = $adapter->select()
|
| 21 |
+
->from(array('main_table' => $this->getMainTable()), $column)
|
| 22 |
+
->where('main_table.' . $field .' = ?', $entityId)
|
| 23 |
+
->group('main_table.' . $this->getIdFieldName());
|
| 24 |
+
|
| 25 |
+
$this->joinVirtualGridColumnsToSelect('main_table', $select, $column);
|
| 26 |
+
$fieldsToUpdate = $adapter->fetchRow($select);
|
| 27 |
+
|
| 28 |
+
if ($fieldsToUpdate) {
|
| 29 |
+
return $adapter->update(
|
| 30 |
+
$this->getGridTable(),
|
| 31 |
+
$fieldsToUpdate,
|
| 32 |
+
$adapter->quoteInto($this->getGridTable() . '.' . $field . ' = ?', $entityId)
|
| 33 |
+
);
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
return 0;
|
| 37 |
+
}
|
| 38 |
}
|
app/code/community/MageWare/SalesGrids/Model/Resource/Order/Creditmemo.php
CHANGED
|
@@ -11,4 +11,28 @@ class MageWare_SalesGrids_Model_Resource_Order_Creditmemo
|
|
| 11 |
|
| 12 |
return $select;
|
| 13 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
}
|
| 11 |
|
| 12 |
return $select;
|
| 13 |
}
|
| 14 |
+
|
| 15 |
+
public function updateOnRelatedRecordChanged($field, $entityId)
|
| 16 |
+
{
|
| 17 |
+
$adapter = $this->_getWriteAdapter();
|
| 18 |
+
$column = array();
|
| 19 |
+
|
| 20 |
+
$select = $adapter->select()
|
| 21 |
+
->from(array('main_table' => $this->getMainTable()), $column)
|
| 22 |
+
->where('main_table.' . $field .' = ?', $entityId)
|
| 23 |
+
->group('main_table.' . $this->getIdFieldName());
|
| 24 |
+
|
| 25 |
+
$this->joinVirtualGridColumnsToSelect('main_table', $select, $column);
|
| 26 |
+
$fieldsToUpdate = $adapter->fetchRow($select);
|
| 27 |
+
|
| 28 |
+
if ($fieldsToUpdate) {
|
| 29 |
+
return $adapter->update(
|
| 30 |
+
$this->getGridTable(),
|
| 31 |
+
$fieldsToUpdate,
|
| 32 |
+
$adapter->quoteInto($this->getGridTable() . '.' . $field . ' = ?', $entityId)
|
| 33 |
+
);
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
return 0;
|
| 37 |
+
}
|
| 38 |
}
|
app/code/community/MageWare/SalesGrids/Model/Resource/Order/Invoice.php
CHANGED
|
@@ -11,4 +11,28 @@ class MageWare_SalesGrids_Model_Resource_Order_Invoice
|
|
| 11 |
|
| 12 |
return $select;
|
| 13 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
}
|
| 11 |
|
| 12 |
return $select;
|
| 13 |
}
|
| 14 |
+
|
| 15 |
+
public function updateOnRelatedRecordChanged($field, $entityId)
|
| 16 |
+
{
|
| 17 |
+
$adapter = $this->_getWriteAdapter();
|
| 18 |
+
$column = array();
|
| 19 |
+
|
| 20 |
+
$select = $adapter->select()
|
| 21 |
+
->from(array('main_table' => $this->getMainTable()), $column)
|
| 22 |
+
->where('main_table.' . $field .' = ?', $entityId)
|
| 23 |
+
->group('main_table.' . $this->getIdFieldName());
|
| 24 |
+
|
| 25 |
+
$this->joinVirtualGridColumnsToSelect('main_table', $select, $column);
|
| 26 |
+
$fieldsToUpdate = $adapter->fetchRow($select);
|
| 27 |
+
|
| 28 |
+
if ($fieldsToUpdate) {
|
| 29 |
+
return $adapter->update(
|
| 30 |
+
$this->getGridTable(),
|
| 31 |
+
$fieldsToUpdate,
|
| 32 |
+
$adapter->quoteInto($this->getGridTable() . '.' . $field . ' = ?', $entityId)
|
| 33 |
+
);
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
return 0;
|
| 37 |
+
}
|
| 38 |
}
|
app/code/community/MageWare/SalesGrids/Model/Resource/Order/Shipment.php
CHANGED
|
@@ -11,4 +11,28 @@ class MageWare_SalesGrids_Model_Resource_Order_Shipment
|
|
| 11 |
|
| 12 |
return $select;
|
| 13 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
}
|
| 11 |
|
| 12 |
return $select;
|
| 13 |
}
|
| 14 |
+
|
| 15 |
+
public function updateOnRelatedRecordChanged($field, $entityId)
|
| 16 |
+
{
|
| 17 |
+
$adapter = $this->_getWriteAdapter();
|
| 18 |
+
$column = array();
|
| 19 |
+
|
| 20 |
+
$select = $adapter->select()
|
| 21 |
+
->from(array('main_table' => $this->getMainTable()), $column)
|
| 22 |
+
->where('main_table.' . $field .' = ?', $entityId)
|
| 23 |
+
->group('main_table.' . $this->getIdFieldName());
|
| 24 |
+
|
| 25 |
+
$this->joinVirtualGridColumnsToSelect('main_table', $select, $column);
|
| 26 |
+
$fieldsToUpdate = $adapter->fetchRow($select);
|
| 27 |
+
|
| 28 |
+
if ($fieldsToUpdate) {
|
| 29 |
+
return $adapter->update(
|
| 30 |
+
$this->getGridTable(),
|
| 31 |
+
$fieldsToUpdate,
|
| 32 |
+
$adapter->quoteInto($this->getGridTable() . '.' . $field . ' = ?', $entityId)
|
| 33 |
+
);
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
return 0;
|
| 37 |
+
}
|
| 38 |
}
|
app/code/community/MageWare/SalesGrids/data/salesgrids_setup/data-upgrade-1.0.0.0-1.1.0.0.php
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
$installer = $this;
|
| 4 |
+
|
| 5 |
+
$flatColumns = array_keys($installer->getConnection()->describeTable($installer->getTable('sales/order')));
|
| 6 |
+
$gridColumns = array_keys($installer->getConnection()->describeTable($installer->getTable('sales/order_grid')));
|
| 7 |
+
|
| 8 |
+
$flatColumnsToSelect = array_intersect($flatColumns, $gridColumns);
|
| 9 |
+
|
| 10 |
+
$select = $installer->getConnection()->select()
|
| 11 |
+
->from($installer->getTable('sales/order'), $flatColumnsToSelect)
|
| 12 |
+
->joinLeft(
|
| 13 |
+
$installer->getTable('sales/order_address'),
|
| 14 |
+
$installer->getTable('sales/order').'.billing_address_id='.$installer->getTable('sales/order_address').'.entity_id',
|
| 15 |
+
array('billing_name' => new Zend_Db_Expr('CONCAT(IFNULL('.$installer->getTable('sales/order_address').'.firstname, \'\'), \' \', IFNULL('.$installer->getTable('sales/order_address').'.lastname, \'\'))'))
|
| 16 |
+
)
|
| 17 |
+
->joinLeft(
|
| 18 |
+
$installer->getTable('sales/order_address'),
|
| 19 |
+
$installer->getTable('sales/order').'.shipping_address_id='.$installer->getTable('sales/order_address').'.entity_id',
|
| 20 |
+
array('shipping_name' => new Zend_Db_Expr('CONCAT(IFNULL('.$installer->getTable('sales/order_address').'.firstname, \'\'), \' \', IFNULL('.$installer->getTable('sales/order_address').'.lastname, \'\'))'))
|
| 21 |
+
)
|
| 22 |
+
->joinLeft(
|
| 23 |
+
$installer->getTable('sales/order_payment'),
|
| 24 |
+
$installer->getTable('sales/order').'.entity_id='.$installer->getTable('sales/order_payment').'.parent_id',
|
| 25 |
+
array('payment_method' => $installer->getTable('sales/order_payment').'.method')
|
| 26 |
+
)
|
| 27 |
+
->joinLeft(
|
| 28 |
+
$installer->getTable('sales/order_item'),
|
| 29 |
+
$installer->getTable('sales/order').'.entity_id='.$installer->getTable('sales/order_item').'.order_id',
|
| 30 |
+
array(
|
| 31 |
+
'product_sku' => new Zend_Db_Expr('GROUP_CONCAT(DISTINCT '.$installer->getTable('sales/order_item').'.sku ORDER BY '.$installer->getTable('sales/order_item').'.item_id ASC SEPARATOR "\n")'),
|
| 32 |
+
'product_name' => new Zend_Db_Expr('GROUP_CONCAT(DISTINCT '.$installer->getTable('sales/order_item').'.name ORDER BY '.$installer->getTable('sales/order_item').'.item_id ASC SEPARATOR "\n")')
|
| 33 |
+
)
|
| 34 |
+
)
|
| 35 |
+
->group($installer->getTable('sales/order').'.entity_id');
|
| 36 |
+
|
| 37 |
+
$flatColumnsToSelect[] = 'billing_name';
|
| 38 |
+
$flatColumnsToSelect[] = 'shipping_name';
|
| 39 |
+
$flatColumnsToSelect[] = 'payment_method';
|
| 40 |
+
$flatColumnsToSelect[] = 'product_sku';
|
| 41 |
+
$flatColumnsToSelect[] = 'product_name';
|
| 42 |
+
|
| 43 |
+
$installer->getConnection()->query($select->insertFromSelect($installer->getTable('sales/order_grid'), $flatColumnsToSelect, true));
|
| 44 |
+
|
| 45 |
+
$flatColumns = array_keys($installer->getConnection()->describeTable($installer->getTable('sales/invoice')));
|
| 46 |
+
$gridColumns = array_keys($installer->getConnection()->describeTable($installer->getTable('sales/invoice_grid')));
|
| 47 |
+
|
| 48 |
+
$flatColumnsToSelect = array_intersect($flatColumns, $gridColumns);
|
| 49 |
+
|
| 50 |
+
$select = $installer->getConnection()->select()
|
| 51 |
+
->from($installer->getTable('sales/invoice'), $flatColumnsToSelect)
|
| 52 |
+
->joinLeft(
|
| 53 |
+
$installer->getTable('sales/order_address'),
|
| 54 |
+
$installer->getTable('sales/invoice').'.billing_address_id='.$installer->getTable('sales/order_address').'.entity_id',
|
| 55 |
+
array('billing_name' => new Zend_Db_Expr('CONCAT(IFNULL('.$installer->getTable('sales/order_address').'.firstname, \'\'), \' \', IFNULL('.$installer->getTable('sales/order_address').'.lastname, \'\'))'))
|
| 56 |
+
)
|
| 57 |
+
->joinLeft(
|
| 58 |
+
$installer->getTable('sales/order'),
|
| 59 |
+
$installer->getTable('sales/invoice').'.order_id='.$installer->getTable('sales/order').'.entity_id',
|
| 60 |
+
array(
|
| 61 |
+
'customer_email' => $installer->getTable('sales/order').'.customer_email',
|
| 62 |
+
'order_increment_id' => $installer->getTable('sales/order').'.increment_id',
|
| 63 |
+
'order_created_at' => $installer->getTable('sales/order').'.created_at'
|
| 64 |
+
)
|
| 65 |
+
)
|
| 66 |
+
->joinLeft(
|
| 67 |
+
$installer->getTable('sales/invoice_item'),
|
| 68 |
+
$installer->getTable('sales/invoice').'.entity_id='.$installer->getTable('sales/invoice_item').'.parent_id',
|
| 69 |
+
array(
|
| 70 |
+
'product_sku' => new Zend_Db_Expr('GROUP_CONCAT(DISTINCT '.$installer->getTable('sales/invoice_item').'.sku ORDER BY '.$installer->getTable('sales/invoice_item').'.entity_id ASC SEPARATOR "\n")'),
|
| 71 |
+
'product_name' => new Zend_Db_Expr('GROUP_CONCAT(DISTINCT '.$installer->getTable('sales/invoice_item').'.name ORDER BY '.$installer->getTable('sales/invoice_item').'.entity_id ASC SEPARATOR "\n")')
|
| 72 |
+
)
|
| 73 |
+
)
|
| 74 |
+
->group($installer->getTable('sales/invoice').'.entity_id');
|
| 75 |
+
|
| 76 |
+
$flatColumnsToSelect[] = 'billing_name';
|
| 77 |
+
$flatColumnsToSelect[] = 'customer_email';
|
| 78 |
+
$flatColumnsToSelect[] = 'order_increment_id';
|
| 79 |
+
$flatColumnsToSelect[] = 'order_created_at';
|
| 80 |
+
$flatColumnsToSelect[] = 'product_sku';
|
| 81 |
+
$flatColumnsToSelect[] = 'product_name';
|
| 82 |
+
|
| 83 |
+
$installer->getConnection()->query($select->insertFromSelect($installer->getTable('sales/invoice_grid'), $flatColumnsToSelect, true));
|
| 84 |
+
|
| 85 |
+
$flatColumns = array_keys($installer->getConnection()->describeTable($installer->getTable('sales/shipment')));
|
| 86 |
+
$gridColumns = array_keys($installer->getConnection()->describeTable($installer->getTable('sales/shipment_grid')));
|
| 87 |
+
|
| 88 |
+
$flatColumnsToSelect = array_intersect($flatColumns, $gridColumns);
|
| 89 |
+
|
| 90 |
+
$select = $installer->getConnection()->select()
|
| 91 |
+
->from($installer->getTable('sales/shipment'), $flatColumnsToSelect)
|
| 92 |
+
->joinLeft(
|
| 93 |
+
$installer->getTable('sales/order_address'),
|
| 94 |
+
$installer->getTable('sales/shipment').'.shipping_address_id='.$installer->getTable('sales/order_address').'.entity_id',
|
| 95 |
+
array('shipping_name' => new Zend_Db_Expr('CONCAT(IFNULL('.$installer->getTable('sales/order_address').'.firstname, \'\'), \' \', IFNULL('.$installer->getTable('sales/order_address').'.lastname, \'\'))'))
|
| 96 |
+
)
|
| 97 |
+
->joinLeft(
|
| 98 |
+
$installer->getTable('sales/order'),
|
| 99 |
+
$installer->getTable('sales/shipment').'.order_id='.$installer->getTable('sales/order').'.entity_id',
|
| 100 |
+
array(
|
| 101 |
+
'customer_email' => $installer->getTable('sales/order').'.customer_email',
|
| 102 |
+
'order_increment_id '=> $installer->getTable('sales/order').'.increment_id',
|
| 103 |
+
'order_created_at' => $installer->getTable('sales/order').'.created_at'
|
| 104 |
+
)
|
| 105 |
+
)
|
| 106 |
+
->joinLeft(
|
| 107 |
+
$installer->getTable('sales/shipment_item'),
|
| 108 |
+
$installer->getTable('sales/shipment').'.entity_id='.$installer->getTable('sales/shipment_item').'.parent_id',
|
| 109 |
+
array(
|
| 110 |
+
'product_sku' => new Zend_Db_Expr('GROUP_CONCAT(DISTINCT '.$installer->getTable('sales/shipment_item').'.sku ORDER BY '.$installer->getTable('sales/shipment_item').'.entity_id ASC SEPARATOR "\n")'),
|
| 111 |
+
'product_name' => new Zend_Db_Expr('GROUP_CONCAT(DISTINCT '.$installer->getTable('sales/shipment_item').'.name ORDER BY '.$installer->getTable('sales/shipment_item').'.entity_id ASC SEPARATOR "\n")')
|
| 112 |
+
)
|
| 113 |
+
)
|
| 114 |
+
->group($installer->getTable('sales/shipment').'.entity_id');
|
| 115 |
+
|
| 116 |
+
$flatColumnsToSelect[] = 'shipping_name';
|
| 117 |
+
$flatColumnsToSelect[] = 'customer_email';
|
| 118 |
+
$flatColumnsToSelect[] = 'order_increment_id';
|
| 119 |
+
$flatColumnsToSelect[] = 'order_created_at';
|
| 120 |
+
$flatColumnsToSelect[] = 'product_sku';
|
| 121 |
+
$flatColumnsToSelect[] = 'product_name';
|
| 122 |
+
|
| 123 |
+
$installer->getConnection()->query($select->insertFromSelect($installer->getTable('sales/shipment_grid'), $flatColumnsToSelect, true));
|
| 124 |
+
|
| 125 |
+
$flatColumns = array_keys($installer->getConnection()->describeTable($installer->getTable('sales/creditmemo')));
|
| 126 |
+
$gridColumns = array_keys($installer->getConnection()->describeTable($installer->getTable('sales/creditmemo_grid')));
|
| 127 |
+
|
| 128 |
+
$flatColumnsToSelect = array_intersect($flatColumns, $gridColumns);
|
| 129 |
+
|
| 130 |
+
$select = $installer->getConnection()->select()
|
| 131 |
+
->from($installer->getTable('sales/creditmemo'), $flatColumnsToSelect)
|
| 132 |
+
->joinLeft(
|
| 133 |
+
$installer->getTable('sales/order_address'),
|
| 134 |
+
$installer->getTable('sales/creditmemo').'.billing_address_id='.$installer->getTable('sales/order_address').'.entity_id',
|
| 135 |
+
array('billing_name' => new Zend_Db_Expr('CONCAT(IFNULL('.$installer->getTable('sales/order_address').'.firstname, \'\'), \' \', IFNULL('.$installer->getTable('sales/order_address').'.lastname, \'\'))'))
|
| 136 |
+
)
|
| 137 |
+
->joinLeft(
|
| 138 |
+
$installer->getTable('sales/order'),
|
| 139 |
+
$installer->getTable('sales/creditmemo').'.order_id='.$installer->getTable('sales/order').'.entity_id',
|
| 140 |
+
array(
|
| 141 |
+
'customer_email' => $installer->getTable('sales/order').'.customer_email',
|
| 142 |
+
'order_increment_id '=> $installer->getTable('sales/order').'.increment_id',
|
| 143 |
+
'order_created_at' => $installer->getTable('sales/order').'.created_at'
|
| 144 |
+
)
|
| 145 |
+
)
|
| 146 |
+
->joinLeft(
|
| 147 |
+
$installer->getTable('sales/creditmemo_item'),
|
| 148 |
+
$installer->getTable('sales/creditmemo').'.entity_id='.$installer->getTable('sales/creditmemo_item').'.parent_id',
|
| 149 |
+
array(
|
| 150 |
+
'product_sku' => new Zend_Db_Expr('GROUP_CONCAT(DISTINCT '.$installer->getTable('sales/creditmemo_item').'.sku ORDER BY '.$installer->getTable('sales/creditmemo_item').'.entity_id ASC SEPARATOR "\n")'),
|
| 151 |
+
'product_name' => new Zend_Db_Expr('GROUP_CONCAT(DISTINCT '.$installer->getTable('sales/creditmemo_item').'.name ORDER BY '.$installer->getTable('sales/creditmemo_item').'.entity_id ASC SEPARATOR "\n")')
|
| 152 |
+
)
|
| 153 |
+
)
|
| 154 |
+
->group($installer->getTable('sales/creditmemo').'.entity_id');
|
| 155 |
+
|
| 156 |
+
$flatColumnsToSelect[] = 'billing_name';
|
| 157 |
+
$flatColumnsToSelect[] = 'customer_email';
|
| 158 |
+
$flatColumnsToSelect[] = 'order_increment_id';
|
| 159 |
+
$flatColumnsToSelect[] = 'order_created_at';
|
| 160 |
+
$flatColumnsToSelect[] = 'product_sku';
|
| 161 |
+
$flatColumnsToSelect[] = 'product_name';
|
| 162 |
+
|
| 163 |
+
$installer->getConnection()->query($select->insertFromSelect($installer->getTable('sales/creditmemo_grid'), $flatColumnsToSelect, true));
|
app/code/community/MageWare/SalesGrids/etc/config.xml
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<MageWare_SalesGrids>
|
| 5 |
-
<version>1.
|
| 6 |
</MageWare_SalesGrids>
|
| 7 |
</modules>
|
| 8 |
<global>
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<MageWare_SalesGrids>
|
| 5 |
+
<version>1.1.0.0</version>
|
| 6 |
</MageWare_SalesGrids>
|
| 7 |
</modules>
|
| 8 |
<global>
|
package.xml
CHANGED
|
@@ -1,18 +1,18 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>MageWare_SalesGrids</name>
|
| 4 |
-
<version>1.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://www.gnu.org/licenses/gpl.html">GPL v3.0</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
<summary>Module for extending order management grids.</summary>
|
| 10 |
<description>Makes order management much easier and efficient for store administrators.</description>
|
| 11 |
-
<notes>Public release-1.
|
| 12 |
<authors><author><name>MageWare</name><user>mageware</user><email>magentocommerce@mageware.co</email></author></authors>
|
| 13 |
-
<date>2013-
|
| 14 |
-
<time>
|
| 15 |
-
<contents><target name="magecommunity"><dir name="MageWare"><dir name="SalesGrids"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Creditmemo"><file name="Grid.php" hash="eafc15a3c8ce1822beea8421b6a38b05"/></dir><dir name="Invoice"><file name="Grid.php" hash="797a7cdf943d0b08886518204ced5b16"/></dir><dir name="Order"><file name="Grid.php" hash="044c3746aaab806e792ec51509ea9146"/></dir><dir name="Shipment"><file name="Grid.php" hash="da16bda01942010040311a1a0e3010af"/></dir></dir><dir name="Widget"><dir name="Grid"><dir name="Column"><dir name="Renderer"><file name="List.php" hash="bc8b3a99b39aa84ad00c68757a8d9580"/></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="cd4559adf776e0d4aee51bf47d3e5eb8"/></dir><dir name="Model"><file name="Observer.php" hash="
|
| 16 |
<compatible/>
|
| 17 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><package><name>Mage_All_Latest</name><channel>community</channel><min>1.6.0.0</min><max>1.7.0.2</max></package></required></dependencies>
|
| 18 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>MageWare_SalesGrids</name>
|
| 4 |
+
<version>1.1.0.0</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://www.gnu.org/licenses/gpl.html">GPL v3.0</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
<summary>Module for extending order management grids.</summary>
|
| 10 |
<description>Makes order management much easier and efficient for store administrators.</description>
|
| 11 |
+
<notes>Public release-1.1.0.0</notes>
|
| 12 |
<authors><author><name>MageWare</name><user>mageware</user><email>magentocommerce@mageware.co</email></author></authors>
|
| 13 |
+
<date>2013-03-29</date>
|
| 14 |
+
<time>21:13:53</time>
|
| 15 |
+
<contents><target name="magecommunity"><dir name="MageWare"><dir name="SalesGrids"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Creditmemo"><file name="Grid.php" hash="eafc15a3c8ce1822beea8421b6a38b05"/></dir><dir name="Invoice"><file name="Grid.php" hash="797a7cdf943d0b08886518204ced5b16"/></dir><dir name="Order"><file name="Grid.php" hash="044c3746aaab806e792ec51509ea9146"/></dir><dir name="Shipment"><file name="Grid.php" hash="da16bda01942010040311a1a0e3010af"/></dir></dir><dir name="Widget"><dir name="Grid"><dir name="Column"><dir name="Renderer"><file name="List.php" hash="bc8b3a99b39aa84ad00c68757a8d9580"/></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="cd4559adf776e0d4aee51bf47d3e5eb8"/></dir><dir name="Model"><file name="Observer.php" hash="ab6a027ab4951222eaf1c1a551c5e3ea"/><dir name="Resource"><dir name="Order"><file name="Creditmemo.php" hash="3fbd2b9a81844ea0d284a453ce85cc34"/><file name="Invoice.php" hash="169a2575a32d5bb22623eb92f0b60beb"/><file name="Shipment.php" hash="e9f85d42a213e759962dcbff8b2082e0"/></dir><file name="Order.php" hash="a6661cfa6104d50011ac74e9a8b2ac64"/><file name="Setup.php" hash="829694a93aac3d84469cb87e03474890"/></dir><dir name="System"><dir name="Config"><dir name="Source"><dir name="Creditmemo"><file name="Grid.php" hash="2d0ae403da508fc6d8a86440fc0c2231"/></dir><dir name="Invoice"><file name="Grid.php" hash="5d722b0ca1abd5bb6247cc168b5ffd11"/></dir><dir name="Order"><file name="Grid.php" hash="e2b30ce23e8e13e2a59305ecfa308239"/></dir><dir name="Shipment"><file name="Grid.php" hash="158c9d8393a28f99f6237d3d5d27849a"/></dir></dir></dir></dir></dir><dir name="data"><dir name="salesgrids_setup"><file name="data-install-1.0.0.0.php" hash="85ca289d4607b3a0d973487e13a77960"/><file name="data-upgrade-1.0.0.0-1.1.0.0.php" hash="acf17612d016b8bbe66c4cb6a0a7c002"/></dir></dir><dir name="etc"><file name="config.xml" hash="b72840b953761bcdba8833aae43c8b76"/><file name="system.xml" hash="1c61ebd9fec05d94c0605fc76b9ee327"/></dir><dir name="sql"><dir name="salesgrids_setup"><file name="install-1.0.0.0.php" hash="c441ab893d892da2f00ae4a6b7263c3c"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="MageWare_SalesGrids.xml" hash="a724485b1aee066050a7ba125cd70504"/></dir></target></contents>
|
| 16 |
<compatible/>
|
| 17 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><package><name>Mage_All_Latest</name><channel>community</channel><min>1.6.0.0</min><max>1.7.0.2</max></package></required></dependencies>
|
| 18 |
</package>
|
