You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (in_array($tblSalesCreditmemoComment, $showTables)) {
111
+
$connection->rawQuery('DELETE FROM `'.$tblSalesCreditmemoComment.'` WHERE parent_id IN (SELECT entity_id FROM `'.$tblSalesCreditmemo.'` WHERE order_id='.$orderId.')');
112
+
}
113
+
if (in_array('sales__creditmemo_item', $showTables)) {
114
+
$connection->rawQuery('DELETE FROM `'.$tblSalesCreditmemoItem.'` WHERE parent_id IN (SELECT entity_id FROM `'.$tblSalesCreditmemo.'` WHERE order_id='.$orderId.')');
115
+
}
116
+
if (in_array($tblSalesCreditmemo, $showTables)) {
117
+
$connection->rawQuery('DELETE FROM `'.$tblSalesCreditmemo.'` WHERE order_id='.$orderId);
118
+
}
119
+
if (in_array($tblSalesCreditmemoGrid, $showTables)) {
120
+
$connection->rawQuery('DELETE FROM `'.$tblSalesCreditmemoGrid.'` WHERE order_id='.$orderId);
121
+
}
122
+
if (in_array($tblSalesInvoiceComment, $showTables)) {
123
+
$connection->rawQuery('DELETE FROM `'.$tblSalesInvoiceComment.'` WHERE parent_id IN (SELECT entity_id FROM `'.$tblSalesInvoice.'` WHERE order_id='.$orderId.')');
124
+
}
125
+
if (in_array($tblSalesInvoiceItem, $showTables)) {
126
+
$connection->rawQuery('DELETE FROM `'.$tblSalesInvoiceItem.'` WHERE parent_id IN (SELECT entity_id FROM `'.$tblSalesInvoice.'` WHERE order_id='.$orderId.')');
127
+
}
128
+
if (in_array($tblSalesInvoice, $showTables)) {
129
+
$connection->rawQuery('DELETE FROM `'.$tblSalesInvoice.'` WHERE order_id='.$orderId);
130
+
}
131
+
if (in_array($tblSalesInvoiceGrid, $showTables)) {
132
+
$connection->rawQuery('DELETE FROM `'.$tblSalesInvoiceGrid.'` WHERE order_id='.$orderId);
133
+
}
134
+
if ($quoteId) {
135
+
if (in_array($tblQuoteAddressItem, $showTables)) {
136
+
$connection->rawQuery('DELETE FROM `'.$tblQuoteAddressItem.'` WHERE parent_item_id IN (SELECT address_id FROM `'.$tblQuoteAddress.'` WHERE quote_id='.$quoteId.')');
137
+
}
138
+
if (in_array($tblQuoteShippingRate, $showTables)) {
139
+
$connection->rawQuery('DELETE FROM `'.$tblQuoteShippingRate.'` WHERE address_id IN (SELECT address_id FROM `'.$tblQuoteAddress.'` WHERE quote_id='.$quoteId.')');
140
+
}
141
+
if (in_array($tblQuoteIDMask, $showTables)) {
142
+
$connection->rawQuery('DELETE FROM `'.$tblQuoteIDMask.'` where quote_id='.$quoteId);
143
+
}
144
+
if (in_array($tblQuoteItemOption, $showTables)) {
145
+
$connection->rawQuery('DELETE FROM `'.$tblQuoteItemOption.'` WHERE item_id IN (SELECT item_id FROM `'.$tblQuoteItem.'` WHERE quote_id='.$quoteId.')');
146
+
}
147
+
if (in_array($tblQuote, $showTables)) {
148
+
$connection->rawQuery('DELETE FROM `'.$tblQuote.'` WHERE entity_id='.$quoteId);
149
+
}
150
+
if (in_array($tblQuoteAddress, $showTables)) {
151
+
$connection->rawQuery('DELETE FROM `'.$tblQuoteAddress.'` WHERE quote_id='.$quoteId);
152
+
}
153
+
if (in_array($tblQuoteItem, $showTables)) {
154
+
$connection->rawQuery('DELETE FROM `'.$tblQuoteItem.'` WHERE quote_id='.$quoteId);
155
+
}
156
+
if (in_array('sales__quotePayment', $showTables)) {
157
+
$connection->rawQuery('DELETE FROM `'.$tblQuotePayment.'` WHERE quote_id='.$quoteId);
158
+
}
159
+
}
160
+
if (in_array($tblSalesShipmentComment, $showTables)) {
161
+
$connection->rawQuery('DELETE FROM `'.$tblSalesShipmentComment.'` WHERE parent_id IN (SELECT entity_id FROM `'.$tblSalesShipment.'` WHERE order_id='.$orderId.')');
162
+
}
163
+
if (in_array($tblSalesShipmentItem, $showTables)) {
164
+
$connection->rawQuery('DELETE FROM `'.$tblSalesShipmentItem.'` WHERE parent_id IN (SELECT entity_id FROM `'.$tblSalesShipment.'` WHERE order_id='.$orderId.')');
165
+
}
166
+
if (in_array($tblSalesShipmentTrack, $showTables)) {
167
+
$connection->rawQuery('DELETE FROM `'.$tblSalesShipmentTrack.'` WHERE order_id IN (SELECT entity_id FROM `'.$tblSalesShipment.'` WHERE parent_id='.$orderId.')');
168
+
}
169
+
if (in_array($tblSalesShipment, $showTables)) {
170
+
$connection->rawQuery('DELETE FROM `'.$tblSalesShipment.'` WHERE order_id='.$orderId);
171
+
}
172
+
if (in_array($tblSalesShipmentGrid, $showTables)) {
173
+
$connection->rawQuery('DELETE FROM `'.$tblSalesShipmentGrid.'` WHERE order_id='.$orderId);
174
+
}
175
+
if (in_array($tblSalesOrder, $showTables)) {
176
+
$connection->rawQuery('DELETE FROM `'.$tblSalesOrder.'` WHERE entity_id='.$orderId);
177
+
}
178
+
if (in_array($tblSalesOrderAddress, $showTables)) {
179
+
$connection->rawQuery('DELETE FROM `'.$tblSalesOrderAddress.'` WHERE parent_id='.$orderId);
180
+
}
181
+
if (in_array($tblSalesOrderItem, $showTables)) {
182
+
$connection->rawQuery('DELETE FROM `'.$tblSalesOrderItem.'` WHERE order_id='.$orderId);
183
+
}
184
+
if (in_array($tblSalesOrderPayment, $showTables)) {
185
+
$connection->rawQuery('DELETE FROM `'.$tblSalesOrderPayment.'` WHERE parent_id='.$orderId);
186
+
}
187
+
if (in_array($tblSalesOrderStatusHistory, $showTables)) {
188
+
$connection->rawQuery('DELETE FROM `'.$tblSalesOrderStatusHistory.'` WHERE parent_id='.$orderId);
189
+
}
190
+
if ($incId && in_array($tblSalesOrderGrid, $showTables)) {
191
+
$connection->rawQuery('DELETE FROM `'.$tblSalesOrderGrid.'` WHERE increment_id='.$incId);
192
+
}
193
+
if (in_array($tblSalesOrderTax, $showTables)) {
194
+
$connection->rawQuery('DELETE FROM `'.$tblSalesOrderTax.'` WHERE order_id='.$orderId);
195
+
}
196
+
if ($quoteId && $showTablesLog) {
197
+
$connection->rawQuery('DELETE FROM `'.$tblLogQuote.'` WHERE quote_id='.$quoteId);
0 commit comments