ALTER TABLE AD_Client ADD CONSTRAINT ADReplicationStrategy_ADClient FOREIGN KEY (AD_ReplicationStrategy_ID) REFERENCES AD_ReplicationStrategy;

ALTER TABLE AD_ReplicationDocument ADD CONSTRAINT ADTable_ADReplicationDocument FOREIGN KEY (AD_Table_ID) REFERENCES AD_Table;

ALTER TABLE AD_ReplicationDocument ADD CONSTRAINT CDocType_ADReplicationDocument FOREIGN KEY (C_DocType_ID) REFERENCES C_DocType;

ALTER TABLE AD_ReplicationStrategy ADD CONSTRAINT EXPProcessor_ADReplicationStra FOREIGN KEY (EXP_Processor_ID) REFERENCES EXP_Processor;

ALTER TABLE AD_WF_Node ADD CONSTRAINT CBPartner_ADWFNode FOREIGN KEY (C_BPartner_ID) REFERENCES C_BPartner;

ALTER TABLE AD_WF_Node ADD CONSTRAINT SResource_ADWFNode FOREIGN KEY (S_Resource_ID) REFERENCES S_Resource;

ALTER TABLE AD_Workflow ADD CONSTRAINT SResource_ADWorkflow FOREIGN KEY (S_Resource_ID) REFERENCES S_Resource;

ALTER TABLE C_BPartner ADD CONSTRAINT CTaxGroup_CBPartner FOREIGN KEY (C_TaxGroup_ID) REFERENCES C_TaxGroup;

ALTER TABLE C_CashLine ADD CONSTRAINT CPayment_CCashLine FOREIGN KEY (C_Payment_ID) REFERENCES C_Payment;

ALTER TABLE C_Invoice ADD CONSTRAINT Reversal_CInvoice FOREIGN KEY (Reversal_ID) REFERENCES C_Invoice;

ALTER TABLE C_Order ADD CONSTRAINT LinkOrder_COrder FOREIGN KEY (Link_Order_ID) REFERENCES C_Order;

ALTER TABLE C_OrderLine ADD CONSTRAINT LinkOrderLine_COrderLine FOREIGN KEY (Link_OrderLine_ID) REFERENCES C_OrderLine;

ALTER TABLE C_Payment ADD CONSTRAINT Reversal_CPayment FOREIGN KEY (Reversal_ID) REFERENCES C_Payment;

ALTER TABLE C_POS ADD CONSTRAINT CBankAccount_CPOS FOREIGN KEY (C_BankAccount_ID) REFERENCES C_BankAccount;

ALTER TABLE C_Tax ADD CONSTRAINT ADRule_CTax FOREIGN KEY (AD_Rule_ID) REFERENCES AD_Rule;

ALTER TABLE C_TaxDefinition ADD CONSTRAINT ADOrgType_CTaxDefinition FOREIGN KEY (AD_OrgType_ID) REFERENCES AD_OrgType;

ALTER TABLE C_TaxDefinition ADD CONSTRAINT CBPartner_CTaxDefinition FOREIGN KEY (C_BPartner_ID) REFERENCES C_BPartner;

ALTER TABLE C_TaxDefinition ADD CONSTRAINT CBPGroup_CTaxDefinition FOREIGN KEY (C_BP_Group_ID) REFERENCES C_BP_Group;

ALTER TABLE C_TaxDefinition ADD CONSTRAINT CTax_CTaxDefinition FOREIGN KEY (C_Tax_ID) REFERENCES C_Tax;

ALTER TABLE C_TaxDefinition ADD CONSTRAINT CTaxBase_CTaxDefinition FOREIGN KEY (C_TaxBase_ID) REFERENCES C_TaxBase;

ALTER TABLE C_TaxDefinition ADD CONSTRAINT CTaxCategory_CTaxDefinition FOREIGN KEY (C_TaxCategory_ID) REFERENCES C_TaxCategory;

ALTER TABLE C_TaxDefinition ADD CONSTRAINT CTaxGroup_CTaxDefinition FOREIGN KEY (C_TaxGroup_ID) REFERENCES C_TaxGroup;

ALTER TABLE C_TaxDefinition ADD CONSTRAINT CTaxType_CTaxDefinition FOREIGN KEY (C_TaxType_ID) REFERENCES C_TaxType;

ALTER TABLE C_TaxDefinition ADD CONSTRAINT MProduct_CTaxDefinition FOREIGN KEY (M_Product_ID) REFERENCES M_Product;

ALTER TABLE C_TaxDefinition ADD CONSTRAINT MProductCategory_CTaxDefinitio FOREIGN KEY (M_Product_Category_ID) REFERENCES M_Product_Category;

ALTER TABLE DD_NetworkDistribution ADD CONSTRAINT MChangeNotice_DDNetworkDistrib FOREIGN KEY (M_ChangeNotice_ID) REFERENCES M_ChangeNotice;

ALTER TABLE DD_NetworkDistributionLine ADD CONSTRAINT DDNetworkDistribution_DDNetwor FOREIGN KEY (DD_NetworkDistribution_ID) REFERENCES DD_NetworkDistribution;

ALTER TABLE DD_NetworkDistributionLine ADD CONSTRAINT MShipper_DDNetworkDistribution FOREIGN KEY (M_Shipper_ID) REFERENCES M_Shipper;

ALTER TABLE DD_NetworkDistributionLine ADD CONSTRAINT MWarehouse_DDNetworkDistributi FOREIGN KEY (M_Warehouse_ID) REFERENCES M_Warehouse;

ALTER TABLE DD_NetworkDistributionLine ADD CONSTRAINT MWarehouseSource_DDNetworkDist FOREIGN KEY (M_WarehouseSource_ID) REFERENCES M_Warehouse;

ALTER TABLE DD_Order ADD CONSTRAINT ADOrgTrx_DDOrder FOREIGN KEY (AD_OrgTrx_ID) REFERENCES AD_Org;

ALTER TABLE DD_Order ADD CONSTRAINT ADUser_DDOrder FOREIGN KEY (AD_User_ID) REFERENCES AD_User;

ALTER TABLE DD_Order ADD CONSTRAINT SalesRep_DDOrder FOREIGN KEY (SalesRep_ID) REFERENCES AD_User;

ALTER TABLE DD_Order ADD CONSTRAINT CActivity_DDOrder FOREIGN KEY (C_Activity_ID) REFERENCES C_Activity;

