1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25:
26:
27:
28: class Mage_Sales_Model_Entity_Setup extends Mage_Eav_Model_Entity_Setup
29: {
30: public function getDefaultEntities()
31: {
32: return array(
33: 'quote' => array(
34: 'entity_model' => 'sales/quote',
35: 'table' => 'sales/quote',
36: 'attributes' => array(
37: 'entity_id' => array('type'=>'static'),
38: 'is_active' => array('type'=>'static'),
39: 'store_id' => array('type'=>'static'),
40: 'remote_ip' => array('type'=>'static'),
41: 'checkout_method' => array('type'=>'static'),
42: 'password_hash' => array('type'=>'static'),
43: 'quote_status_id' => array('type'=>'static'),
44: 'billing_address_id'=> array('type'=>'static'),
45: 'orig_order_id' => array('type'=>'static'),
46: 'converted_at' => array('type'=>'static'),
47: 'reserved_order_id' => array('type'=>'static'),
48:
49: 'coupon_code' => array('type'=>'static'),
50: 'global_currency_code' => array('type'=>'static'),
51: 'base_currency_code' => array('type'=>'static'),
52: 'store_currency_code' => array('type'=>'static'),
53: 'quote_currency_code' => array('type'=>'static'),
54: 'store_to_base_rate' => array('type'=>'static'),
55: 'store_to_quote_rate' => array('type'=>'static'),
56: 'base_to_global_rate' => array('type'=>'static'),
57: 'base_to_quote_rate' => array('type'=>'static'),
58:
59: 'items_count'=> array('type'=>'static'),
60: 'items_qty'=> array('type'=>'static'),
61:
62: 'custbalance_amount'=> array('type'=>'static'),
63: 'grand_total' => array('type'=>'static'),
64: 'base_grand_total' => array('type'=>'static'),
65:
66: 'applied_rule_ids' => array('type'=>'static'),
67:
68: 'is_virtual' => array('type'=>'static'),
69: 'is_multi_shipping' => array('type'=>'static'),
70: 'is_multi_payment' => array('type'=>'static'),
71:
72: 'customer_id' => array('type'=>'static'),
73: 'customer_tax_class_id' => array('type'=>'static'),
74: 'customer_group_id' => array('type'=>'static'),
75: 'customer_email' => array('type'=>'static'),
76: 'customer_prefix' => array('type'=>'static'),
77: 'customer_firstname'=> array('type'=>'static'),
78: 'customer_middlename'=>array('type'=>'static'),
79: 'customer_lastname' => array('type'=>'static'),
80: 'customer_suffix' => array('type'=>'static'),
81: 'customer_note' => array('type'=>'static'),
82: 'customer_note_notify' => array('type'=>'static'),
83: 'customer_is_guest' => array('type'=>'static'),
84: ),
85: ),
86:
87: 'quote_item' => array(
88: 'entity_model' => 'sales/quote_item',
89: 'table' => 'sales/quote_item',
90: 'attributes' => array(
91: 'parent_id' => array('type'=>'static'),
92: 'product_id' => array('type'=>'static'),
93: 'super_product_id' => array('type'=>'static'),
94: 'parent_product_id' => array('type'=>'static'),
95: 'sku' => array('type'=>'static'),
96: 'name' => array('type'=>'static'),
97: 'description' => array('type'=>'static'),
98:
99: 'weight' => array('type'=>'static'),
100: 'free_shipping' => array('type'=>'static'),
101: 'qty' => array('type'=>'static'),
102: 'is_qty_decimal'=> array('type'=>'static'),
103:
104: 'price' => array('type'=>'static'),
105: 'custom_price' => array('type'=>'static'),
106: 'discount_percent' => array('type'=>'static'),
107: 'discount_amount' => array('type'=>'static'),
108: 'no_discount' => array('type'=>'static'),
109: 'tax_percent' => array('type'=>'static'),
110: 'tax_amount' => array('type'=>'static'),
111: 'row_total' => array('type'=>'static'),
112: 'row_total_with_discount' => array('type'=>'static'),
113:
114: 'base_price' => array('type'=>'static'),
115: 'base_discount_amount' => array('type'=>'static'),
116: 'base_tax_amount' => array('type'=>'static'),
117: 'base_row_total' => array('type'=>'static'),
118:
119: 'row_weight' => array('type'=>'static'),
120: 'applied_rule_ids' => array('type'=>'static'),
121: 'additional_data' => array('type'=>'static'),
122:
123: 'tax_string' => array('type'=>'text'),
124: ),
125: ),
126:
127: 'quote_address' => array(
128: 'entity_model' => 'sales/quote_address',
129: 'table' => 'sales/quote_address',
130: 'attributes' => array(
131: 'entity_id' => array('type'=>'static'),
132: 'parent_id' => array('type'=>'static'),
133: 'address_type' => array('type'=>'static'),
134:
135: 'customer_id' => array('type'=>'static'),
136: 'customer_address_id' => array('type'=>'static'),
137: 'save_in_address_book' => array('type'=>'static'),
138: 'email' => array('type'=>'static'),
139: 'prefix' => array('type'=>'static'),
140: 'firstname' => array('type'=>'static'),
141: 'middlename'=> array('type'=>'static'),
142: 'lastname' => array('type'=>'static'),
143: 'suffix' => array('type'=>'static'),
144: 'company' => array('type'=>'static'),
145: 'street' => array('type'=>'static'),
146: 'city' => array('type'=>'static'),
147: 'region' => array('type'=>'static'),
148: 'region_id' => array('type'=>'static'),
149: 'postcode' => array('type'=>'static'),
150: 'country_id'=> array('type'=>'static'),
151: 'telephone' => array('type'=>'static'),
152: 'fax' => array('type'=>'static'),
153:
154: 'same_as_billing' => array('type'=>'static'),
155: 'free_shipping' => array('type'=>'static'),
156: 'weight' => array('type'=>'static'),
157: 'collect_shipping_rates' => array('type'=>'static'),
158:
159: 'shipping_method' => array('type'=>'static'),
160: 'shipping_description' => array('type'=>'static'),
161:
162: 'subtotal' => array('type'=>'static'),
163: 'subtotal_with_discount' => array('type'=>'static'),
164: 'tax_amount' => array('type'=>'static'),
165: 'shipping_amount' => array('type'=>'static'),
166: 'discount_amount' => array('type'=>'static'),
167: 'custbalance_amount'=> array('type'=>'static'),
168: 'grand_total' => array('type'=>'static'),
169:
170: 'base_subtotal' => array('type'=>'static'),
171: 'base_subtotal_with_discount' => array('type'=>'static'),
172: 'base_tax_amount' => array('type'=>'static'),
173: 'base_shipping_amount' => array('type'=>'static'),
174: 'base_discount_amount' => array('type'=>'static'),
175: 'base_custbalance_amount' => array('type'=>'static'),
176: 'base_grand_total' => array('type'=>'static'),
177:
178: 'customer_notes' => array('type'=>'static'),
179:
180: 'tax_string' => array('type'=>'text'),
181: ),
182: ),
183: 'quote_address_item' => array(
184: 'entity_model' => 'sales/quote_address_item',
185: 'table' =>'sales/quote_entity',
186: 'attributes' => array(
187: 'parent_id' => array('type'=>'static'),
188: 'quote_item_id' => array('type'=>'int'),
189: 'product_id' => array('type'=>'int'),
190: 'super_product_id' => array('type'=>'int'),
191: 'parent_product_id' => array('type'=>'int'),
192: 'sku' => array(),
193: 'image' => array(),
194: 'name' => array(),
195: 'description' => array('type'=>'text'),
196:
197: 'weight' => array('type'=>'decimal'),
198: 'free_shipping' => array('type'=>'int'),
199: 'qty' => array('type'=>'decimal'),
200: 'is_qty_decimal'=> array('type'=>'int'),
201:
202: 'price' => array('type'=>'decimal'),
203: 'discount_percent' => array('type'=>'decimal'),
204: 'discount_amount' => array('type'=>'decimal'),
205: 'no_discount' => array('type'=>'int'),
206: 'tax_percent' => array('type'=>'decimal'),
207: 'tax_amount' => array('type'=>'decimal'),
208: 'row_total' => array('type'=>'decimal'),
209: 'row_total_with_discount' => array('type'=>'decimal'),
210:
211: 'base_price' => array('type'=>'decimal'),
212: 'base_discount_amount' => array('type'=>'decimal'),
213: 'base_tax_amount' => array('type'=>'decimal'),
214: 'base_row_total' => array('type'=>'decimal'),
215:
216: 'row_weight' => array('type'=>'decimal'),
217: 'applied_rule_ids' => array(),
218: 'additional_data' => array('type'=>'text'),
219: ),
220: ),
221: 'quote_address_rate' => array(
222: 'entity_model' => 'sales/quote_address_rate',
223: 'table' => 'sales/quote_entity',
224: 'attributes' => array(
225: 'parent_id' => array('type'=>'static'),
226: 'code' => array(),
227: 'carrier' => array(),
228: 'carrier_title' => array(),
229: 'method' => array(),
230: 'method_description' => array('type'=>'text'),
231: 'price' => array('type'=>'decimal'),
232: 'error_message' => array('type'=>'text'),
233: ),
234: ),
235: 'quote_payment' => array(
236: 'entity_model' => 'sales/quote_payment',
237: 'table' =>'sales/quote_entity',
238: 'attributes' => array(
239: 'parent_id' => array('type'=>'static'),
240: 'method' => array(),
241: 'additional_data' => array('type'=>'text'),
242: 'po_number' => array(),
243: 'cc_type' => array(),
244: 'cc_number_enc' => array(),
245: 'cc_last4' => array(),
246: 'cc_owner' => array(),
247: 'cc_exp_month' => array('type'=>'int'),
248: 'cc_exp_year' => array('type'=>'int'),
249: 'cc_cid_enc' => array(),
250: 'cc_ss_issue' => array(),
251: 'cc_ss_start_month' => array('type'=>'int'),
252: 'cc_ss_start_year' => array('type'=>'int'),
253: ),
254: ),
255:
256: 'order' => array(
257: 'entity_model' => 'sales/order',
258: 'table'=>'sales/order',
259: 'increment_model'=>'eav/entity_increment_numeric',
260: 'increment_per_store'=>true,
261: 'backend_prefix'=>'sales_entity/order_attribute_backend',
262: 'attributes' => array(
263: 'entity_id' => array(
264: 'type'=>'static',
265: 'backend'=>'sales_entity/order_attribute_backend_parent'
266: ),
267: 'store_id' => array('type'=>'static'),
268: 'store_name' => array('type'=>'varchar'),
269: 'remote_ip' => array(),
270:
271: 'status' => array('type'=>'varchar'),
272: 'state' => array('type'=>'varchar'),
273: 'hold_before_status' => array('type'=>'varchar'),
274: 'hold_before_state' => array('type'=>'varchar'),
275:
276: 'relation_parent_id' => array('type'=>'varchar'),
277: 'relation_parent_real_id' => array('type'=>'varchar'),
278: 'relation_child_id' => array('type'=>'varchar'),
279: 'relation_child_real_id' => array('type'=>'varchar'),
280: 'original_increment_id' => array('type'=>'varchar'),
281: 'edit_increment' => array('type'=>'int'),
282:
283: 'ext_order_id' => array('type'=>'varchar'),
284: 'ext_customer_id' => array('type'=>'varchar'),
285:
286: 'quote_id' => array('type'=>'int'),
287: 'quote_address_id' => array('type'=>'int'),
288: 'billing_address_id' => array('type'=>'int', 'backend'=>'_billing'),
289: 'shipping_address_id' => array('type'=>'int', 'backend'=>'_shipping'),
290:
291: 'coupon_code' => array(),
292: 'applied_rule_ids' => array(),
293:
294: 'global_currency_code' => array(),
295: 'base_currency_code' => array(),
296: 'store_currency_code' => array(),
297: 'order_currency_code' => array(),
298: 'store_to_base_rate' => array('type'=>'decimal'),
299: 'store_to_order_rate' => array('type'=>'decimal'),
300: 'base_to_global_rate' => array('type'=>'decimal'),
301: 'base_to_order_rate' => array('type'=>'decimal'),
302:
303: 'is_virtual' => array('type'=>'int'),
304: 'is_multi_payment' => array('type'=>'int'),
305:
306: 'shipping_method' => array(),
307: 'shipping_description' => array(),
308: 'weight' => array('type'=>'decimal'),
309:
310: 'tax_amount' => array('type'=>'static'),
311: 'shipping_amount' => array('type'=>'static'),
312: 'discount_amount' => array('type'=>'static'),
313: 'custbalance_amount'=> array('type'=>'decimal'),
314:
315: 'subtotal' => array('type'=>'static'),
316: 'grand_total' => array('type'=>'static'),
317: 'total_paid' => array('type'=>'static'),
318: 'total_due' => array('type'=>'decimal'),
319: 'total_refunded' => array('type'=>'static'),
320: 'total_qty_ordered' => array('type'=>'static'),
321: 'total_canceled' => array('type'=>'static'),
322: 'total_invoiced' => array('type'=>'static'),
323: 'total_online_refunded' => array('type'=>'static'),
324: 'total_offline_refunded'=> array('type'=>'static'),
325: 'adjustment_positive' => array('type'=>'decimal'),
326: 'adjustment_negative' => array('type'=>'decimal'),
327:
328: 'base_tax_amount' => array('type'=>'static'),
329: 'base_shipping_amount' => array('type'=>'static'),
330: 'base_discount_amount' => array('type'=>'static'),
331: 'base_custbalance_amount'=> array('type'=>'decimal'),
332:
333: 'base_subtotal' => array('type'=>'static'),
334: 'base_grand_total' => array('type'=>'static'),
335: 'base_total_paid' => array('type'=>'static'),
336: 'base_total_due' => array('type'=>'decimal'),
337: 'base_total_refunded' => array('type'=>'static'),
338: 'base_total_qty_ordered' => array('type'=>'static'),
339: 'base_total_canceled' => array('type'=>'static'),
340: 'base_total_invoiced' => array('type'=>'static'),
341: 'base_total_online_refunded' => array('type'=>'static'),
342: 'base_total_offline_refunded'=> array('type'=>'static'),
343: 'base_adjustment_positive' => array('type'=>'decimal'),
344: 'base_adjustment_negative' => array('type'=>'decimal'),
345:
346: 'subtotal_refunded' => array('type'=>'static'),
347: 'subtotal_canceled' => array('type'=>'static'),
348: 'discount_refunded' => array('type'=>'static'),
349: 'discount_canceled' => array('type'=>'static'),
350: 'discount_invoiced' => array('type'=>'static'),
351: 'subtotal_invoiced' => array('type'=>'static'),
352: 'tax_refunded' => array('type'=>'static'),
353: 'tax_canceled' => array('type'=>'static'),
354: 'tax_invoiced' => array('type'=>'static'),
355: 'shipping_refunded' => array('type'=>'static'),
356: 'shipping_canceled' => array('type'=>'static'),
357: 'shipping_invoiced' => array('type'=>'static'),
358: 'base_subtotal_refunded' => array('type'=>'static'),
359: 'base_subtotal_canceled' => array('type'=>'static'),
360: 'base_discount_refunded' => array('type'=>'static'),
361: 'base_discount_canceled' => array('type'=>'static'),
362: 'base_discount_invoiced' => array('type'=>'static'),
363: 'base_subtotal_invoiced' => array('type'=>'static'),
364: 'base_tax_refunded' => array('type'=>'static'),
365: 'base_tax_canceled' => array('type'=>'static'),
366: 'base_tax_invoiced' => array('type'=>'static'),
367: 'base_shipping_refunded' => array('type'=>'static'),
368: 'base_shipping_canceled' => array('type'=>'static'),
369: 'base_shipping_invoiced' => array('type'=>'static'),
370:
371: 'customer_id' => array('type'=>'static', 'visible'=>false),
372: 'customer_group_id' => array('type'=>'int', 'visible'=>false),
373: 'customer_email' => array('type'=>'varchar', 'visible'=>false),
374: 'customer_prefix' => array('type'=>'varchar', 'visible'=>false),
375: 'customer_firstname'=> array('type'=>'varchar', 'visible'=>false),
376: 'customer_middlename' => array('type'=>'varchar', 'visible'=>false),
377: 'customer_lastname' => array('type'=>'varchar', 'visible'=>false),
378: 'customer_suffix' => array('type'=>'varchar', 'visible'=>false),
379: 'customer_note' => array('type'=>'text', 'visible'=>false),
380: 'customer_note_notify' => array('type'=>'int', 'visible'=>false),
381: 'customer_is_guest' => array('type'=>'int', 'visible'=>false),
382: 'email_sent' => array('type'=>'int', 'visible'=>false),
383: ),
384: ),
385: 'order_address' => array(
386: 'entity_model' => 'sales/order_address',
387: 'table'=>'sales/order_entity',
388: 'attributes' => array(
389: 'parent_id' => array('type'=>'static', 'backend'=>'sales_entity/order_attribute_backend_child'),
390: 'quote_address_id' => array('type'=>'int'),
391: 'address_type' => array(),
392: 'customer_id' => array('type'=>'int'),
393: 'customer_address_id' => array('type'=>'int'),
394: 'email' => array(),
395: 'prefix' => array(),
396: 'firstname' => array(),
397: 'middlename'=> array(),
398: 'lastname' => array(),
399: 'suffix' => array(),
400: 'company' => array(),
401: 'street' => array(),
402: 'city' => array(),
403: 'region' => array(),
404: 'region_id' => array('type'=>'int'),
405: 'postcode' => array(),
406: 'country_id'=> array('type'=>'varchar'),
407: 'telephone' => array(),
408: 'fax' => array(),
409: 'tax_string' => array('type'=>'text'),
410: ),
411: ),
412: 'order_item' => array(
413: 'entity_model' => 'sales/order_item',
414: 'table'=>'sales/order_entity',
415: 'attributes' => array(
416: 'parent_id' => array(
417: 'type'=>'static',
418: 'backend'=>'sales_entity/order_attribute_backend_child'
419: ),
420:
421: 'quote_item_id' => array('type'=>'int'),
422: 'product_id' => array('type'=>'int'),
423: 'super_product_id' => array('type'=>'int'),
424: 'parent_product_id' => array('type'=>'int'),
425: 'sku' => array(),
426: 'name' => array(),
427: 'description' => array('type'=>'text'),
428: 'weight' => array('type'=>'decimal'),
429:
430: 'is_qty_decimal' => array('type'=>'int'),
431: 'qty_ordered' => array('type'=>'decimal'),
432: 'qty_backordered' => array('type'=>'decimal'),
433: 'qty_invoiced' => array('type'=>'decimal'),
434: 'qty_canceled' => array('type'=>'decimal'),
435: 'qty_shipped' => array('type'=>'decimal'),
436: 'qty_refunded' => array('type'=>'decimal'),
437:
438: 'original_price' => array('type'=>'decimal'),
439: 'price' => array('type'=>'decimal'),
440: 'cost' => array('type'=>'decimal'),
441: 'is_nominal' => array('type'=>'int'),
442:
443: 'discount_percent' => array('type'=>'decimal'),
444: 'discount_amount' => array('type'=>'decimal'),
445: 'discount_invoiced' => array('type'=>'decimal'),
446:
447: 'tax_percent' => array('type'=>'decimal'),
448: 'tax_amount' => array('type'=>'decimal'),
449: 'tax_invoiced' => array('type'=>'decimal'),
450: 'tax_string' => array('type'=>'text'),
451:
452: 'row_total' => array('type'=>'decimal'),
453: 'row_weight' => array('type'=>'decimal'),
454: 'row_invoiced' => array('type'=>'decimal'),
455: 'invoiced_total' => array('type'=>'decimal'),
456: 'amount_refunded' => array('type'=>'decimal'),
457:
458: 'base_price' => array('type'=>'decimal'),
459: 'base_original_price' => array('type'=>'decimal'),
460: 'base_discount_amount' => array('type'=>'decimal'),
461: 'base_discount_invoiced' => array('type'=>'decimal'),
462: 'base_tax_amount' => array('type'=>'decimal'),
463: 'base_tax_invoiced' => array('type'=>'decimal'),
464: 'base_row_total' => array('type'=>'decimal'),
465: 'base_row_invoiced' => array('type'=>'decimal'),
466: 'base_invoiced_total' => array('type'=>'decimal'),
467: 'base_amount_refunded' => array('type'=>'decimal'),
468:
469: 'applied_rule_ids' => array(),
470: 'additional_data' => array('type'=>'text'),
471: ),
472: ),
473: 'order_payment' => array(
474: 'entity_model' => 'sales/order_payment',
475: 'table'=>'sales/order_entity',
476: 'attributes' => array(
477: 'parent_id' => array(
478: 'type'=>'static',
479: 'backend'=>'sales_entity/order_attribute_backend_child'
480: ),
481: 'quote_payment_id' => array('type'=>'int'),
482: 'method' => array(),
483: 'additional_data' => array('type'=>'text'),
484: 'last_trans_id' => array(),
485: 'po_number' => array(),
486:
487: 'cc_type' => array(),
488: 'cc_number_enc' => array(),
489: 'cc_last4' => array(),
490: 'cc_owner' => array(),
491: 'cc_exp_month' => array(),
492: 'cc_exp_year' => array(),
493:
494: 'cc_ss_issue' => array(),
495: 'cc_ss_start_month' => array(),
496: 'cc_ss_start_year' => array(),
497:
498: 'cc_status' => array(),
499: 'cc_status_description' => array(),
500: 'cc_trans_id' => array(),
501: 'cc_approval' => array(),
502: 'cc_avs_status' => array(),
503: 'cc_cid_status' => array(),
504:
505: 'cc_debug_request_body' => array(),
506: 'cc_debug_response_body'=> array(),
507: 'cc_debug_response_serialized' => array(),
508:
509: 'anet_trans_method' => array(),
510: 'echeck_routing_number' => array(),
511: 'echeck_bank_name' => array(),
512: 'echeck_account_type' => array(),
513: 'echeck_account_name' => array(),
514: 'echeck_type' => array(),
515:
516: 'amount_ordered' => array('type'=>'decimal'),
517: 'amount_authorized' => array('type'=>'decimal'),
518: 'amount_paid' => array('type'=>'decimal'),
519: 'amount_canceled' => array('type'=>'decimal'),
520: 'amount_refunded' => array('type'=>'decimal'),
521: 'shipping_amount' => array('type'=>'decimal'),
522: 'shipping_captured' => array('type'=>'decimal'),
523: 'shipping_refunded' => array('type'=>'decimal'),
524:
525: 'base_amount_ordered' => array('type'=>'decimal'),
526: 'base_amount_authorized' => array('type'=>'decimal'),
527: 'base_amount_paid' => array('type'=>'decimal'),
528: 'base_amount_canceled' => array('type'=>'decimal'),
529: 'base_amount_refunded' => array('type'=>'decimal'),
530: 'base_shipping_amount' => array('type'=>'decimal'),
531: 'base_shipping_captured' => array('type'=>'decimal'),
532: 'base_shipping_refunded' => array('type'=>'decimal'),
533: ),
534: ),
535:
536: 'order_status_history' => array(
537: 'entity_model' => 'sales/order_status_history',
538: 'table'=>'sales/order_entity',
539: 'attributes' => array(
540: 'parent_id' => array(
541: 'type'=>'static',
542: 'backend'=>'sales_entity/order_attribute_backend_child'
543: ),
544: 'status' => array('type'=>'varchar'),
545: 'comment' => array('type'=>'text'),
546: 'is_customer_notified' => array('type'=>'int'),
547: ),
548: ),
549:
550: 'invoice' => array(
551: 'entity_model' => 'sales/order_invoice',
552: 'table' =>'sales/order_entity',
553: 'increment_model' =>'eav/entity_increment_numeric',
554: 'increment_per_store'=>true,
555: 'backend_prefix' =>'sales_entity/order_attribute_backend',
556: 'attributes' => array(
557: 'entity_id' => array(
558: 'type'=>'static',
559: 'backend'=>'sales_entity/order_invoice_attribute_backend_parent'
560: ),
561:
562: 'state' => array('type'=>'int'),
563: 'is_used_for_refund' => array('type'=>'int'),
564: 'transaction_id' => array(),
565:
566:
567: 'order_id' => array(
568: 'type'=>'int',
569: 'backend'=>'sales_entity/order_invoice_attribute_backend_order'
570: ),
571:
572: 'billing_address_id' => array('type'=>'int'),
573: 'shipping_address_id' => array('type'=>'int'),
574:
575: 'global_currency_code' => array(),
576: 'base_currency_code' => array(),
577: 'store_currency_code' => array(),
578: 'order_currency_code' => array(),
579: 'store_to_base_rate' => array('type'=>'decimal'),
580: 'store_to_order_rate' => array('type'=>'decimal'),
581: 'base_to_global_rate' => array('type'=>'decimal'),
582: 'base_to_order_rate' => array('type'=>'decimal'),
583:
584: 'subtotal' => array('type'=>'decimal'),
585: 'discount_amount' => array('type'=>'decimal'),
586: 'tax_amount' => array('type'=>'decimal'),
587: 'shipping_amount' => array('type'=>'decimal'),
588: 'grand_total' => array('type'=>'decimal'),
589: 'total_qty' => array('type'=>'decimal'),
590:
591: 'can_void_flag' => array('type'=>'int'),
592:
593: 'base_subtotal' => array('type'=>'decimal'),
594: 'base_discount_amount' => array('type'=>'decimal'),
595: 'base_tax_amount' => array('type'=>'decimal'),
596: 'base_shipping_amount' => array('type'=>'decimal'),
597: 'base_grand_total' => array('type'=>'decimal'),
598: 'email_sent' => array('type'=>'int'),
599: ),
600: ),
601:
602: 'invoice_item' => array(
603: 'entity_model' => 'sales/order_invoice_item',
604:
605: 'table'=>'sales/order_entity',
606: 'attributes' => array(
607: 'parent_id' => array(
608: 'type'=>'static',
609: 'backend'=>'sales_entity/order_invoice_attribute_backend_child'
610: ),
611: 'order_item_id' => array('type'=>'int'),
612: 'product_id' => array('type'=>'int'),
613: 'name' => array(),
614: 'description' => array('type'=>'text'),
615: 'sku' => array(),
616: 'qty' => array('type'=>'decimal'),
617: 'cost' => array('type'=>'decimal'),
618: 'price' => array('type'=>'decimal'),
619: 'discount_amount' => array('type'=>'decimal'),
620: 'tax_amount' => array('type'=>'decimal'),
621: 'row_total' => array('type'=>'decimal'),
622:
623: 'base_price' => array('type'=>'decimal'),
624: 'base_discount_amount' => array('type'=>'decimal'),
625: 'base_tax_amount' => array('type'=>'decimal'),
626: 'base_row_total' => array('type'=>'decimal'),
627:
628: 'additional_data' => array('type'=>'text'),
629: ),
630: ),
631:
632: 'invoice_comment' => array(
633: 'entity_model' => 'sales/order_invoice_comment',
634: 'table'=>'sales/order_entity',
635: 'attributes' => array(
636: 'parent_id' => array(
637: 'type'=>'static',
638: 'backend'=>'sales_entity/order_invoice_attribute_backend_child'
639: ),
640: 'comment' => array('type'=>'text'),
641: 'is_customer_notified' => array('type'=>'int'),
642: ),
643: ),
644:
645:
646:
647: 'shipment' => array(
648: 'entity_model' => 'sales/order_shipment',
649:
650: 'table'=>'sales/order_entity',
651: 'increment_model'=>'eav/entity_increment_numeric',
652: 'increment_per_store'=>true,
653: 'backend_prefix'=>'sales_entity/order_attribute_backend',
654: 'attributes' => array(
655: 'entity_id' => array(
656: 'type'=>'static',
657: 'backend'=>'sales_entity/order_shipment_attribute_backend_parent'
658: ),
659:
660: 'customer_id' => array('type'=>'int'),
661: 'order_id' => array('type'=>'int'),
662: 'shipment_status' => array('type'=>'int'),
663: 'billing_address_id' => array('type'=>'int'),
664: 'shipping_address_id' => array('type'=>'int'),
665:
666: 'total_qty' => array('type'=>'decimal'),
667: 'total_weight' => array('type'=>'decimal'),
668: 'email_sent' => array('type'=>'int'),
669: ),
670: ),
671:
672: 'shipment_item' => array(
673: 'entity_model' => 'sales/order_shipment_item',
674:
675: 'table'=>'sales/order_entity',
676: 'attributes' => array(
677: 'parent_id' => array(
678: 'type'=>'static',
679: 'backend'=>'sales_entity/order_shipment_attribute_backend_child'
680: ),
681: 'order_item_id' => array('type'=>'int'),
682: 'product_id' => array('type'=>'int'),
683: 'name' => array(),
684: 'description' => array('type'=>'text'),
685: 'sku' => array(),
686: 'qty' => array('type'=>'decimal'),
687: 'price' => array('type'=>'decimal'),
688: 'weight' => array('type'=>'decimal'),
689: 'row_total' => array('type'=>'decimal'),
690:
691: 'additional_data' => array('type'=>'text'),
692: ),
693: ),
694:
695: 'shipment_comment' => array(
696: 'entity_model' => 'sales/order_shipment_comment',
697: 'table'=>'sales/order_entity',
698: 'attributes' => array(
699: 'parent_id' => array(
700: 'type'=>'static',
701: 'backend'=>'sales_entity/order_shipment_attribute_backend_child'
702: ),
703: 'comment' => array('type'=>'text'),
704: 'is_customer_notified' => array('type'=>'int'),
705: ),
706: ),
707:
708: 'shipment_track' => array(
709: 'entity_model' => 'sales/order_shipment_track',
710: 'table'=>'sales/order_entity',
711: 'attributes' => array(
712: 'parent_id' => array(
713: 'type'=>'static',
714: 'backend'=>'sales_entity/order_shipment_attribute_backend_child'
715: ),
716: 'order_id' => array('type'=>'int'),
717: 'number' => array('type'=>'text'),
718: 'carrier_code' => array('type'=>'varchar'),
719: 'title' => array('type'=>'varchar'),
720: 'description' => array('type'=>'text'),
721: 'qty' => array('type'=>'decimal'),
722: 'weight' => array('type'=>'decimal'),
723: ),
724: ),
725:
726: 'creditmemo' => array(
727: 'entity_model' => 'sales/order_creditmemo',
728:
729: 'table'=>'sales/order_entity',
730: 'increment_model'=>'eav/entity_increment_numeric',
731: 'increment_per_store'=>true,
732: 'backend_prefix'=>'sales_entity/order_attribute_backend',
733: 'attributes' => array(
734: 'entity_id' => array(
735: 'type'=>'static',
736: 'backend'=>'sales_entity/order_creditmemo_attribute_backend_parent'
737: ),
738: 'state' => array('type'=>'int'),
739: 'invoice_id' => array('type'=>'int'),
740: 'transaction_id'=> array(),
741:
742: 'order_id' => array('type'=>'int'),
743: 'creditmemo_status' => array('type'=>'int'),
744: 'billing_address_id' => array('type'=>'int'),
745: 'shipping_address_id' => array('type'=>'int'),
746:
747: 'global_currency_code' => array(),
748: 'base_currency_code' => array(),
749: 'store_currency_code' => array(),
750: 'order_currency_code' => array(),
751: 'store_to_base_rate' => array('type'=>'decimal'),
752: 'store_to_order_rate' => array('type'=>'decimal'),
753: 'base_to_global_rate' => array('type'=>'decimal'),
754: 'base_to_order_rate' => array('type'=>'decimal'),
755:
756: 'subtotal' => array('type'=>'decimal'),
757: 'discount_amount' => array('type'=>'decimal'),
758: 'tax_amount' => array('type'=>'decimal'),
759: 'shipping_amount' => array('type'=>'decimal'),
760: 'adjustment' => array('type'=>'decimal'),
761: 'adjustment_positive' => array('type'=>'decimal'),
762: 'adjustment_negative' => array('type'=>'decimal'),
763: 'grand_total' => array('type'=>'decimal'),
764:
765: 'base_subtotal' => array('type'=>'decimal'),
766: 'base_discount_amount' => array('type'=>'decimal'),
767: 'base_tax_amount' => array('type'=>'decimal'),
768: 'base_shipping_amount' => array('type'=>'decimal'),
769: 'base_adjustment' => array('type'=>'decimal'),
770: 'base_adjustment_positive' => array('type'=>'decimal'),
771: 'base_adjustment_negative' => array('type'=>'decimal'),
772: 'base_grand_total' => array('type'=>'decimal'),
773: 'email_sent' => array('type'=>'int'),
774: ),
775: ),
776:
777: 'creditmemo_item' => array(
778: 'entity_model' => 'sales/order_creditmemo_item',
779:
780: 'table'=>'sales/order_entity',
781: 'attributes' => array(
782: 'parent_id' => array(
783: 'type'=>'static',
784: 'backend'=>'sales_entity/order_creditmemo_attribute_backend_child'
785: ),
786: 'order_item_id' => array('type'=>'int'),
787: 'product_id' => array('type'=>'int'),
788: 'name' => array(),
789: 'description' => array('type'=>'text'),
790: 'sku' => array(),
791: 'qty' => array('type'=>'decimal'),
792: 'cost' => array('type'=>'decimal'),
793: 'price' => array('type'=>'decimal'),
794: 'discount_amount' => array('type'=>'decimal'),
795: 'tax_amount' => array('type'=>'decimal'),
796: 'row_total' => array('type'=>'decimal'),
797:
798: 'base_price' => array('type'=>'decimal'),
799: 'base_discount_amount' => array('type'=>'decimal'),
800: 'base_tax_amount' => array('type'=>'decimal'),
801: 'base_row_total' => array('type'=>'decimal'),
802:
803: 'additional_data' => array('type'=>'text'),
804: ),
805: ),
806:
807: 'creditmemo_comment' => array(
808: 'entity_model' => 'sales/order_creditmemo_comment',
809: 'table'=>'sales/order_entity',
810: 'attributes' => array(
811: 'parent_id' => array(
812: 'type'=>'static',
813: 'backend'=>'sales_entity/order_creditmemo_attribute_backend_child'
814: ),
815: 'comment' => array('type'=>'text'),
816: 'is_customer_notified' => array('type'=>'int'),
817: ),
818: ),
819:
820: );
821: }
822: }
823: