feature/agente-aduanal-no-se-ve
This commit is contained in:
@@ -3,7 +3,11 @@
|
||||
import { Input } from '$lib/components/ui/input';
|
||||
import * as Dialog from '$lib/components/ui/dialog';
|
||||
import { Search, Loader2, Award } from 'lucide-svelte';
|
||||
import { customsBrokersApi, type CustomsBroker } from '$lib/api/dashboard/a76/customs-brokers';
|
||||
import {
|
||||
customsBrokersApi,
|
||||
displayCustomsBrokerLabel,
|
||||
type CustomsBroker
|
||||
} from '$lib/api/dashboard/a76/customs-brokers';
|
||||
import { companyStore } from '$lib/stores/company.svelte';
|
||||
|
||||
let {
|
||||
@@ -118,7 +122,7 @@
|
||||
<td class="p-3">
|
||||
<div class="flex items-center gap-2">
|
||||
<Award class="h-3 w-3 text-muted-foreground" />
|
||||
{item.name || item.broker_key}
|
||||
{displayCustomsBrokerLabel(item)}
|
||||
</div>
|
||||
</td>
|
||||
<td class="p-3 text-xs text-muted-foreground">
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
import ManifestSelectorModal from './ManifestSelectorModal.svelte';
|
||||
import type { Invoice } from '$lib/api/dashboard/a76/invoices';
|
||||
import type { InvoiceType } from '$lib/api/dashboard/reference_data/invoice_types';
|
||||
import type { CustomsBroker } from '$lib/api/dashboard/a76/customs-brokers';
|
||||
import { displayCustomsBrokerLabel, type CustomsBroker } from '$lib/api/dashboard/a76/customs-brokers';
|
||||
import type { ClientProvider } from '$lib/api/dashboard/a76/clients-providers';
|
||||
|
||||
interface CodePedimentoRegimen {
|
||||
@@ -617,16 +617,20 @@
|
||||
class={cn('h-7 max-w-[300px] min-w-[150px] text-xs', hl('customs_broker_id'))}
|
||||
>
|
||||
<span class="truncate">
|
||||
{formData.customs_broker_id
|
||||
? customsBrokers.find((cb) => cb.id === formData.customs_broker_id)?.name ||
|
||||
m.invoice_edit_general_select_broker_placeholder()
|
||||
: m.invoice_edit_general_select_broker_placeholder()}
|
||||
{#if formData.customs_broker_id}
|
||||
{@const selMex = customsBrokers.find((cb) => cb.id === formData.customs_broker_id)}
|
||||
{selMex
|
||||
? displayCustomsBrokerLabel(selMex)
|
||||
: `#${formData.customs_broker_id}`}
|
||||
{:else}
|
||||
{m.invoice_edit_general_select_broker_placeholder()}
|
||||
{/if}
|
||||
</span>
|
||||
</Select.Trigger>
|
||||
<Select.Content class="max-h-[300px]">
|
||||
{#each customsBrokers as broker}
|
||||
<Select.Item value={broker.id.toString()}>
|
||||
{broker.name}
|
||||
{displayCustomsBrokerLabel(broker)}
|
||||
</Select.Item>
|
||||
{/each}
|
||||
</Select.Content>
|
||||
@@ -644,16 +648,20 @@
|
||||
>
|
||||
<Select.Trigger id="customs_broker_us_id" class={cn(' h-7 min-w-[150px] text-xs', hl('customs_broker_us_id'))}>
|
||||
<span class="truncate">
|
||||
{formData.customs_broker_us_id
|
||||
? customsBrokers.find((cb) => cb.id === formData.customs_broker_us_id)?.name ||
|
||||
m.invoice_edit_general_select_broker_placeholder()
|
||||
: m.invoice_edit_general_select_broker_placeholder()}
|
||||
{#if formData.customs_broker_us_id}
|
||||
{@const selUs = customsBrokers.find((cb) => cb.id === formData.customs_broker_us_id)}
|
||||
{selUs
|
||||
? displayCustomsBrokerLabel(selUs)
|
||||
: `#${formData.customs_broker_us_id}`}
|
||||
{:else}
|
||||
{m.invoice_edit_general_select_broker_placeholder()}
|
||||
{/if}
|
||||
</span>
|
||||
</Select.Trigger>
|
||||
<Select.Content class="max-h-[300px]">
|
||||
{#each customsBrokers as broker}
|
||||
<Select.Item value={broker.id.toString()}>
|
||||
{broker.name}
|
||||
{displayCustomsBrokerLabel(broker)}
|
||||
</Select.Item>
|
||||
{/each}
|
||||
</Select.Content>
|
||||
|
||||
Reference in New Issue
Block a user