ALTER TABLE DD_Order ADD CONSTRAINT CBPartner_DDOrder FOREIGN KEY (C_BPartner_ID) REFERENCES C_BPartner;

ALTER TABLE DD_Order ADD CONSTRAINT CBPartnerLocation_DDOrder FOREIGN KEY (C_BPartner_Location_ID) REFERENCES C_BPartner_Location;

ALTER TABLE DD_Order ADD CONSTRAINT CCampaign_DDOrder FOREIGN KEY (C_Campaign_ID) REFERENCES C_Campaign;

ALTER TABLE DD_Order ADD CONSTRAINT CCharge_DDOrder FOREIGN KEY (C_Charge_ID) REFERENCES C_Charge;

ALTER TABLE DD_Order ADD CONSTRAINT CDocType_DDOrder FOREIGN KEY (C_DocType_ID) REFERENCES C_DocType;

ALTER TABLE DD_Order ADD CONSTRAINT User1_DDOrder FOREIGN KEY (User1_ID) REFERENCES C_ElementValue;

ALTER TABLE DD_Order ADD CONSTRAINT User2_DDOrder FOREIGN KEY (User2_ID) REFERENCES C_ElementValue;

ALTER TABLE DD_Order ADD CONSTRAINT CInvoice_DDOrder FOREIGN KEY (C_Invoice_ID) REFERENCES C_Invoice;

ALTER TABLE DD_Order ADD CONSTRAINT COrder_DDOrder FOREIGN KEY (C_Order_ID) REFERENCES C_Order;

ALTER TABLE DD_Order ADD CONSTRAINT CProject_DDOrder FOREIGN KEY (C_Project_ID) REFERENCES C_Project;

ALTER TABLE DD_Order ADD CONSTRAINT MShipper_DDOrder FOREIGN KEY (M_Shipper_ID) REFERENCES M_Shipper;

ALTER TABLE DD_Order ADD CONSTRAINT MWarehouse_DDOrder FOREIGN KEY (M_Warehouse_ID) REFERENCES M_Warehouse;

ALTER TABLE DD_OrderLine ADD CONSTRAINT ADOrgTrx_DDOrderLine FOREIGN KEY (AD_OrgTrx_ID) REFERENCES AD_Org;

ALTER TABLE DD_OrderLine ADD CONSTRAINT CActivity_DDOrderLine FOREIGN KEY (C_Activity_ID) REFERENCES C_Activity;

ALTER TABLE DD_OrderLine ADD CONSTRAINT CCampaign_DDOrderLine FOREIGN KEY (C_Campaign_ID) REFERENCES C_Campaign;

ALTER TABLE DD_OrderLine ADD CONSTRAINT CCharge_DDOrderLine FOREIGN KEY (C_Charge_ID) REFERENCES C_Charge;

ALTER TABLE DD_OrderLine ADD CONSTRAINT User1_DDOrderLine FOREIGN KEY (User1_ID) REFERENCES C_ElementValue;

ALTER TABLE DD_OrderLine ADD CONSTRAINT User2_DDOrderLine FOREIGN KEY (User2_ID) REFERENCES C_ElementValue;

ALTER TABLE DD_OrderLine ADD CONSTRAINT CProject_DDOrderLine FOREIGN KEY (C_Project_ID) REFERENCES C_Project;

ALTER TABLE DD_OrderLine ADD CONSTRAINT CUOM_DDOrderLine FOREIGN KEY (C_UOM_ID) REFERENCES C_UOM;

ALTER TABLE DD_OrderLine ADD CONSTRAINT DDOrder_DDOrderLine FOREIGN KEY (DD_Order_ID) REFERENCES DD_Order;

ALTER TABLE DD_OrderLine ADD CONSTRAINT MLocator_DDOrderLine FOREIGN KEY (M_Locator_ID) REFERENCES M_Locator;

ALTER TABLE DD_OrderLine ADD CONSTRAINT MLocatorTo_DDOrderLine FOREIGN KEY (M_LocatorTo_ID) REFERENCES M_Locator;

ALTER TABLE DD_OrderLine ADD CONSTRAINT MProduct_DDOrderLine FOREIGN KEY (M_Product_ID) REFERENCES M_Product;

ALTER TABLE EXP_Format ADD CONSTRAINT ADTable_EXPFormat FOREIGN KEY (AD_Table_ID) REFERENCES AD_Table;

ALTER TABLE EXP_FormatLine ADD CONSTRAINT ADColumn_EXPFormatLine FOREIGN KEY (AD_Column_ID) REFERENCES AD_Column;

ALTER TABLE EXP_FormatLine ADD CONSTRAINT EXPEmbeddedFormat_EXPFormatLin FOREIGN KEY (EXP_EmbeddedFormat_ID) REFERENCES EXP_Format;

ALTER TABLE EXP_FormatLine ADD CONSTRAINT EXPFormat_EXPFormatLine FOREIGN KEY (EXP_Format_ID) REFERENCES EXP_Format;

ALTER TABLE EXP_Processor ADD CONSTRAINT EXPProcessorType_EXPProcessor FOREIGN KEY (EXP_Processor_Type_ID) REFERENCES EXP_Processor_Type;

ALTER TABLE EXP_ProcessorParameter ADD CONSTRAINT EXPProcessor_EXPProcessorParam FOREIGN KEY (EXP_Processor_ID) REFERENCES EXP_Processor;

ALTER TABLE GL_Journal ADD CONSTRAINT Reversal_GLJournal FOREIGN KEY (Reversal_ID) REFERENCES GL_Journal;

ALTER TABLE GL_JournalBatch ADD CONSTRAINT Reversal_GLJournalBatch FOREIGN KEY (Reversal_ID) REFERENCES GL_JournalBatch;

ALTER TABLE HR_Attribute ADD CONSTRAINT ADRule_HRAttribute FOREIGN KEY (AD_Rule_ID) REFERENCES AD_Rule;

ALTER TABLE HR_Attribute ADD CONSTRAINT CBPartner_HRAttribute FOREIGN KEY (C_BPartner_ID) REFERENCES C_BPartner;

ALTER TABLE HR_Attribute ADD CONSTRAINT HRConcept_HRAttribute FOREIGN KEY (HR_Concept_ID) REFERENCES HR_Concept;

ALTER TABLE HR_Attribute ADD CONSTRAINT HRDepartment_HRAttribute FOREIGN KEY (HR_Department_ID) REFERENCES HR_Department;

