Magento Database Model
Last updated
Last updated
Magento doesn't come with a built-in feature for managing duties. To fill this gap, we've introduced new tables as an extension to the Magento database model. These additions make it easier to handle duties.
This upgrade enhances Magento allowing Glopal to automatically adjust order summary used on the website and emails, default invoice document and other places where order total is presented. By using these additions you can automatically pull duty and customs amounts into your ERP or other connected systems.
Following Magento's convention, any value prefixed with base_
represents the amount in the original Magento shop currency. Depending on your Glopal account settings, values without the base_
prefix can represent the amount in the presentment currency (default option allowing you to reconcile in the same currency the buyer paid, e.g., destination currency), payout currency (what you will receive), or the same original shop currency.
We extend Magento sales_order
with a one-to-one relation to the gl_sales_order_attribute
table that adds additional meta information and Customs costs (extra charges).
If Global Duty & Tax calculation is used, two additional tables store calculated duties. The Magento sales_order
table is linked one-to-one to gl_sales_order_tcc
for order-level amounts, and sales_order_item
is linked one-to-one to gl_sales_order_item_tcc
for item-level duties.
Name | Type | Description |
entity_id | int(10) | Primary key |
order_id | int(10) | Foreign key - Magento order id (entity_id) |
glopal_id | varchar(255) | Unique Glopal Order ID |
transaction_id | varchar(255) | Unique Glopal Transaction ID if Glopal Duty & Tax calculation is used |
customer_origin_email | varchar(255) | Customer original email |
customer_shipping_address | mediumtext | Customer original shipping address (JSON) if Parcel Forwarding is used |
base_extra_amount_net | decimal(20,4) | Base extra amount net |
extra_amount_net | decimal(20,4) | Extra amount net |
base_extra_tax_on_amount | decimal(20,4) | Base extra tax on amount |
extra_tax_on_amount | decimal(20,4) | Extra tax on amount |
prealert_status | varchar(255) | Glopal pre-alert status |
Name | Type | Description |
entity_id | int(10) | Primary key |
order_id | int(10) | Foreign key - Magento order id (entity_id) |
base_total_duty_amount | decimal(20,4) | Base total order duty amount |
total_duty_amount | decimal(20,4) | Total order duty amount |
base_total_tax_on_duty | decimal(20,4) | Base total order tax on duty amount |
total_tax_on_duty | decimal(20,4) | Total order tax on duty amount |
base_items_duty_amount | decimal(20,4) | Base order items duty amount |
items_duty_amount | decimal(20,4) | Order items duty amount |
base_items_tax_on_duty | decimal(20,4) | Base order items tax on duty amount |
items_tax_on_duty | decimal(20,4) | Order items tax on duty amount |
base_discount_duty_amount | decimal(20,4) | Base order discount duty amount |
discount_duty_amount | decimal(20,4) | Order order discount duty amount |
base_discount_tax_on_duty | decimal(20,4) | Base order discount tax on duty amount |
discount_tax_on_duty | decimal(20,4) | Order discount tax on duty amount |
base_shipping_duty_amount | decimal(20,4) | Base order shipping duty amount |
shipping_duty_amount | decimal(20,4) | Order shipping duty amount |
base_shipping_tax_on_duty | decimal(20,4) | Base order shipping tax on duty amount |
shipping_tax_on_duty | decimal(20,4) | Order shipping tax on duty amount |
base_extra_duty_amount | decimal(20,4) | Base order extra duty amount |
extra_duty_amount | decimal(20,4) | Order extra duty amount |
base_extra_tax_on_duty | decimal(20,4) | Base order extra tax on duty amount |
extra_tax_on_duty | decimal(20,4) | Order extra tax on duty amount |
Name | Type | Description |
entity_id | int(10) | Primary key |
order_item_id | int(10) | Foreign key - Magento order item id (item_id) |
order_tcc_id | decimal(20,4) | Foreign key - Glopal tcc id (gl_sales_order_tcc) |
base_duty_amount | decimal(20,4) | Base order item duty amount |
duty_amount | decimal(20,4) | Order item duty amount |
base_tax_on_duty | decimal(20,4) | Base order item tax on duty amount |
tax_on_duty | decimal(20,4) | Order item tax on duty amount |
duty_percent | decimal(12,4) | Duty percents |