Se corrigio el problema de los logos

This commit is contained in:
2026-01-22 08:10:57 -06:00
parent 7658c19661
commit d4e4e1f7f8
8 changed files with 227 additions and 123 deletions

View File

@@ -61,9 +61,9 @@ class Company(Base, TimestampMixin):
# Configuración básica
logo: Mapped[Optional[str]] = mapped_column(String(255))
has_express_line: Mapped[Optional[bool]] = mapped_column(Boolean, default=False)
has_express_line: Mapped[Optional[str]] = mapped_column(String(2), default="N")
order_format_type: Mapped[Optional[str]] = mapped_column(String(19))
is_service_company: Mapped[Optional[bool]] = mapped_column(Boolean, default=False)
is_service_company: Mapped[Optional[str]] = mapped_column(String(2), default="N")
client_name: Mapped[Optional[str]] = mapped_column(String(300))
subassembly_mode: Mapped[Optional[str]] = mapped_column(String(7))
@@ -78,6 +78,7 @@ class Company(Base, TimestampMixin):
parts_replacement: Mapped[Optional[int]] = mapped_column(SmallInteger)
activate_facmexame: Mapped[Optional[int]] = mapped_column(SmallInteger)
part_reference: Mapped[Optional[int]] = mapped_column(SmallInteger)
part_reference: Mapped[Optional[int]] = mapped_column(SmallInteger)
international_firm: Mapped[Optional[int]] = mapped_column(SmallInteger)
# Configuraciones simples

View File