ALTER TABLE HR_Attribute ADD CONSTRAINT HREmployee_HRAttribute FOREIGN KEY (HR_Employee_ID) REFERENCES HR_Employee;

ALTER TABLE HR_Attribute ADD CONSTRAINT HRJob_HRAttribute FOREIGN KEY (HR_Job_ID) REFERENCES HR_Job;

ALTER TABLE HR_Attribute ADD CONSTRAINT HRPayroll_HRAttribute FOREIGN KEY (HR_Payroll_ID) REFERENCES HR_Payroll;

ALTER TABLE HR_Concept ADD CONSTRAINT HRConceptCategory_HRConcept FOREIGN KEY (HR_Concept_Category_ID) REFERENCES HR_Concept_Category;

ALTER TABLE HR_Concept ADD CONSTRAINT HRDepartment_HRConcept FOREIGN KEY (HR_Department_ID) REFERENCES HR_Department;

ALTER TABLE HR_Concept ADD CONSTRAINT HRJob_HRConcept FOREIGN KEY (HR_Job_ID) REFERENCES HR_Job;

ALTER TABLE HR_Concept ADD CONSTRAINT HRPayroll_HRConcept FOREIGN KEY (HR_Payroll_ID) REFERENCES HR_Payroll;

ALTER TABLE HR_Concept_Acct ADD CONSTRAINT CAcctSchema_HRConceptAcct FOREIGN KEY (C_AcctSchema_ID) REFERENCES C_AcctSchema;

ALTER TABLE HR_Concept_Acct ADD CONSTRAINT CBPGroup_HRConceptAcct FOREIGN KEY (C_BP_Group_ID) REFERENCES C_BP_Group;

ALTER TABLE HR_Concept_Acct ADD CONSTRAINT User1_HRConceptAcct FOREIGN KEY (User1_ID) REFERENCES C_ElementValue;

ALTER TABLE HR_Concept_Acct ADD CONSTRAINT HRConcept_HRConceptAcct FOREIGN KEY (HR_Concept_ID) REFERENCES HR_Concept;

ALTER TABLE HR_Contract ADD CONSTRAINT CBPartner_HRContract FOREIGN KEY (C_BPartner_ID) REFERENCES C_BPartner;

ALTER TABLE HR_Contract ADD CONSTRAINT CCampaign_HRContract FOREIGN KEY (C_Campaign_ID) REFERENCES C_Campaign;

ALTER TABLE HR_Contract ADD CONSTRAINT CProject_HRContract FOREIGN KEY (C_Project_ID) REFERENCES C_Project;

ALTER TABLE HR_Employee ADD CONSTRAINT CActivity_HREmployee FOREIGN KEY (C_Activity_ID) REFERENCES C_Activity;

ALTER TABLE HR_Employee ADD CONSTRAINT CBPartner_HREmployee FOREIGN KEY (C_BPartner_ID) REFERENCES C_BPartner;

ALTER TABLE HR_Employee ADD CONSTRAINT HRDepartment_HREmployee FOREIGN KEY (HR_Department_ID) REFERENCES HR_Department;

ALTER TABLE HR_Employee ADD CONSTRAINT HRJob_HREmployee FOREIGN KEY (HR_Job_ID) REFERENCES HR_Job;

ALTER TABLE HR_Employee ADD CONSTRAINT HRPayroll_HREmployee FOREIGN KEY (HR_Payroll_ID) REFERENCES HR_Payroll;

ALTER TABLE HR_Job ADD CONSTRAINT Supervisor_HRJob FOREIGN KEY (Supervisor_ID) REFERENCES AD_User;

ALTER TABLE HR_Job ADD CONSTRAINT HRDepartment_HRJob FOREIGN KEY (HR_Department_ID) REFERENCES HR_Department;

ALTER TABLE HR_Job ADD CONSTRAINT NextJob_HRJob FOREIGN KEY (Next_Job_ID) REFERENCES HR_Job;

ALTER TABLE HR_List ADD CONSTRAINT HRDepartment_HRList FOREIGN KEY (HR_Department_ID) REFERENCES HR_Department;

ALTER TABLE HR_List ADD CONSTRAINT HREmployee_HRList FOREIGN KEY (HR_Employee_ID) REFERENCES HR_Employee;

ALTER TABLE HR_List ADD CONSTRAINT HRListType_HRList FOREIGN KEY (HR_ListType_ID) REFERENCES HR_ListType;

ALTER TABLE HR_List ADD CONSTRAINT HRPayroll_HRList FOREIGN KEY (HR_Payroll_ID) REFERENCES HR_Payroll;

ALTER TABLE HR_ListLine ADD CONSTRAINT HRListVersion_HRListLine FOREIGN KEY (HR_ListVersion_ID) REFERENCES HR_ListVersion;

ALTER TABLE HR_ListVersion ADD CONSTRAINT HRListBase_HRListVersion FOREIGN KEY (HR_ListBase_ID) REFERENCES HR_List;

ALTER TABLE HR_ListVersion ADD CONSTRAINT HRList_HRListVersion FOREIGN KEY (HR_List_ID) REFERENCES HR_List;

ALTER TABLE HR_Movement ADD CONSTRAINT ADRule_HRMovement FOREIGN KEY (AD_Rule_ID) REFERENCES AD_Rule;

ALTER TABLE HR_Movement ADD CONSTRAINT CActivity_HRMovement FOREIGN KEY (C_Activity_ID) REFERENCES C_Activity;

ALTER TABLE HR_Movement ADD CONSTRAINT CBPartner_HRMovement FOREIGN KEY (C_BPartner_ID) REFERENCES C_BPartner;

ALTER TABLE HR_Movement ADD CONSTRAINT HRConcept_HRMovement FOREIGN KEY (HR_Concept_ID) REFERENCES HR_Concept;

ALTER TABLE HR_Movement ADD CONSTRAINT HRConceptCategory_HRMovement FOREIGN KEY (HR_Concept_Category_ID) REFERENCES HR_Concept_Category;

ALTER TABLE HR_Movement ADD CONSTRAINT HRDepartment_HRMovement FOREIGN KEY (HR_Department_ID) REFERENCES HR_Department;

ALTER TABLE HR_Movement ADD CONSTRAINT HRJob_HRMovement FOREIGN KEY (HR_Job_ID) REFERENCES HR_Job;

