Skip to content

Commit 7f5b644

Browse files
committed
MAGETWO-54787: [Github] Unable to place order after upgrade within online payment method with Payment Action = Sale
1 parent 73a5230 commit 7f5b644

File tree

2 files changed

+43
-10
lines changed

2 files changed

+43
-10
lines changed

app/code/Magento/Sales/Setup/InstallSchema.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3216,12 +3216,6 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con
32163216
'12,4',
32173217
[],
32183218
'Grand Total'
3219-
)->addColumn(
3220-
'base_grand_total',
3221-
\Magento\Framework\DB\Ddl\Table::TYPE_DECIMAL,
3222-
'12,4',
3223-
[],
3224-
'Base Grand Total'
32253219
)->addColumn(
32263220
'created_at',
32273221
\Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP,
@@ -3240,9 +3234,6 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con
32403234
)->addIndex(
32413235
$installer->getIdxName('sales_invoice_grid', ['grand_total']),
32423236
['grand_total']
3243-
)->addIndex(
3244-
$installer->getIdxName('sales_invoice_grid', ['base_grand_total']),
3245-
['base_grand_total']
32463237
)->addIndex(
32473238
$installer->getIdxName('sales_invoice_grid', ['order_id']),
32483239
['order_id']

app/code/Magento/Sales/Setup/UpgradeSchema.php

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Magento\Framework\Setup\UpgradeSchemaInterface;
88
use Magento\Framework\Setup\ModuleContextInterface;
99
use Magento\Framework\Setup\SchemaSetupInterface;
10+
use Magento\Framework\DB\Adapter\AdapterInterface;
1011

1112
/**
1213
* @codeCoverageIgnore
@@ -53,5 +54,46 @@ public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $con
5354

5455
$installer->endSetup();
5556
}
57+
if (version_compare($context->getVersion(), '2.0.7', '<')) {
58+
$connection = $installer->getConnection();
59+
$this->addColumnBaseGrandTotal($installer);
60+
$this->addIndexBaseGrandTotal($connection, $installer);
61+
}
62+
}
63+
64+
/**
65+
* @param SchemaSetupInterface $installer
66+
* @return void
67+
*/
68+
private function addColumnBaseGrandTotal(SchemaSetupInterface $installer)
69+
{
70+
$connection = $installer->getConnection();
71+
$connection->addColumn(
72+
$installer->getTable('sales_invoice_grid'),
73+
'base_grand_total',
74+
[
75+
'type' => \Magento\Framework\DB\Ddl\Table::TYPE_DECIMAL,
76+
'unsigned' => true,
77+
'nullable' => true,
78+
'default' => '0.0000',
79+
'length' => '12,4',
80+
'comment' => 'Base Grand Total',
81+
'after' => 'grand_total'
82+
]
83+
);
84+
}
85+
86+
/**
87+
* @param AdapterInterface $connection
88+
* @param SchemaSetupInterface $installer
89+
* @return void
90+
*/
91+
private function addIndexBaseGrandTotal(AdapterInterface $connection, SchemaSetupInterface $installer)
92+
{
93+
$connection->addIndex(
94+
$installer->getTable('sales_invoice_grid'),
95+
$installer->getIdxName('sales_invoice_grid', ['base_grand_total']),
96+
['base_grand_total']
97+
);
5698
}
57-
}
99+
}

0 commit comments

Comments
 (0)