@@ -312,68 +312,14 @@ async def update_company(
return CompanyResponseDTO.model_validate(updated_company)
@router.post(
"/{company_id}/upload-logo",
response_model=dict,
summary="Upload company logo",
)
async def upload_company_logo(
company_id: int,
file: UploadFile = File(...),
db: Session = Depends(get_core_db),
current_user: dict = Depends(get_current_user),
):
"""Upload logo for a company"""
tenant_id = current_user.get("tenant_id")
if not tenant_id:
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
detail="Tenant ID not found in user data",
)
# 1. Verify company exists
company = CompanyService.get_by_id(db, company_id, tenant_id, 0)
if not company:
raise HTTPException(
status_code=status.HTTP_404_NOT_FOUND,
detail="Company not found",
)
# 2. Define upload path
# Use a persistent path: 'app_data/logos/{company_id}'
upload_dir = Path(f"app_data/logos/{company_id}")
upload_dir.mkdir(parents=True, exist_ok=True)
# 3. Save file
# Preserve original filename
filename = file.filename or "logo.png"
file_path = upload_dir / filename
try:
# Check if file exists and remove it to avoid accumulation if needed,
# or just overwrite (shutil.copyfileobj overwrites)
with open(file_path, "wb") as buffer:
shutil.copyfileobj(file.file, buffer)
except Exception as e:
raise HTTPException(
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
detail=f"Could not save file: {e}",
)
# 4. Returns the absolute path keys
abs_path = str(file_path.absolute())
return {"path": abs_path}
@router.get(
"/{company_id}/logo/image",
summary="Get company logo image",
)
@router.get(
"/{company_id}/logo/image",
summary="Get company logo image",
)
async def get_company_logo_image(
company_id: int,
db: Session = Depends(get_core_db),

View File

@@ -112,7 +112,14 @@ class CompanyService:
# Update only provided fields
update_data = company_data.model_dump(exclude_unset=True)
boolean_fields_str = ["has_express_line", "is_service_company"]
for field, value in update_data.items():
if field in boolean_fields_str:
# Convert boolean to "S"/"N"
if isinstance(value, bool):
value = "S" if value else "N"
setattr(company, field, value)
try:
@@ -177,6 +184,11 @@ class CompanyService:
# 1. Preparar datos
obj_data = data.model_dump(exclude_unset=True)
boolean_fields_str = ["has_express_line", "is_service_company"]
for field in boolean_fields_str:
if field in obj_data and isinstance(obj_data[field], bool):
obj_data[field] = "S" if obj_data[field] else "N"
# 2. Crear objeto SQLAlchemy
db_obj = Company(**obj_data, tenant_id=tenant_id)

View File

@@ -183,7 +183,7 @@ export interface UnitOfMeasureGeneralUpdate {
}
export interface UnitOfMeasureGeneralListResponse {
items: UnitOfMeasureGeneral[];
items: UnitOfMeasureGeneral[];
total: number;
page: number;
page_size: number;

View File

@@ -10,10 +10,10 @@
const sidebar = useSidebar();
// Derivar la URL del logo
// Derivar la URL del logo usando el endpoint específico
let activeCompanyLogoUrl = $derived(
companyStore.activeCompany?.logo
? getBackendAssetUrl(companyStore.activeCompany.logo)
? getBackendAssetUrl(`v1/a76/company/${companyStore.activeCompany.id}/logo/image?t=${new Date().getTime()}`)
: null
);
@@ -89,7 +89,7 @@
<div class="flex size-6 items-center justify-center rounded-md border overflow-hidden">
{#if company.logo}
<img
src={getBackendAssetUrl(company.logo)}
src={getBackendAssetUrl(`v1/a76/company/${company.id}/logo/image`)}
alt={company.name}
class="size-full rounded object-cover"
/>

View File

@@ -144,6 +144,30 @@ class CompanyStore {
}
}
/**
* Actualiza los datos de une empresa en el store localmente
* Útil para reflejar cambios inmediatos (ej: cambio de logo) sin recargar
*/
updateCompany(id: number, data: Partial<Company>) {
// 1. Actualizar en la lista
const index = this._companies.findIndex(c => c.id === id);
if (index !== -1) {
this._companies[index] = { ...this._companies[index], ...data };
// 2. Si es la activa, actualizar también
if (this._activeCompany?.id === id) {
this._activeCompany = { ...this._activeCompany, ...data };
// Actualizar persistencia si es necesario
if (typeof window !== 'undefined') {
// Disparar evento para notificar cambios a componentes que no usan el store reactivo directo (si los hay)
window.dispatchEvent(new CustomEvent('companyChanged', {
detail: { companyId: id }
}));
}
}
}
}
/**
* Restaura la compañía activa desde localStorage
*/

View File

@@ -14,6 +14,7 @@
uploadCompanyLogo,
type Company
} from '$lib/api/dashboard/a76/general_catalogs/company';
import { companyStore } from '$lib/stores/company.svelte';
import { getBackendAssetUrl } from '$lib/utils';
import { ArrowLeft, LoaderCircle, Save, Upload, X, Building2, FileText, User, Settings } from 'lucide-svelte';
@@ -25,15 +26,18 @@
let loading = $state(false);
let uploading = $state(false);
let error = $state<string | null>(null);
let activeTab = $state('general');
let logoFile = $state<File | null>(null);
let logoPreview = $state<string | null>(null);
let currentLogo = $state<string | null>(null);
let uploadingLogo = $state(false);
let activeTab = $state('general');
// URL completa del logo derivada
let currentLogoUrl = $derived(
logoPreview || getBackendAssetUrl(currentLogo) || ''
logoPreview
? logoPreview
: (currentLogo ? getBackendAssetUrl(`v1/a76/company/${id}/logo/image?t=${new Date().getTime()}`) : '')
);
// 2. Estado Inicial (Reset)
@@ -104,7 +108,15 @@
is_service_company: item.is_service_company || false,
order_format_type: item.order_format_type || '',
ctpat_svi: item.ctpat_svi || '',
trusted_exporter_number: item.trusted_exporter_number || ''
trusted_exporter_number: item.trusted_exporter_number || '',
logo: item.logo || '',
previous_code: item.previous_code || 0,
client_name: item.client_name || '',
subassembly_mode: item.subassembly_mode || '',
broker_company: item.broker_company || '',
inter_db_name: item.inter_db_name || '',
prevalidator_key: item.prevalidator_key || '',
seventh_amendment: item.seventh_amendment || false
};
// Guardar la URL del logo actual si existe
if (item.logo) {
@@ -118,6 +130,9 @@
}
}
const clean = (value: any) => (typeof value === 'string' ? value.trim() || null : value);
function handleLogoChange(event: Event) {
const target = event.target as HTMLInputElement;
const file = target.files?.[0];
@@ -170,6 +185,9 @@
currentLogo = response.data.logo_path;
logoFile = null;
logoPreview = null;
// Actualizar el store reactivamente
companyStore.updateCompany(companyId, { logo: response.data.logo_path });
}
} catch (e: any) {
error = `Error al subir el logo: ${e.message}`;
@@ -178,33 +196,6 @@
}
}
const clean = (value: any) => (typeof value === 'string' ? value.trim() || null : value);
async function handleFileSelect(e: Event) {
const input = e.target as HTMLInputElement;
if (!input.files || input.files.length === 0) return;
const file = input.files[0];
if (!isEdit) {
alert("Primero debes guardar la empresa antes de subir un logo.");
return;
}
uploading = true;
try {
const res = await uploadCompanyLogo(Number(id), file);
if (res.data) {
formData.logo = res.data.path;
} else if (res.error) {
alert("Error al subir imagen: " + res.error);
}
} catch (err) {
alert("Error al intentar subir la imagen");
} finally {
uploading = false;
}
}
async function handleSubmit() {
error = null;
loading = true;
@@ -222,6 +213,7 @@
main_activity: clean(formData.main_activity),
program: clean(formData.program),
program_number: clean(formData.program_number),
prosec: Number(formData.prosec) || 0,
prosec_authorization: clean(formData.prosec_authorization),
responsible_name: clean(formData.responsible_name),
responsible_last_name: clean(formData.responsible_last_name),
@@ -239,7 +231,10 @@
broker_company: clean(formData.broker_company),
inter_db_name: clean(formData.inter_db_name),
prevalidator_key: clean(formData.prevalidator_key),
seventh_amendment: formData.seventh_amendment
seventh_amendment: formData.seventh_amendment,
// Ensure optional booleans are passed correctly or default to false/null if needed
has_express_line: formData.has_express_line,
is_service_company: formData.is_service_company
};
const response = isEdit
@@ -285,6 +280,8 @@
<Tabs.Root bind:value={activeTab} class="w-full">
<div class="min-h-[400px]">
<Tabs.Content value="general" class="space-y-4 pt-4">
<!-- Logo Upload Section -->
<div class="grid gap-4 p-4 border rounded-lg bg-muted/30">
<Label>Logo de la Empresa</Label>
@@ -344,36 +341,9 @@
<Label for="main_activity">Actividad Principal</Label>
<Input id="main_activity" bind:value={formData.main_activity} />
</div>
<div class="grid grid-cols-1 gap-4 md:grid-cols-2">
<div class="grid gap-2">
<Label for="logo">Ruta del Logo</Label>
<div class="flex items-center gap-2">
<Input id="logo" bind:value={formData.logo} placeholder="/path/to/logo.png" />
{#if isEdit}
<div class="relative">
<Button variant="outline" size="icon" disabled={uploading}>
{#if uploading}
<LoaderCircle class="h-4 w-4 animate-spin" />
{:else}
<Upload class="h-4 w-4" />
{/if}
</Button>
<input
type="file"
accept="image/*"
class="absolute inset-0 opacity-0 cursor-pointer"
onchange={handleFileSelect}
disabled={uploading}
/>
</div>
{/if}
</div>
<p class="text-[0.8rem] text-muted-foreground">Sube una imagen para obtener su ruta local.</p>
</div>
<div class="grid gap-2">
<Label for="client_name">Nombre Cliente (Maquila)</Label>
<Input id="client_name" bind:value={formData.client_name} />
</div>
<div class="grid gap-2">
<Label for="client_name">Nombre Cliente (Maquila)</Label>
<Input id="client_name" bind:value={formData.client_name} />
</div>
</Tabs.Content>

151
schema_dump.txt Normal file
View File

@@ -0,0 +1,151 @@
Table "a76.company"
Column | Type | Collation | Nullable | Default
------------------------------+-----------------------------+-----------+----------+-----------------------------------------
id | integer | | not null | nextval('a76.company_id_seq'::regclass)
tenant_id | integer | | not null |
name | character varying(256) | | |
rfc | character varying(30) | | |
curp | character varying(19) | | |
main_activity | character varying(80) | | |
program | character varying(7) | | |
program_number | character varying(40) | | |
prosec | smallint | | |
prosec_authorization | character varying(20) | | |
sector1 | character varying(150) | | |
sector2 | character varying(150) | | |
sector3 | character varying(5) | | |
manufacturer_id | character varying(25) | | |
broker_company | character varying(6) | | |
responsible | character varying(80) | | |
responsible_name | character varying(20) | | |
responsible_last_name | character varying(20) | | |
responsible_mother_last_name | character varying(20) | | |
responsible_rfc | character varying(30) | | |
position | character varying(30) | | |
logo | character varying(255) | | |
has_express_line | character varying(2) | | |
order_format_type | character varying(19) | | |
is_service_company | boolean | | |
client_name | character varying(300) | | |
subassembly_mode | character varying(7) | | |
previous_code | smallint | | |
active_labels | smallint | | |
active_fractions | smallint | | |
activate_caat | smallint | | |
trans_interface | smallint | | |
american_costs | smallint | | |
scaf_readonly | smallint | | |
parts_replacement | smallint | | |
activate_facmexame | smallint | | |
part_reference | smallint | | |
international_firm | smallint | | |
ftp_key | character varying(10) | | |
sifra_path | character varying(255) | | |
version_type | character varying(20) | | |
sql_language | character varying(19) | | |
balance_operation_mode | character varying(50) | | |
inter_db_name | character varying(100) | | |
created_at | timestamp without time zone | | not null | now()
updated_at | timestamp without time zone | | not null | now()
deleted_at | timestamp without time zone | | |
Indexes:
"company_pkey" PRIMARY KEY, btree (id)
"ix_a76_company_tenant_id" btree (tenant_id)
Foreign-key constraints:
"company_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES core.tenants(id)
Referenced by:
TABLE "a76."CompanyVU"" CONSTRAINT "CompanyVU_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id) ON DELETE CASCADE
TABLE "a76.classes" CONSTRAINT "classes_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.classification_concepts" CONSTRAINT "classification_concepts_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.clients_and_providers_address" CONSTRAINT "clients_and_providers_address_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.clients_and_providers" CONSTRAINT "clients_and_providers_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.clients_and_providers_programs" CONSTRAINT "clients_and_providers_programs_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.company_address" CONSTRAINT "company_address_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id) ON DELETE CASCADE
TABLE "a76.company_certification" CONSTRAINT "company_certification_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id) ON DELETE CASCADE
TABLE "a76.company_cfdi" CONSTRAINT "company_cfdi_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id) ON DELETE CASCADE
TABLE "a76.company_digital_certificate" CONSTRAINT "company_digital_certificate_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id) ON DELETE CASCADE
TABLE "a76.company_electronic_agent" CONSTRAINT "company_electronic_agent_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id) ON DELETE CASCADE
TABLE "a76.company_prevalidator" CONSTRAINT "company_prevalidator_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id) ON DELETE CASCADE
TABLE "core.company_roles" CONSTRAINT "company_roles_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.country_rule_oct" CONSTRAINT "country_rule_oct_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.ctm_receipts" CONSTRAINT "ctm_receipts_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.customs_brokers" CONSTRAINT "customs_brokers_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.customs_brokers_personnel" CONSTRAINT "customs_brokers_personnel_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.customs_brokers_vu" CONSTRAINT "customs_brokers_vu_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.depreciation_catalog" CONSTRAINT "depreciation_catalog_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.document_types_digitization" CONSTRAINT "document_types_digitization_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.doda_american_pedimentos" CONSTRAINT "doda_american_pedimentos_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.doda" CONSTRAINT "doda_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.doda_container_seals" CONSTRAINT "doda_container_seals_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.doda_containers" CONSTRAINT "doda_containers_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.doda_pedimentos" CONSTRAINT "doda_pedimentos_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.driver" CONSTRAINT "driver_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.electronic_notices" CONSTRAINT "electronic_notices_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.equivalencies" CONSTRAINT "equivalencies_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.equivalency_items" CONSTRAINT "equivalency_items_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.error_catalogs" CONSTRAINT "error_catalogs_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.error_classifications" CONSTRAINT "error_classifications_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.exchange_rate" CONSTRAINT "exchange_rate_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a24.fa_classes" CONSTRAINT "fa_classes_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a24.fa_item_lines" CONSTRAINT "fa_item_lines_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a24.fa_partes" CONSTRAINT "fa_partes_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.fda_catalog" CONSTRAINT "fda_catalog_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.fraction_rule_octave" CONSTRAINT "fraction_rule_octave_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.identifier_details" CONSTRAINT "identifier_details_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.identifiers" CONSTRAINT "identifiers_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.inpc" CONSTRAINT "inpc_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a24.inv_partes" CONSTRAINT "inv_partes_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.invoice_collections" CONSTRAINT "invoice_collections_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.invoice_compliance_mx" CONSTRAINT "invoice_compliance_mx_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.invoice_financials" CONSTRAINT "invoice_financials_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.invoice_header" CONSTRAINT "invoice_header_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.invoice_logistics" CONSTRAINT "invoice_logistics_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.invoice_sales_details" CONSTRAINT "invoice_sales_details_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.item_line_series" CONSTRAINT "item_line_series_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.item_lines" CONSTRAINT "item_lines_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.items" CONSTRAINT "items_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.legends" CONSTRAINT "legends_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.multi_currency_types" CONSTRAINT "multi_currency_types_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.packages" CONSTRAINT "packages_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.packing_lists" CONSTRAINT "packing_lists_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.parts" CONSTRAINT "parts_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.pedimento_config_additional" CONSTRAINT "pedimento_config_additional_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.pedimento_config_calculations" CONSTRAINT "pedimento_config_calculations_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.pedimento_config_parameters" CONSTRAINT "pedimento_config_parameters_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.pedimento_config_surcharges" CONSTRAINT "pedimento_config_surcharges_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.pedimento_config_update_rectification" CONSTRAINT "pedimento_config_update_rectification_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.pedimento_config_updates" CONSTRAINT "pedimento_config_updates_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.pedimento_containers" CONSTRAINT "pedimento_containers_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.pedimento_contributions" CONSTRAINT "pedimento_contributions_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.pedimento_customs_offices" CONSTRAINT "pedimento_customs_offices_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.pedimento_dates" CONSTRAINT "pedimento_dates_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.pedimento_decrementables" CONSTRAINT "pedimento_decrementables_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.pedimento_guides" CONSTRAINT "pedimento_guides_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.pedimento_incrementables" CONSTRAINT "pedimento_incrementables_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.pedimento_indexes" CONSTRAINT "pedimento_indexes_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.pedimento_packages" CONSTRAINT "pedimento_packages_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.pedimento_payments" CONSTRAINT "pedimento_payments_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.pedimento_rectification_destination" CONSTRAINT "pedimento_rectification_destination_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.pedimento_rectification_origin" CONSTRAINT "pedimento_rectification_origin_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.pedimento_seals" CONSTRAINT "pedimento_seals_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.pedimento_transport_carriers" CONSTRAINT "pedimento_transport_carriers_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.pedimento_transport_means" CONSTRAINT "pedimento_transport_means_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.pedimento_validation" CONSTRAINT "pedimento_validation_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.pedimentos" CONSTRAINT "pedimentos_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.permission_rule_oct" CONSTRAINT "permission_rule_oct_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.ports" CONSTRAINT "ports_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.prevalidators" CONSTRAINT "prevalidators_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "core.role_permissions" CONSTRAINT "role_permissions_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.seal" CONSTRAINT "seal_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.signatures" CONSTRAINT "signatures_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.subassembly_entries" CONSTRAINT "subassembly_entries_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.trailer" CONSTRAINT "trailer_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.transporter" CONSTRAINT "transporter_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.unit_conversions" CONSTRAINT "unit_conversions_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.units_of_measure" CONSTRAINT "units_of_measure_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.units_of_measure_general" CONSTRAINT "units_of_measure_general_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "core.user_company_permissions" CONSTRAINT "user_company_permissions_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "core.user_company_roles" CONSTRAINT "user_company_roles_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "core.user_tenants" CONSTRAINT "user_tenants_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)
TABLE "a76.vehicle" CONSTRAINT "vehicle_company_id_fkey" FOREIGN KEY (company_id) REFERENCES a76.company(id)