ALTER TABLE HR_Movement ADD CONSTRAINT HRProcess_HRMovement FOREIGN KEY (HR_Process_ID) REFERENCES HR_Process;

ALTER TABLE HR_Payroll ADD CONSTRAINT ADPrintFormat_HRPayroll FOREIGN KEY (AD_PrintFormat_ID) REFERENCES AD_PrintFormat;

ALTER TABLE HR_Payroll ADD CONSTRAINT CCharge_HRPayroll FOREIGN KEY (C_Charge_ID) REFERENCES C_Charge;

ALTER TABLE HR_Payroll ADD CONSTRAINT HRContract_HRPayroll FOREIGN KEY (HR_Contract_ID) REFERENCES HR_Contract;

ALTER TABLE HR_PayrollConcept ADD CONSTRAINT ADRule_HRPayrollConcept FOREIGN KEY (AD_Rule_ID) REFERENCES AD_Rule;

ALTER TABLE HR_PayrollConcept ADD CONSTRAINT HRConcept_HRPayrollConcept FOREIGN KEY (HR_Concept_ID) REFERENCES HR_Concept;

ALTER TABLE HR_PayrollConcept ADD CONSTRAINT HRPayroll_HRPayrollConcept FOREIGN KEY (HR_Payroll_ID) REFERENCES HR_Payroll;

ALTER TABLE HR_Period ADD CONSTRAINT CPeriod_HRPeriod FOREIGN KEY (C_Period_ID) REFERENCES C_Period;

ALTER TABLE HR_Period ADD CONSTRAINT CYear_HRPeriod FOREIGN KEY (C_Year_ID) REFERENCES C_Year;

ALTER TABLE HR_Period ADD CONSTRAINT HRPayroll_HRPeriod FOREIGN KEY (HR_Payroll_ID) REFERENCES HR_Payroll;

ALTER TABLE HR_Period ADD CONSTRAINT HRYear_HRPeriod FOREIGN KEY (HR_Year_ID) REFERENCES HR_Year;

ALTER TABLE HR_Process ADD CONSTRAINT ADPrintFormat_HRProcess FOREIGN KEY (AD_PrintFormat_ID) REFERENCES AD_PrintFormat;

ALTER TABLE HR_Process ADD CONSTRAINT ADWorkflow_HRProcess FOREIGN KEY (AD_Workflow_ID) REFERENCES AD_Workflow;

ALTER TABLE HR_Process ADD CONSTRAINT CBPartner_HRProcess FOREIGN KEY (C_BPartner_ID) REFERENCES C_BPartner;

ALTER TABLE HR_Process ADD CONSTRAINT CCharge_HRProcess FOREIGN KEY (C_Charge_ID) REFERENCES C_Charge;

ALTER TABLE HR_Process ADD CONSTRAINT CDocType_HRProcess FOREIGN KEY (C_DocType_ID) REFERENCES C_DocType;

ALTER TABLE HR_Process ADD CONSTRAINT CDocTypeTarget_HRProcess FOREIGN KEY (C_DocTypeTarget_ID) REFERENCES C_DocType;

ALTER TABLE HR_Process ADD CONSTRAINT CPaySelection_HRProcess FOREIGN KEY (C_PaySelection_ID) REFERENCES C_PaySelection;

ALTER TABLE HR_Process ADD CONSTRAINT HRDepartment_HRProcess FOREIGN KEY (HR_Department_ID) REFERENCES HR_Department;

ALTER TABLE HR_Process ADD CONSTRAINT HREmployee_HRProcess FOREIGN KEY (HR_Employee_ID) REFERENCES HR_Employee;

ALTER TABLE HR_Process ADD CONSTRAINT HRJob_HRProcess FOREIGN KEY (HR_Job_ID) REFERENCES HR_Job;

ALTER TABLE HR_Process ADD CONSTRAINT HRPayroll_HRProcess FOREIGN KEY (HR_Payroll_ID) REFERENCES HR_Payroll;

ALTER TABLE HR_Process ADD CONSTRAINT HRPeriod_HRProcess FOREIGN KEY (HR_Period_ID) REFERENCES HR_Period;

ALTER TABLE HR_Process ADD CONSTRAINT Reversal_HRProcess FOREIGN KEY (Reversal_ID) REFERENCES HR_Process;

ALTER TABLE HR_Year ADD CONSTRAINT CYear_HRYear FOREIGN KEY (C_Year_ID) REFERENCES C_Year;

ALTER TABLE HR_Year ADD CONSTRAINT HRPayroll_HRYear FOREIGN KEY (HR_Payroll_ID) REFERENCES HR_Payroll;

ALTER TABLE IMP_Processor ADD CONSTRAINT IMPProcessorType_IMPProcessor FOREIGN KEY (IMP_Processor_Type_ID) REFERENCES IMP_Processor_Type;

ALTER TABLE IMP_ProcessorLog ADD CONSTRAINT IMPProcessor_IMPProcessorLog FOREIGN KEY (IMP_Processor_ID) REFERENCES IMP_Processor;

ALTER TABLE IMP_ProcessorParameter ADD CONSTRAINT IMPProcessor_IMPProcessorParam FOREIGN KEY (IMP_Processor_ID) REFERENCES IMP_Processor;

ALTER TABLE M_ForecastLine ADD CONSTRAINT MWarehouse_MForecastLine FOREIGN KEY (M_Warehouse_ID) REFERENCES M_Warehouse;

ALTER TABLE M_InOut ADD CONSTRAINT Reversal_MInOut FOREIGN KEY (Reversal_ID) REFERENCES M_InOut;

ALTER TABLE M_Inventory ADD CONSTRAINT Reversal_MInventory FOREIGN KEY (Reversal_ID) REFERENCES M_Inventory;

ALTER TABLE M_Movement ADD CONSTRAINT ADUser_MMovement FOREIGN KEY (AD_User_ID) REFERENCES AD_User;

ALTER TABLE M_Movement ADD CONSTRAINT SalesRep_MMovement FOREIGN KEY (SalesRep_ID) REFERENCES AD_User;

ALTER TABLE M_Movement ADD CONSTRAINT CBPartner_MMovement FOREIGN KEY (C_BPartner_ID) REFERENCES C_BPartner;

ALTER TABLE M_Movement ADD CONSTRAINT CCharge_MMovement FOREIGN KEY (C_Charge_ID) REFERENCES C_Charge;

ALTER TABLE M_Movement ADD CONSTRAINT DDOrder_MMovement FOREIGN KEY (DD_Order_ID) REFERENCES DD_Order;

ALTER TABLE M_Movement ADD CONSTRAINT Reversal_MMovement FOREIGN KEY (Reversal_ID) REFERENCES M_Movement;

ALTER TABLE M_Movement ADD CONSTRAINT MShipper_MMovement FOREIGN KEY (M_Shipper_ID) REFERENCES M_Shipper;

ALTER TABLE M_MovementLine ADD CONSTRAINT DDOrderLine_MMovementLine FOREIGN KEY (DD_OrderLine_ID) REFERENCES DD_OrderLine;

ALTER TABLE M_Transaction ADD CONSTRAINT PPOrder_MTransaction FOREIGN KEY (PP_Order_ID) REFERENCES PP_Order;

ALTER TABLE M_Transaction ADD CONSTRAINT PPOrderBOMLine_MTransaction FOREIGN KEY (PP_Order_BOMLine_ID) REFERENCES PP_Order_BOMLine;

ALTER TABLE PP_Cost_Collector ADD CONSTRAINT ADOrgTrx_PPCostCollector FOREIGN KEY (AD_OrgTrx_ID) REFERENCES AD_Org;

ALTER TABLE PP_Cost_Collector ADD CONSTRAINT ADUser_PPCostCollector FOREIGN KEY (AD_User_ID) REFERENCES AD_User;

ALTER TABLE PP_Cost_Collector ADD CONSTRAINT User1_PPCostCollector FOREIGN KEY (User1_ID) REFERENCES AD_User;

ALTER TABLE PP_Cost_Collector ADD CONSTRAINT User2_PPCostCollector FOREIGN KEY (User2_ID) REFERENCES AD_User;

ALTER TABLE PP_Cost_Collector ADD CONSTRAINT CActivity_PPCostCollector FOREIGN KEY (C_Activity_ID) REFERENCES C_Activity;

ALTER TABLE PP_Cost_Collector ADD CONSTRAINT CCampaign_PPCostCollector FOREIGN KEY (C_Campaign_ID) REFERENCES C_Campaign;

ALTER TABLE PP_Cost_Collector ADD CONSTRAINT CDocType_PPCostCollector FOREIGN KEY (C_DocType_ID) REFERENCES C_DocType;

ALTER TABLE PP_Cost_Collector ADD CONSTRAINT CDocTypeTarget_PPCostCollector FOREIGN KEY (C_DocTypeTarget_ID) REFERENCES C_DocType;

ALTER TABLE PP_Cost_Collector ADD CONSTRAINT CProject_PPCostCollector FOREIGN KEY (C_Project_ID) REFERENCES C_Project;

ALTER TABLE PP_Cost_Collector ADD CONSTRAINT CUOM_PPCostCollector FOREIGN KEY (C_UOM_ID) REFERENCES C_UOM;

ALTER TABLE PP_Cost_Collector ADD CONSTRAINT MProduct_PPCostCollector FOREIGN KEY (M_Product_ID) REFERENCES M_Product;

ALTER TABLE PP_Cost_Collector ADD CONSTRAINT MWarehouse_PPCostCollector FOREIGN KEY (M_Warehouse_ID) REFERENCES M_Warehouse;

ALTER TABLE PP_Cost_Collector ADD CONSTRAINT Reversal_PPCostCollector FOREIGN KEY (Reversal_ID) REFERENCES PP_Cost_Collector;

ALTER TABLE PP_Cost_Collector ADD CONSTRAINT PPOrder_PPCostCollector FOREIGN KEY (PP_Order_ID) REFERENCES PP_Order;

ALTER TABLE PP_Cost_Collector ADD CONSTRAINT PPOrderBOMLine_PPCostCollector FOREIGN KEY (PP_Order_BOMLine_ID) REFERENCES PP_Order_BOMLine;

ALTER TABLE PP_Cost_Collector ADD CONSTRAINT PPOrderNode_PPCostCollector FOREIGN KEY (PP_Order_Node_ID) REFERENCES PP_Order_Node;

ALTER TABLE PP_Cost_Collector ADD CONSTRAINT PPOrderWorkflow_PPCostCollecto FOREIGN KEY (PP_Order_Workflow_ID) REFERENCES PP_Order_Workflow;

ALTER TABLE PP_Cost_Collector ADD CONSTRAINT SResource_PPCostCollector FOREIGN KEY (S_Resource_ID) REFERENCES S_Resource;

ALTER TABLE PP_MRP ADD CONSTRAINT Planner_PPMRP FOREIGN KEY (Planner_ID) REFERENCES AD_User;

ALTER TABLE PP_MRP ADD CONSTRAINT CBPartner_PPMRP FOREIGN KEY (C_BPartner_ID) REFERENCES C_BPartner;

ALTER TABLE PP_MRP ADD CONSTRAINT COrder_PPMRP FOREIGN KEY (C_Order_ID) REFERENCES C_Order;

ALTER TABLE PP_MRP ADD CONSTRAINT COrderLine_PPMRP FOREIGN KEY (C_OrderLine_ID) REFERENCES C_OrderLine;

ALTER TABLE PP_MRP ADD CONSTRAINT MForecast_PPMRP FOREIGN KEY (M_Forecast_ID) REFERENCES M_Forecast;

ALTER TABLE PP_MRP ADD CONSTRAINT MForecastLine_PPMRP FOREIGN KEY (M_ForecastLine_ID) REFERENCES M_ForecastLine;

ALTER TABLE PP_MRP ADD CONSTRAINT MProduct_PPMRP FOREIGN KEY (M_Product_ID) REFERENCES M_Product;

ALTER TABLE PP_MRP ADD CONSTRAINT MRequisition_PPMRP FOREIGN KEY (M_Requisition_ID) REFERENCES M_Requisition;

ALTER TABLE PP_MRP ADD CONSTRAINT MRequisitionLine_PPMRP FOREIGN KEY (M_RequisitionLine_ID) REFERENCES M_RequisitionLine;

ALTER TABLE PP_MRP ADD CONSTRAINT MWarehouse_PPMRP FOREIGN KEY (M_Warehouse_ID) REFERENCES M_Warehouse;

ALTER TABLE PP_MRP ADD CONSTRAINT PPOrder_PPMRP FOREIGN KEY (PP_Order_ID) REFERENCES PP_Order;

ALTER TABLE PP_MRP ADD CONSTRAINT PPOrderBOMLine_PPMRP FOREIGN KEY (PP_Order_BOMLine_ID) REFERENCES PP_Order_BOMLine;

ALTER TABLE PP_MRP ADD CONSTRAINT SResource_PPMRP FOREIGN KEY (S_Resource_ID) REFERENCES S_Resource;

ALTER TABLE PP_Order ADD CONSTRAINT ADOrgTrx_PPOrder FOREIGN KEY (AD_OrgTrx_ID) REFERENCES AD_Org;

ALTER TABLE PP_Order ADD CONSTRAINT Planner_PPOrder FOREIGN KEY (Planner_ID) REFERENCES AD_User;

ALTER TABLE PP_Order ADD CONSTRAINT ADWorkflow_PPOrder FOREIGN KEY (AD_Workflow_ID) REFERENCES AD_Workflow;

ALTER TABLE PP_Order ADD CONSTRAINT CActivity_PPOrder FOREIGN KEY (C_Activity_ID) REFERENCES C_Activity;

ALTER TABLE PP_Order ADD CONSTRAINT CCampaign_PPOrder FOREIGN KEY (C_Campaign_ID) REFERENCES C_Campaign;

ALTER TABLE PP_Order ADD CONSTRAINT CDocType_PPOrder FOREIGN KEY (C_DocType_ID) REFERENCES C_DocType;

ALTER TABLE PP_Order ADD CONSTRAINT CDocTypeTarget_PPOrder FOREIGN KEY (C_DocTypeTarget_ID) REFERENCES C_DocType;

ALTER TABLE PP_Order ADD CONSTRAINT User1_PPOrder FOREIGN KEY (User1_ID) REFERENCES C_ElementValue;

ALTER TABLE PP_Order ADD CONSTRAINT User2_PPOrder FOREIGN KEY (User2_ID) REFERENCES C_ElementValue;

ALTER TABLE PP_Order ADD CONSTRAINT COrderLine_PPOrder FOREIGN KEY (C_OrderLine_ID) REFERENCES C_OrderLine;

ALTER TABLE PP_Order ADD CONSTRAINT CProject_PPOrder FOREIGN KEY (C_Project_ID) REFERENCES C_Project;

ALTER TABLE PP_Order ADD CONSTRAINT CUOM_PPOrder FOREIGN KEY (C_UOM_ID) REFERENCES C_UOM;

ALTER TABLE PP_Order ADD CONSTRAINT MProduct_PPOrder FOREIGN KEY (M_Product_ID) REFERENCES M_Product;

ALTER TABLE PP_Order ADD CONSTRAINT MWarehouse_PPOrder FOREIGN KEY (M_Warehouse_ID) REFERENCES M_Warehouse;

ALTER TABLE PP_Order ADD CONSTRAINT PPProductBOM_PPOrder FOREIGN KEY (PP_Product_BOM_ID) REFERENCES PP_Product_BOM;

ALTER TABLE PP_Order ADD CONSTRAINT SResource_PPOrder FOREIGN KEY (S_Resource_ID) REFERENCES S_Resource;

ALTER TABLE PP_Order_BOM ADD CONSTRAINT CUOM_PPOrderBOM FOREIGN KEY (C_UOM_ID) REFERENCES C_UOM;

ALTER TABLE PP_Order_BOM ADD CONSTRAINT MChangeNotice_PPOrderBOM FOREIGN KEY (M_ChangeNotice_ID) REFERENCES M_ChangeNotice;

ALTER TABLE PP_Order_BOM ADD CONSTRAINT MProduct_PPOrderBOM FOREIGN KEY (M_Product_ID) REFERENCES M_Product;

ALTER TABLE PP_Order_BOM ADD CONSTRAINT PPOrder_PPOrderBOM FOREIGN KEY (PP_Order_ID) REFERENCES PP_Order;

ALTER TABLE PP_Order_BOMLine ADD CONSTRAINT CUOM_PPOrderBOMLine FOREIGN KEY (C_UOM_ID) REFERENCES C_UOM;

ALTER TABLE PP_Order_BOMLine ADD CONSTRAINT MChangeNotice_PPOrderBOMLine FOREIGN KEY (M_ChangeNotice_ID) REFERENCES M_ChangeNotice;

ALTER TABLE PP_Order_BOMLine ADD CONSTRAINT MProduct_PPOrderBOMLine FOREIGN KEY (M_Product_ID) REFERENCES M_Product;

ALTER TABLE PP_Order_BOMLine ADD CONSTRAINT MWarehouse_PPOrderBOMLine FOREIGN KEY (M_Warehouse_ID) REFERENCES M_Warehouse;

ALTER TABLE PP_Order_BOMLine ADD CONSTRAINT PPOrder_PPOrderBOMLine FOREIGN KEY (PP_Order_ID) REFERENCES PP_Order;

ALTER TABLE PP_Order_BOMLine ADD CONSTRAINT PPOrderBOM_PPOrderBOMLine FOREIGN KEY (PP_Order_BOM_ID) REFERENCES PP_Order_BOM;

ALTER TABLE PP_Order_BOMLineMA ADD CONSTRAINT PPOrderBOMLine_PPOrderBOMLineM FOREIGN KEY (PP_Order_BOMLine_ID) REFERENCES PP_Order_BOMLine;

ALTER TABLE PP_Order_Cost ADD CONSTRAINT ADWorkflow_PPOrderCost FOREIGN KEY (AD_Workflow_ID) REFERENCES AD_Workflow;

ALTER TABLE PP_Order_Cost ADD CONSTRAINT CAcctSchema_PPOrderCost FOREIGN KEY (C_AcctSchema_ID) REFERENCES C_AcctSchema;

ALTER TABLE PP_Order_Cost ADD CONSTRAINT MCostElement_PPOrderCost FOREIGN KEY (M_CostElement_ID) REFERENCES M_CostElement;

ALTER TABLE PP_Order_Cost ADD CONSTRAINT MCostType_PPOrderCost FOREIGN KEY (M_CostType_ID) REFERENCES M_CostType;

ALTER TABLE PP_Order_Cost ADD CONSTRAINT MProduct_PPOrderCost FOREIGN KEY (M_Product_ID) REFERENCES M_Product;

ALTER TABLE PP_Order_Cost ADD CONSTRAINT PPOrder_PPOrderCost FOREIGN KEY (PP_Order_ID) REFERENCES PP_Order;

ALTER TABLE PP_Order_Node ADD CONSTRAINT ADColumn_PPOrderNode FOREIGN KEY (AD_Column_ID) REFERENCES AD_Column;

ALTER TABLE PP_Order_Node ADD CONSTRAINT EntityT_PPOrderNode FOREIGN KEY (EntityType) REFERENCES AD_EntityType;

ALTER TABLE PP_Order_Node ADD CONSTRAINT ADForm_PPOrderNode FOREIGN KEY (AD_Form_ID) REFERENCES AD_Form;

ALTER TABLE PP_Order_Node ADD CONSTRAINT ADImage_PPOrderNode FOREIGN KEY (AD_Image_ID) REFERENCES AD_Image;

ALTER TABLE PP_Order_Node ADD CONSTRAINT ADProcess_PPOrderNode FOREIGN KEY (AD_Process_ID) REFERENCES AD_Process;

ALTER TABLE PP_Order_Node ADD CONSTRAINT ADTask_PPOrderNode FOREIGN KEY (AD_Task_ID) REFERENCES AD_Task;

ALTER TABLE PP_Order_Node ADD CONSTRAINT ADWFBlock_PPOrderNode FOREIGN KEY (AD_WF_Block_ID) REFERENCES AD_WF_Block;

ALTER TABLE PP_Order_Node ADD CONSTRAINT ADWFNode_PPOrderNode FOREIGN KEY (AD_WF_Node_ID) REFERENCES AD_WF_Node;

ALTER TABLE PP_Order_Node ADD CONSTRAINT ADWFResponsible_PPOrderNode FOREIGN KEY (AD_WF_Responsible_ID) REFERENCES AD_WF_Responsible;

ALTER TABLE PP_Order_Node ADD CONSTRAINT ADWindow_PPOrderNode FOREIGN KEY (AD_Window_ID) REFERENCES AD_Window;

ALTER TABLE PP_Order_Node ADD CONSTRAINT ADWorkflow_PPOrderNode FOREIGN KEY (AD_Workflow_ID) REFERENCES AD_Workflow;

ALTER TABLE PP_Order_Node ADD CONSTRAINT Workflow_PPOrderNode FOREIGN KEY (Workflow_ID) REFERENCES AD_Workflow;

ALTER TABLE PP_Order_Node ADD CONSTRAINT CBPartner_PPOrderNode FOREIGN KEY (C_BPartner_ID) REFERENCES C_BPartner;

ALTER TABLE PP_Order_Node ADD CONSTRAINT PPOrder_PPOrderNode FOREIGN KEY (PP_Order_ID) REFERENCES PP_Order;

ALTER TABLE PP_Order_Node ADD CONSTRAINT PPOrderWorkflow_PPOrderNode FOREIGN KEY (PP_Order_Workflow_ID) REFERENCES PP_Order_Workflow;

ALTER TABLE PP_Order_Node ADD CONSTRAINT SResource_PPOrderNode FOREIGN KEY (S_Resource_ID) REFERENCES S_Resource;

ALTER TABLE PP_Order_Node_Asset ADD CONSTRAINT AAsset_PPOrderNodeAsset FOREIGN KEY (A_Asset_ID) REFERENCES A_Asset;

ALTER TABLE PP_Order_Node_Asset ADD CONSTRAINT PPOrder_PPOrderNodeAsset FOREIGN KEY (PP_Order_ID) REFERENCES PP_Order;

ALTER TABLE PP_Order_Node_Asset ADD CONSTRAINT PPOrderNode_PPOrderNodeAsset FOREIGN KEY (PP_Order_Node_ID) REFERENCES PP_Order_Node;

ALTER TABLE PP_Order_Node_Asset ADD CONSTRAINT PPOrderWorkflow_PPOrderNodeAss FOREIGN KEY (PP_Order_Workflow_ID) REFERENCES PP_Order_Workflow;

ALTER TABLE PP_Order_NodeNext ADD CONSTRAINT EntityT_PPOrderNodeNext FOREIGN KEY (EntityType) REFERENCES AD_EntityType;

ALTER TABLE PP_Order_NodeNext ADD CONSTRAINT ADWFNext_PPOrderNodeNext FOREIGN KEY (AD_WF_Next_ID) REFERENCES AD_WF_Node;

ALTER TABLE PP_Order_NodeNext ADD CONSTRAINT ADWFNode_PPOrderNodeNext FOREIGN KEY (AD_WF_Node_ID) REFERENCES AD_WF_Node;

ALTER TABLE PP_Order_NodeNext ADD CONSTRAINT PPOrder_PPOrderNodeNext FOREIGN KEY (PP_Order_ID) REFERENCES PP_Order;

ALTER TABLE PP_Order_NodeNext ADD CONSTRAINT PPOrderNext_PPOrderNodeNext FOREIGN KEY (PP_Order_Next_ID) REFERENCES PP_Order_Node;

ALTER TABLE PP_Order_NodeNext ADD CONSTRAINT PPOrderNode_PPOrderNodeNext FOREIGN KEY (PP_Order_Node_ID) REFERENCES PP_Order_Node;

ALTER TABLE PP_Order_Node_Product ADD CONSTRAINT MProduct_PPOrderNodeProduct FOREIGN KEY (M_Product_ID) REFERENCES M_Product;

ALTER TABLE PP_Order_Node_Product ADD CONSTRAINT PPOrder_PPOrderNodeProduct FOREIGN KEY (PP_Order_ID) REFERENCES PP_Order;

ALTER TABLE PP_Order_Node_Product ADD CONSTRAINT PPOrderNode_PPOrderNodeProduct FOREIGN KEY (PP_Order_Node_ID) REFERENCES PP_Order_Node;

ALTER TABLE PP_Order_Node_Product ADD CONSTRAINT PPOrderWorkflow_PPOrderNodePro FOREIGN KEY (PP_Order_Workflow_ID) REFERENCES PP_Order_Workflow;

ALTER TABLE PP_Order_Workflow ADD CONSTRAINT EntityT_PPOrderWorkflow FOREIGN KEY (EntityType) REFERENCES AD_EntityType;

ALTER TABLE PP_Order_Workflow ADD CONSTRAINT ADTable_PPOrderWorkflow FOREIGN KEY (AD_Table_ID) REFERENCES AD_Table;

ALTER TABLE PP_Order_Workflow ADD CONSTRAINT ADWFNode_PPOrderWorkflow FOREIGN KEY (AD_WF_Node_ID) REFERENCES AD_WF_Node;

ALTER TABLE PP_Order_Workflow ADD CONSTRAINT ADWFResponsible_PPOrderWorkflo FOREIGN KEY (AD_WF_Responsible_ID) REFERENCES AD_WF_Responsible;

ALTER TABLE PP_Order_Workflow ADD CONSTRAINT ADWorkflow_PPOrderWorkflow FOREIGN KEY (AD_Workflow_ID) REFERENCES AD_Workflow;

ALTER TABLE PP_Order_Workflow ADD CONSTRAINT ADWorkflowProcessor_PPOrderWor FOREIGN KEY (AD_WorkflowProcessor_ID) REFERENCES AD_WorkflowProcessor;

ALTER TABLE PP_Order_Workflow ADD CONSTRAINT PPOrder_PPOrderWorkflow FOREIGN KEY (PP_Order_ID) REFERENCES PP_Order;

ALTER TABLE PP_Order_Workflow ADD CONSTRAINT PPOrderNode_PPOrderWorkflow FOREIGN KEY (PP_Order_Node_ID) REFERENCES PP_Order_Node;

ALTER TABLE PP_Order_Workflow ADD CONSTRAINT SResource_PPOrderWorkflow FOREIGN KEY (S_Resource_ID) REFERENCES S_Resource;

ALTER TABLE PP_Product_BOM ADD CONSTRAINT CUOM_PPProductBOM FOREIGN KEY (C_UOM_ID) REFERENCES C_UOM;

ALTER TABLE PP_Product_BOM ADD CONSTRAINT MChangeNotice_PPProductBOM FOREIGN KEY (M_ChangeNotice_ID) REFERENCES M_ChangeNotice;

ALTER TABLE PP_Product_BOM ADD CONSTRAINT MProduct_PPProductBOM FOREIGN KEY (M_Product_ID) REFERENCES M_Product;

ALTER TABLE PP_Product_BOMLine ADD CONSTRAINT CUOM_PPProductBOMLine FOREIGN KEY (C_UOM_ID) REFERENCES C_UOM;

ALTER TABLE PP_Product_BOMLine ADD CONSTRAINT MChangeNotice_PPProductBOMLine FOREIGN KEY (M_ChangeNotice_ID) REFERENCES M_ChangeNotice;

ALTER TABLE PP_Product_BOMLine ADD CONSTRAINT MProduct_PPProductBOMLine FOREIGN KEY (M_Product_ID) REFERENCES M_Product;

ALTER TABLE PP_Product_BOMLine ADD CONSTRAINT PPProductBOM_PPProductBOMLine FOREIGN KEY (PP_Product_BOM_ID) REFERENCES PP_Product_BOM;

ALTER TABLE PP_Product_Planning ADD CONSTRAINT Planner_PPProductPlanning FOREIGN KEY (Planner_ID) REFERENCES AD_User;

ALTER TABLE PP_Product_Planning ADD CONSTRAINT ADWorkflow_PPProductPlanning FOREIGN KEY (AD_Workflow_ID) REFERENCES AD_Workflow;

ALTER TABLE PP_Product_Planning ADD CONSTRAINT DDNetworkDistribution_PPProduc FOREIGN KEY (DD_NetworkDistribution_ID) REFERENCES DD_NetworkDistribution;

ALTER TABLE PP_Product_Planning ADD CONSTRAINT MProduct_PPProductPlanning FOREIGN KEY (M_Product_ID) REFERENCES M_Product;

ALTER TABLE PP_Product_Planning ADD CONSTRAINT MWarehouse_PPProductPlanning FOREIGN KEY (M_Warehouse_ID) REFERENCES M_Warehouse;

ALTER TABLE PP_Product_Planning ADD CONSTRAINT PPProductBOM_PPProductPlanning FOREIGN KEY (PP_Product_BOM_ID) REFERENCES PP_Product_BOM;

ALTER TABLE PP_Product_Planning ADD CONSTRAINT SResource_PPProductPlanning FOREIGN KEY (S_Resource_ID) REFERENCES S_Resource;

ALTER TABLE PP_WF_Node_Asset ADD CONSTRAINT AAsset_PPWFNodeAsset FOREIGN KEY (A_Asset_ID) REFERENCES A_Asset;

ALTER TABLE PP_WF_Node_Asset ADD CONSTRAINT ADWFNode_PPWFNodeAsset FOREIGN KEY (AD_WF_Node_ID) REFERENCES AD_WF_Node;

ALTER TABLE PP_WF_Node_Product ADD CONSTRAINT EntityT_PPWFNodeProduct FOREIGN KEY (EntityType) REFERENCES AD_EntityType;

ALTER TABLE PP_WF_Node_Product ADD CONSTRAINT ADWFNode_PPWFNodeProduct FOREIGN KEY (AD_WF_Node_ID) REFERENCES AD_WF_Node;

ALTER TABLE PP_WF_Node_Product ADD CONSTRAINT MProduct_PPWFNodeProduct FOREIGN KEY (M_Product_ID) REFERENCES M_Product;

ALTER TABLE QM_Specification ADD CONSTRAINT ADWorkflow_QMSpecification FOREIGN KEY (AD_Workflow_ID) REFERENCES AD_Workflow;

ALTER TABLE QM_Specification ADD CONSTRAINT MAttributeSet_QMSpecification FOREIGN KEY (M_AttributeSet_ID) REFERENCES M_AttributeSet;

ALTER TABLE QM_Specification ADD CONSTRAINT MProduct_QMSpecification FOREIGN KEY (M_Product_ID) REFERENCES M_Product;

ALTER TABLE QM_Specification ADD CONSTRAINT PPProductBOM_QMSpecification FOREIGN KEY (PP_Product_BOM_ID) REFERENCES PP_Product_BOM;

ALTER TABLE QM_SpecificationLine ADD CONSTRAINT MAttribute_QMSpecificationLine FOREIGN KEY (M_Attribute_ID) REFERENCES M_Attribute;

ALTER TABLE QM_SpecificationLine ADD CONSTRAINT QMSpecification_QMSpecificatio FOREIGN KEY (QM_Specification_ID) REFERENCES QM_Specification;