@open-mercato/core 0.5.1-develop.2949.009dcdd2d5 → 0.5.1-develop.2954.610bab2d08
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/helpers/integration/salesUi.js +25 -23
- package/dist/helpers/integration/salesUi.js.map +2 -2
- package/dist/modules/api_docs/frontend/docs/api/Explorer.js +24 -24
- package/dist/modules/api_docs/frontend/docs/api/Explorer.js.map +2 -2
- package/dist/modules/attachments/components/AttachmentPartitionSettings.js +15 -7
- package/dist/modules/attachments/components/AttachmentPartitionSettings.js.map +2 -2
- package/dist/modules/attachments/fields/attachment.js +4 -6
- package/dist/modules/attachments/fields/attachment.js.map +2 -2
- package/dist/modules/auth/api/users/route.js +63 -23
- package/dist/modules/auth/api/users/route.js.map +2 -2
- package/dist/modules/auth/backend/users/create/page.js +26 -26
- package/dist/modules/auth/backend/users/create/page.js.map +2 -2
- package/dist/modules/business_rules/components/ActionRow.js +36 -25
- package/dist/modules/business_rules/components/ActionRow.js.map +2 -2
- package/dist/modules/business_rules/components/ConditionGroup.js +14 -5
- package/dist/modules/business_rules/components/ConditionGroup.js.map +2 -2
- package/dist/modules/business_rules/components/ConditionRow.js +19 -10
- package/dist/modules/business_rules/components/ConditionRow.js.map +2 -2
- package/dist/modules/business_rules/components/RuleSetMembers.js +16 -10
- package/dist/modules/business_rules/components/RuleSetMembers.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/[id]/page.js +30 -34
- package/dist/modules/catalog/backend/catalog/products/[id]/page.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/create/page.js +220 -223
- package/dist/modules/catalog/backend/catalog/products/create/page.js.map +2 -2
- package/dist/modules/catalog/components/PriceKindSettings.js +20 -19
- package/dist/modules/catalog/components/PriceKindSettings.js.map +2 -2
- package/dist/modules/catalog/components/products/ProductUomSection.js +42 -37
- package/dist/modules/catalog/components/products/ProductUomSection.js.map +2 -2
- package/dist/modules/catalog/components/products/VariantBuilder.js +22 -18
- package/dist/modules/catalog/components/products/VariantBuilder.js.map +2 -2
- package/dist/modules/customer_accounts/backend/customer_accounts/users/[id]/page.js +18 -26
- package/dist/modules/customer_accounts/backend/customer_accounts/users/[id]/page.js.map +2 -2
- package/dist/modules/customer_accounts/backend/customer_accounts/users/page.js +4 -6
- package/dist/modules/customer_accounts/backend/customer_accounts/users/page.js.map +2 -2
- package/dist/modules/customer_accounts/widgets/injection/account-status/widget.client.js +5 -4
- package/dist/modules/customer_accounts/widgets/injection/account-status/widget.client.js.map +2 -2
- package/dist/modules/customers/backend/config/customers/pipeline-stages/page.js +19 -7
- package/dist/modules/customers/backend/config/customers/pipeline-stages/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/pipeline/page.js +24 -21
- package/dist/modules/customers/backend/customers/deals/pipeline/page.js.map +2 -2
- package/dist/modules/customers/components/AddressEditor.js +24 -7
- package/dist/modules/customers/components/AddressEditor.js.map +2 -2
- package/dist/modules/customers/components/AddressFormatSettings.js +35 -25
- package/dist/modules/customers/components/AddressFormatSettings.js.map +2 -2
- package/dist/modules/customers/components/detail/ActivityForm.js +20 -12
- package/dist/modules/customers/components/detail/ActivityForm.js.map +2 -2
- package/dist/modules/customers/components/detail/AnnualRevenueField.js +2 -2
- package/dist/modules/customers/components/detail/AnnualRevenueField.js.map +2 -2
- package/dist/modules/customers/components/detail/DealForm.js +19 -14
- package/dist/modules/customers/components/detail/DealForm.js.map +2 -2
- package/dist/modules/customers/components/formConfig.js +16 -12
- package/dist/modules/customers/components/formConfig.js.map +2 -2
- package/dist/modules/customers/widgets/dashboard/customer-todos/widget.client.js +3 -2
- package/dist/modules/customers/widgets/dashboard/customer-todos/widget.client.js.map +2 -2
- package/dist/modules/customers/widgets/dashboard/new-customers/widget.client.js +18 -10
- package/dist/modules/customers/widgets/dashboard/new-customers/widget.client.js.map +2 -2
- package/dist/modules/customers/widgets/dashboard/new-deals/widget.client.js +3 -2
- package/dist/modules/customers/widgets/dashboard/new-deals/widget.client.js.map +2 -2
- package/dist/modules/customers/widgets/dashboard/next-interactions/widget.client.js +3 -2
- package/dist/modules/customers/widgets/dashboard/next-interactions/widget.client.js.map +2 -2
- package/dist/modules/dashboards/components/WidgetVisibilityEditor.js +27 -28
- package/dist/modules/dashboards/components/WidgetVisibilityEditor.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.js +14 -6
- package/dist/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.js +14 -6
- package/dist/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.js +3 -2
- package/dist/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/top-customers/widget.client.js +3 -2
- package/dist/modules/dashboards/widgets/dashboard/top-customers/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/top-products/widget.client.js +17 -8
- package/dist/modules/dashboards/widgets/dashboard/top-products/widget.client.js.map +2 -2
- package/dist/modules/data_sync/backend/data-sync/page.js +40 -23
- package/dist/modules/data_sync/backend/data-sync/page.js.map +2 -2
- package/dist/modules/data_sync/components/IntegrationScheduleTab.js +15 -6
- package/dist/modules/data_sync/components/IntegrationScheduleTab.js.map +2 -2
- package/dist/modules/dictionaries/components/AppearanceSelector.js +4 -4
- package/dist/modules/dictionaries/components/AppearanceSelector.js.map +2 -2
- package/dist/modules/dictionaries/components/DictionaryEntriesEditor.js +4 -5
- package/dist/modules/dictionaries/components/DictionaryEntriesEditor.js.map +2 -2
- package/dist/modules/dictionaries/components/DictionaryEntrySelect.js +22 -14
- package/dist/modules/dictionaries/components/DictionaryEntrySelect.js.map +2 -2
- package/dist/modules/dictionaries/fields/dictionary.js +18 -13
- package/dist/modules/dictionaries/fields/dictionary.js.map +2 -2
- package/dist/modules/entities/components/EncryptionManager.js +23 -19
- package/dist/modules/entities/components/EncryptionManager.js.map +2 -2
- package/dist/modules/feature_toggles/components/formConfig.js +17 -9
- package/dist/modules/feature_toggles/components/formConfig.js.map +2 -2
- package/dist/modules/feature_toggles/components/overrideFormConfig.js +17 -9
- package/dist/modules/feature_toggles/components/overrideFormConfig.js.map +2 -2
- package/dist/modules/inbox_ops/backend/inbox-ops/settings/page.js +15 -8
- package/dist/modules/inbox_ops/backend/inbox-ops/settings/page.js.map +2 -2
- package/dist/modules/inbox_ops/components/proposals/EditActionDialog.js +37 -22
- package/dist/modules/inbox_ops/components/proposals/EditActionDialog.js.map +2 -2
- package/dist/modules/integrations/backend/integrations/[id]/page.js +22 -17
- package/dist/modules/integrations/backend/integrations/[id]/page.js.map +2 -2
- package/dist/modules/integrations/backend/integrations/bundle/[id]/page.js +12 -6
- package/dist/modules/integrations/backend/integrations/bundle/[id]/page.js.map +2 -2
- package/dist/modules/planner/components/AvailabilityRulesEditor.js +19 -12
- package/dist/modules/planner/components/AvailabilityRulesEditor.js.map +2 -2
- package/dist/modules/resources/components/ResourceCrudForm.js +15 -10
- package/dist/modules/resources/components/ResourceCrudForm.js.map +3 -3
- package/dist/modules/sales/backend/sales/documents/[id]/page.js +15 -18
- package/dist/modules/sales/backend/sales/documents/[id]/page.js.map +2 -2
- package/dist/modules/sales/components/ProviderFieldInput.js +23 -20
- package/dist/modules/sales/components/ProviderFieldInput.js.map +2 -2
- package/dist/modules/sales/components/ShippingMethodsSettings.js +25 -17
- package/dist/modules/sales/components/ShippingMethodsSettings.js.map +3 -3
- package/dist/modules/sales/components/channels/ChannelOfferForm.js +35 -42
- package/dist/modules/sales/components/channels/ChannelOfferForm.js.map +2 -2
- package/dist/modules/sales/components/documents/AddressesSection.js +87 -90
- package/dist/modules/sales/components/documents/AddressesSection.js.map +2 -2
- package/dist/modules/sales/components/documents/AdjustmentDialog.js +17 -6
- package/dist/modules/sales/components/documents/AdjustmentDialog.js.map +3 -3
- package/dist/modules/sales/components/documents/LineItemDialog.js +42 -25
- package/dist/modules/sales/components/documents/LineItemDialog.js.map +2 -2
- package/dist/modules/sales/components/documents/SalesDocumentForm.js +96 -87
- package/dist/modules/sales/components/documents/SalesDocumentForm.js.map +2 -2
- package/dist/modules/sales/widgets/dashboard/new-orders/widget.client.js +20 -11
- package/dist/modules/sales/widgets/dashboard/new-orders/widget.client.js.map +2 -2
- package/dist/modules/sales/widgets/dashboard/new-quotes/widget.client.js +20 -11
- package/dist/modules/sales/widgets/dashboard/new-quotes/widget.client.js.map +2 -2
- package/dist/modules/shipping_carriers/lib/shipment-wizard/components/ConfigureStep.js +36 -22
- package/dist/modules/shipping_carriers/lib/shipment-wizard/components/ConfigureStep.js.map +2 -2
- package/dist/modules/staff/components/TeamMemberForm.js +14 -9
- package/dist/modules/staff/components/TeamMemberForm.js.map +3 -3
- package/dist/modules/workflows/backend/tasks/[id]/page.js +42 -21
- package/dist/modules/workflows/backend/tasks/[id]/page.js.map +2 -2
- package/dist/modules/workflows/components/ActivitiesEditor.js +14 -6
- package/dist/modules/workflows/components/ActivitiesEditor.js.map +3 -3
- package/dist/modules/workflows/components/DefinitionTriggersEditor.js +25 -17
- package/dist/modules/workflows/components/DefinitionTriggersEditor.js.map +3 -3
- package/dist/modules/workflows/components/EdgeEditDialog.js +48 -45
- package/dist/modules/workflows/components/EdgeEditDialog.js.map +2 -2
- package/dist/modules/workflows/components/NodeEditDialog.js +90 -90
- package/dist/modules/workflows/components/NodeEditDialog.js.map +2 -2
- package/dist/modules/workflows/components/StepsEditor.js +14 -6
- package/dist/modules/workflows/components/StepsEditor.js.map +3 -3
- package/dist/modules/workflows/components/TransitionsEditor.js +31 -26
- package/dist/modules/workflows/components/TransitionsEditor.js.map +3 -3
- package/dist/modules/workflows/components/fields/ActivityArrayEditor.js +19 -11
- package/dist/modules/workflows/components/fields/ActivityArrayEditor.js.map +3 -3
- package/dist/modules/workflows/components/fields/BusinessRuleConditionsEditor.js +12 -14
- package/dist/modules/workflows/components/fields/BusinessRuleConditionsEditor.js.map +2 -2
- package/dist/modules/workflows/components/fields/FormFieldArrayEditor.js +24 -16
- package/dist/modules/workflows/components/fields/FormFieldArrayEditor.js.map +3 -3
- package/dist/modules/workflows/components/fields/StartPreConditionsEditor.js +12 -13
- package/dist/modules/workflows/components/fields/StartPreConditionsEditor.js.map +2 -2
- package/dist/modules/workflows/components/mobile/MobileTaskForm.js +12 -8
- package/dist/modules/workflows/components/mobile/MobileTaskForm.js.map +2 -2
- package/dist/modules/workflows/frontend/checkout-demo/page.js +43 -46
- package/dist/modules/workflows/frontend/checkout-demo/page.js.map +2 -2
- package/package.json +3 -3
- package/src/helpers/integration/salesUi.ts +40 -30
- package/src/modules/api_docs/frontend/docs/api/Explorer.tsx +25 -19
- package/src/modules/attachments/components/AttachmentPartitionSettings.tsx +21 -11
- package/src/modules/attachments/fields/attachment.tsx +4 -6
- package/src/modules/auth/api/users/route.ts +75 -25
- package/src/modules/auth/backend/users/create/page.tsx +16 -20
- package/src/modules/business_rules/components/ActionRow.tsx +51 -32
- package/src/modules/business_rules/components/ConditionGroup.tsx +20 -9
- package/src/modules/business_rules/components/ConditionRow.tsx +24 -15
- package/src/modules/business_rules/components/RuleSetMembers.tsx +23 -13
- package/src/modules/catalog/backend/catalog/products/[id]/page.tsx +47 -53
- package/src/modules/catalog/backend/catalog/products/create/page.tsx +84 -87
- package/src/modules/catalog/components/PriceKindSettings.tsx +9 -9
- package/src/modules/catalog/components/products/ProductUomSection.tsx +85 -83
- package/src/modules/catalog/components/products/VariantBuilder.tsx +49 -33
- package/src/modules/customer_accounts/backend/customer_accounts/users/[id]/page.tsx +12 -27
- package/src/modules/customer_accounts/backend/customer_accounts/users/page.tsx +4 -6
- package/src/modules/customer_accounts/widgets/injection/account-status/widget.client.tsx +5 -4
- package/src/modules/customers/backend/config/customers/pipeline-stages/page.tsx +28 -15
- package/src/modules/customers/backend/customers/deals/pipeline/page.tsx +37 -26
- package/src/modules/customers/components/AddressEditor.tsx +30 -16
- package/src/modules/customers/components/AddressFormatSettings.tsx +25 -19
- package/src/modules/customers/components/detail/ActivityForm.tsx +35 -23
- package/src/modules/customers/components/detail/AnnualRevenueField.tsx +2 -2
- package/src/modules/customers/components/detail/DealForm.tsx +33 -20
- package/src/modules/customers/components/formConfig.tsx +25 -17
- package/src/modules/customers/widgets/dashboard/customer-todos/widget.client.tsx +3 -2
- package/src/modules/customers/widgets/dashboard/new-customers/widget.client.tsx +21 -11
- package/src/modules/customers/widgets/dashboard/new-deals/widget.client.tsx +3 -2
- package/src/modules/customers/widgets/dashboard/next-interactions/widget.client.tsx +3 -2
- package/src/modules/dashboards/components/WidgetVisibilityEditor.tsx +17 -22
- package/src/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.tsx +17 -7
- package/src/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.tsx +20 -10
- package/src/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.tsx +3 -2
- package/src/modules/dashboards/widgets/dashboard/top-customers/widget.client.tsx +3 -2
- package/src/modules/dashboards/widgets/dashboard/top-products/widget.client.tsx +20 -9
- package/src/modules/data_sync/backend/data-sync/page.tsx +64 -38
- package/src/modules/data_sync/components/IntegrationScheduleTab.tsx +18 -7
- package/src/modules/dictionaries/components/AppearanceSelector.tsx +4 -4
- package/src/modules/dictionaries/components/DictionaryEntriesEditor.tsx +3 -4
- package/src/modules/dictionaries/components/DictionaryEntrySelect.tsx +27 -21
- package/src/modules/dictionaries/fields/dictionary.tsx +36 -23
- package/src/modules/entities/components/EncryptionManager.tsx +49 -33
- package/src/modules/feature_toggles/components/formConfig.tsx +20 -10
- package/src/modules/feature_toggles/components/overrideFormConfig.tsx +20 -10
- package/src/modules/inbox_ops/backend/inbox-ops/settings/page.tsx +19 -10
- package/src/modules/inbox_ops/components/proposals/EditActionDialog.tsx +49 -26
- package/src/modules/integrations/backend/integrations/[id]/page.tsx +20 -11
- package/src/modules/integrations/backend/integrations/bundle/[id]/page.tsx +19 -9
- package/src/modules/planner/components/AvailabilityRulesEditor.tsx +34 -21
- package/src/modules/resources/components/ResourceCrudForm.tsx +24 -15
- package/src/modules/sales/backend/sales/documents/[id]/page.tsx +12 -15
- package/src/modules/sales/components/ProviderFieldInput.tsx +26 -17
- package/src/modules/sales/components/ShippingMethodsSettings.tsx +28 -20
- package/src/modules/sales/components/channels/ChannelOfferForm.tsx +51 -46
- package/src/modules/sales/components/documents/AddressesSection.tsx +78 -76
- package/src/modules/sales/components/documents/AdjustmentDialog.tsx +27 -15
- package/src/modules/sales/components/documents/LineItemDialog.tsx +69 -51
- package/src/modules/sales/components/documents/SalesDocumentForm.tsx +98 -87
- package/src/modules/sales/widgets/dashboard/new-orders/widget.client.tsx +23 -12
- package/src/modules/sales/widgets/dashboard/new-quotes/widget.client.tsx +23 -12
- package/src/modules/shipping_carriers/lib/shipment-wizard/components/ConfigureStep.tsx +35 -19
- package/src/modules/staff/components/TeamMemberForm.tsx +23 -14
- package/src/modules/workflows/backend/tasks/[id]/page.tsx +51 -23
- package/src/modules/workflows/components/ActivitiesEditor.tsx +20 -10
- package/src/modules/workflows/components/DefinitionTriggersEditor.tsx +28 -18
- package/src/modules/workflows/components/EdgeEditDialog.tsx +51 -40
- package/src/modules/workflows/components/NodeEditDialog.tsx +81 -77
- package/src/modules/workflows/components/StepsEditor.tsx +20 -10
- package/src/modules/workflows/components/TransitionsEditor.tsx +61 -44
- package/src/modules/workflows/components/fields/ActivityArrayEditor.tsx +22 -12
- package/src/modules/workflows/components/fields/BusinessRuleConditionsEditor.tsx +9 -13
- package/src/modules/workflows/components/fields/FormFieldArrayEditor.tsx +27 -17
- package/src/modules/workflows/components/fields/StartPreConditionsEditor.tsx +9 -12
- package/src/modules/workflows/components/mobile/MobileTaskForm.tsx +19 -11
- package/src/modules/workflows/frontend/checkout-demo/page.tsx +71 -60
|
@@ -13,8 +13,15 @@ import {
|
|
|
13
13
|
DialogTitle,
|
|
14
14
|
} from '@open-mercato/ui/primitives/dialog'
|
|
15
15
|
import { Input } from '@open-mercato/ui/primitives/input'
|
|
16
|
+
import {
|
|
17
|
+
Select,
|
|
18
|
+
SelectContent,
|
|
19
|
+
SelectItem,
|
|
20
|
+
SelectTrigger,
|
|
21
|
+
SelectValue,
|
|
22
|
+
} from '@open-mercato/ui/primitives/select'
|
|
16
23
|
import { Label } from '@open-mercato/ui/primitives/label'
|
|
17
|
-
import {
|
|
24
|
+
import { SwitchField } from '@open-mercato/ui/primitives/switch-field'
|
|
18
25
|
import { CrudForm, type CrudCustomFieldRenderProps, type CrudField } from '@open-mercato/ui/backend/CrudForm'
|
|
19
26
|
import { flash } from '@open-mercato/ui/backend/FlashMessages'
|
|
20
27
|
import { apiCall, readApiResultOrThrow } from '@open-mercato/ui/backend/utils/apiCall'
|
|
@@ -171,17 +178,21 @@ function FlatRateSettingsEditor(props: {
|
|
|
171
178
|
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3">
|
|
172
179
|
<div className="space-y-1">
|
|
173
180
|
<Label className="text-xs uppercase text-muted-foreground">{translations.metric}</Label>
|
|
174
|
-
<
|
|
175
|
-
className="w-full rounded-md border border-input bg-background px-3 py-2 text-sm"
|
|
181
|
+
<Select
|
|
176
182
|
value={rate.metric ?? 'item_count'}
|
|
177
|
-
|
|
183
|
+
onValueChange={(value) => updateRate(index, 'metric', value)}
|
|
178
184
|
>
|
|
179
|
-
|
|
180
|
-
<
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
+
<SelectTrigger>
|
|
186
|
+
<SelectValue />
|
|
187
|
+
</SelectTrigger>
|
|
188
|
+
<SelectContent>
|
|
189
|
+
{metrics.map((opt) => (
|
|
190
|
+
<SelectItem key={opt.value} value={opt.value}>
|
|
191
|
+
{opt.label}
|
|
192
|
+
</SelectItem>
|
|
193
|
+
))}
|
|
194
|
+
</SelectContent>
|
|
195
|
+
</Select>
|
|
185
196
|
</div>
|
|
186
197
|
<div className="space-y-1">
|
|
187
198
|
<Label className="text-xs uppercase text-muted-foreground">{translations.min}</Label>
|
|
@@ -239,16 +250,13 @@ function FlatRateSettingsEditor(props: {
|
|
|
239
250
|
))
|
|
240
251
|
)}
|
|
241
252
|
</div>
|
|
242
|
-
<
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
{translations.applyBaseRate}
|
|
250
|
-
</Label>
|
|
251
|
-
</div>
|
|
253
|
+
<SwitchField
|
|
254
|
+
id="apply-base-rate"
|
|
255
|
+
label={translations.applyBaseRate}
|
|
256
|
+
flip
|
|
257
|
+
checked={applyBaseRate}
|
|
258
|
+
onCheckedChange={(checked) => onChange({ ...value, applyBaseRate: checked })}
|
|
259
|
+
/>
|
|
252
260
|
</div>
|
|
253
261
|
)
|
|
254
262
|
}
|
|
@@ -10,6 +10,14 @@ import { createCrudFormError, type CrudServerFieldErrors } from '@open-mercato/u
|
|
|
10
10
|
import { readApiResultOrThrow, apiCall } from '@open-mercato/ui/backend/utils/apiCall'
|
|
11
11
|
import { flash } from '@open-mercato/ui/backend/FlashMessages'
|
|
12
12
|
import { Button } from '@open-mercato/ui/primitives/button'
|
|
13
|
+
import { Input } from '@open-mercato/ui/primitives/input'
|
|
14
|
+
import {
|
|
15
|
+
Select,
|
|
16
|
+
SelectContent,
|
|
17
|
+
SelectItem,
|
|
18
|
+
SelectTrigger,
|
|
19
|
+
SelectValue,
|
|
20
|
+
} from '@open-mercato/ui/primitives/select'
|
|
13
21
|
import { Loader2, Search, Image as ImageIcon, Trash2 } from 'lucide-react'
|
|
14
22
|
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
15
23
|
import { E } from '#generated/entities.ids.generated'
|
|
@@ -933,18 +941,18 @@ function ChannelSelectInput({
|
|
|
933
941
|
)
|
|
934
942
|
}
|
|
935
943
|
return (
|
|
936
|
-
<
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
</
|
|
944
|
+
<Select value={value || undefined} onValueChange={(next) => onChange(next || null)}>
|
|
945
|
+
<SelectTrigger>
|
|
946
|
+
<SelectValue placeholder={t('sales.channels.offers.form.channelPlaceholder', 'Select channel')} />
|
|
947
|
+
</SelectTrigger>
|
|
948
|
+
<SelectContent>
|
|
949
|
+
{options.map((opt) => (
|
|
950
|
+
<SelectItem key={opt.id} value={opt.id}>
|
|
951
|
+
{opt.code ? `${opt.name} (${opt.code})` : opt.name}
|
|
952
|
+
</SelectItem>
|
|
953
|
+
))}
|
|
954
|
+
</SelectContent>
|
|
955
|
+
</Select>
|
|
948
956
|
)
|
|
949
957
|
}
|
|
950
958
|
|
|
@@ -1027,19 +1035,16 @@ function ProductSelectInput({
|
|
|
1027
1035
|
|
|
1028
1036
|
return (
|
|
1029
1037
|
<div className="space-y-3">
|
|
1030
|
-
<
|
|
1031
|
-
<Search
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
value
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
placeholder={t('sales.channels.offers.form.productSearchPlaceholder', 'Search by title, SKU, or ID…')}
|
|
1041
|
-
/>
|
|
1042
|
-
</div>
|
|
1038
|
+
<Input
|
|
1039
|
+
leftIcon={<Search />}
|
|
1040
|
+
value={query}
|
|
1041
|
+
onChange={(event) => {
|
|
1042
|
+
setQuery(event.target.value)
|
|
1043
|
+
setHasTyped(true)
|
|
1044
|
+
}}
|
|
1045
|
+
onKeyDown={handleKeyDown}
|
|
1046
|
+
placeholder={t('sales.channels.offers.form.productSearchPlaceholder', 'Search by title, SKU, or ID…')}
|
|
1047
|
+
/>
|
|
1043
1048
|
{selectedHint ? (
|
|
1044
1049
|
<div className="rounded border bg-muted px-3 py-2 text-xs text-muted-foreground">
|
|
1045
1050
|
{selectedHint}
|
|
@@ -1819,11 +1824,10 @@ function PriceOverridesEditor({
|
|
|
1819
1824
|
<div className="space-y-2">
|
|
1820
1825
|
{values.map((row) => (
|
|
1821
1826
|
<div key={row.tempId} className="grid gap-2 rounded border p-3 md:grid-cols-3">
|
|
1822
|
-
<
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
const next = priceKinds.find((kind) => kind.id === event.target.value)
|
|
1827
|
+
<Select
|
|
1828
|
+
value={row.priceKindId || undefined}
|
|
1829
|
+
onValueChange={(value) => {
|
|
1830
|
+
const next = priceKinds.find((kind) => kind.id === value)
|
|
1827
1831
|
updateRow(row.tempId, {
|
|
1828
1832
|
priceKindId: next?.id ?? null,
|
|
1829
1833
|
priceKindCode: next?.code ?? next?.title ?? null,
|
|
@@ -1832,28 +1836,29 @@ function PriceOverridesEditor({
|
|
|
1832
1836
|
})
|
|
1833
1837
|
}}
|
|
1834
1838
|
>
|
|
1835
|
-
<
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1839
|
+
<SelectTrigger>
|
|
1840
|
+
<SelectValue placeholder={t('sales.channels.offers.pricing.selectKind', 'Select price kind')} />
|
|
1841
|
+
</SelectTrigger>
|
|
1842
|
+
<SelectContent>
|
|
1843
|
+
{priceKinds.map((kind) => (
|
|
1844
|
+
<SelectItem
|
|
1845
|
+
key={kind.id}
|
|
1846
|
+
value={kind.id}
|
|
1847
|
+
disabled={usedKindIdSet.has(kind.id) && row.priceKindId !== kind.id}
|
|
1848
|
+
>
|
|
1849
|
+
{kind.title ?? kind.code ?? kind.id}
|
|
1850
|
+
</SelectItem>
|
|
1851
|
+
))}
|
|
1852
|
+
</SelectContent>
|
|
1853
|
+
</Select>
|
|
1846
1854
|
<div className="relative">
|
|
1847
1855
|
{(row.currencyCode ?? basePrice?.currencyCode) ? (
|
|
1848
1856
|
<span className="pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-xs font-semibold text-muted-foreground">
|
|
1849
1857
|
{row.currencyCode ?? basePrice?.currencyCode}
|
|
1850
1858
|
</span>
|
|
1851
1859
|
) : null}
|
|
1852
|
-
<
|
|
1853
|
-
|
|
1854
|
-
'w-full rounded border py-2 text-sm',
|
|
1855
|
-
row.currencyCode || basePrice?.currencyCode ? 'pl-16 pr-2' : 'px-2',
|
|
1856
|
-
)}
|
|
1860
|
+
<Input
|
|
1861
|
+
inputClassName={cn(row.currencyCode || basePrice?.currencyCode ? 'pl-13' : '')}
|
|
1857
1862
|
type="number"
|
|
1858
1863
|
placeholder={t('sales.channels.offers.pricing.amount', 'Amount')}
|
|
1859
1864
|
value={row.amount ?? ''}
|
|
@@ -9,7 +9,14 @@ import { createCrud } from '@open-mercato/ui/backend/utils/crud'
|
|
|
9
9
|
import { useGuardedMutation } from '@open-mercato/ui/backend/injection/useGuardedMutation'
|
|
10
10
|
import { ErrorMessage, LoadingMessage, TabEmptyState } from '@open-mercato/ui/backend/detail'
|
|
11
11
|
import { Button } from '@open-mercato/ui/primitives/button'
|
|
12
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
Select,
|
|
14
|
+
SelectContent,
|
|
15
|
+
SelectItem,
|
|
16
|
+
SelectTrigger,
|
|
17
|
+
SelectValue,
|
|
18
|
+
} from '@open-mercato/ui/primitives/select'
|
|
19
|
+
import { SwitchField } from '@open-mercato/ui/primitives/switch-field'
|
|
13
20
|
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
14
21
|
import { useConfirmDialog } from '@open-mercato/ui/backend/confirm-dialog'
|
|
15
22
|
import { AddressEditor, type AddressEditorDraft } from '@open-mercato/core/modules/customers/components/AddressEditor'
|
|
@@ -903,26 +910,27 @@ export function SalesDocumentAddressesSection({
|
|
|
903
910
|
onChange: (next: string | null) => void,
|
|
904
911
|
disabled: boolean
|
|
905
912
|
) => (
|
|
906
|
-
<
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
913
|
+
<Select value={value || undefined} onValueChange={(next) => onChange(next || null)} disabled={disabled}>
|
|
914
|
+
<SelectTrigger>
|
|
915
|
+
<SelectValue
|
|
916
|
+
placeholder={
|
|
917
|
+
addressesLoading
|
|
918
|
+
? t('sales.documents.form.address.loading', 'Loading addresses…')
|
|
919
|
+
: t('sales.documents.form.address.placeholder', 'Select address')
|
|
920
|
+
}
|
|
921
|
+
/>
|
|
922
|
+
</SelectTrigger>
|
|
923
|
+
<SelectContent>
|
|
924
|
+
{options.map((addr) => {
|
|
925
|
+
const optionLabel = addr.summary ? `${addr.label} — ${addr.summary}` : addr.label
|
|
926
|
+
return (
|
|
927
|
+
<SelectItem key={addr.id} value={addr.id}>
|
|
928
|
+
{optionLabel}
|
|
929
|
+
</SelectItem>
|
|
930
|
+
)
|
|
931
|
+
})}
|
|
932
|
+
</SelectContent>
|
|
933
|
+
</Select>
|
|
926
934
|
)
|
|
927
935
|
|
|
928
936
|
return (
|
|
@@ -962,14 +970,13 @@ export function SalesDocumentAddressesSection({
|
|
|
962
970
|
: t('sales.documents.form.shipping.hint', 'Select an address or define a new one.')}
|
|
963
971
|
</p>
|
|
964
972
|
</div>
|
|
965
|
-
<
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
</label>
|
|
973
|
+
<SwitchField
|
|
974
|
+
label={t('sales.documents.form.shipping.custom', 'Define new address')}
|
|
975
|
+
flip
|
|
976
|
+
checked={useCustomShipping}
|
|
977
|
+
onCheckedChange={(checked) => setUseCustomShipping(checked)}
|
|
978
|
+
disabled={customerRequired || locked}
|
|
979
|
+
/>
|
|
973
980
|
</div>
|
|
974
981
|
{!useCustomShipping
|
|
975
982
|
? renderAddressSelect(
|
|
@@ -988,14 +995,13 @@ export function SalesDocumentAddressesSection({
|
|
|
988
995
|
onChange={(next) => setShippingDraft(next)}
|
|
989
996
|
hidePrimaryToggle
|
|
990
997
|
/>
|
|
991
|
-
<
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
</label>
|
|
998
|
+
<SwitchField
|
|
999
|
+
label={t('sales.documents.form.address.saveToCustomer', 'Save this address to the customer')}
|
|
1000
|
+
flip
|
|
1001
|
+
checked={saveShippingAddress && !customerRequired}
|
|
1002
|
+
onCheckedChange={(checked) => setSaveShippingAddress(checked)}
|
|
1003
|
+
disabled={customerRequired || locked}
|
|
1004
|
+
/>
|
|
999
1005
|
</div>
|
|
1000
1006
|
) : null}
|
|
1001
1007
|
</div>
|
|
@@ -1013,21 +1019,20 @@ export function SalesDocumentAddressesSection({
|
|
|
1013
1019
|
: t('sales.documents.form.billing.hint', 'Select an address or define a new one.')}
|
|
1014
1020
|
</p>
|
|
1015
1021
|
</div>
|
|
1016
|
-
<
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
}
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
</label>
|
|
1022
|
+
<SwitchField
|
|
1023
|
+
label={t('sales.documents.form.address.sameAsShipping', 'Same as shipping')}
|
|
1024
|
+
flip
|
|
1025
|
+
checked={sameAsShipping}
|
|
1026
|
+
onCheckedChange={(checked) => {
|
|
1027
|
+
setSameAsShipping(checked)
|
|
1028
|
+
if (checked) {
|
|
1029
|
+
setUseCustomBilling(useCustomShipping)
|
|
1030
|
+
setBillingAddressId(useCustomShipping ? null : shippingAddressIdState)
|
|
1031
|
+
setBillingDraft(useCustomShipping ? shippingDraft : emptyDraft)
|
|
1032
|
+
}
|
|
1033
|
+
}}
|
|
1034
|
+
disabled={locked}
|
|
1035
|
+
/>
|
|
1031
1036
|
</div>
|
|
1032
1037
|
|
|
1033
1038
|
{!sameAsShipping ? (
|
|
@@ -1040,14 +1045,13 @@ export function SalesDocumentAddressesSection({
|
|
|
1040
1045
|
addressesLoading || customerRequired || locked
|
|
1041
1046
|
)
|
|
1042
1047
|
: null}
|
|
1043
|
-
<
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
</label>
|
|
1048
|
+
<SwitchField
|
|
1049
|
+
label={t('sales.documents.form.shipping.custom', 'Define new address')}
|
|
1050
|
+
flip
|
|
1051
|
+
checked={useCustomBilling}
|
|
1052
|
+
onCheckedChange={(checked) => setUseCustomBilling(checked)}
|
|
1053
|
+
disabled={customerRequired || locked}
|
|
1054
|
+
/>
|
|
1051
1055
|
|
|
1052
1056
|
{useCustomBilling ? (
|
|
1053
1057
|
<div className="space-y-3">
|
|
@@ -1058,14 +1062,13 @@ export function SalesDocumentAddressesSection({
|
|
|
1058
1062
|
onChange={(next) => setBillingDraft(next)}
|
|
1059
1063
|
hidePrimaryToggle
|
|
1060
1064
|
/>
|
|
1061
|
-
<
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
</label>
|
|
1065
|
+
<SwitchField
|
|
1066
|
+
label={t('sales.documents.form.address.saveToCustomer', 'Save this address to the customer')}
|
|
1067
|
+
flip
|
|
1068
|
+
checked={saveBillingAddress && !customerRequired}
|
|
1069
|
+
onCheckedChange={(checked) => setSaveBillingAddress(checked)}
|
|
1070
|
+
disabled={customerRequired || locked}
|
|
1071
|
+
/>
|
|
1069
1072
|
</div>
|
|
1070
1073
|
) : null}
|
|
1071
1074
|
</>
|
|
@@ -1252,14 +1255,13 @@ export function SalesDocumentAddressesSection({
|
|
|
1252
1255
|
</Button>
|
|
1253
1256
|
</div>
|
|
1254
1257
|
|
|
1255
|
-
<
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
</label>
|
|
1258
|
+
<SwitchField
|
|
1259
|
+
label={t('sales.documents.form.shipping.custom', 'Define new address')}
|
|
1260
|
+
flip
|
|
1261
|
+
checked={additionalUseCustom}
|
|
1262
|
+
onCheckedChange={(checked) => setAdditionalUseCustom(checked)}
|
|
1263
|
+
disabled={customerRequired || locked}
|
|
1264
|
+
/>
|
|
1263
1265
|
|
|
1264
1266
|
{!additionalUseCustom
|
|
1265
1267
|
? renderAddressSelect(
|
|
@@ -7,6 +7,13 @@ import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@open-mercato/
|
|
|
7
7
|
import { Badge } from '@open-mercato/ui/primitives/badge'
|
|
8
8
|
import { Button } from '@open-mercato/ui/primitives/button'
|
|
9
9
|
import { Input } from '@open-mercato/ui/primitives/input'
|
|
10
|
+
import {
|
|
11
|
+
Select,
|
|
12
|
+
SelectContent,
|
|
13
|
+
SelectItem,
|
|
14
|
+
SelectTrigger,
|
|
15
|
+
SelectValue,
|
|
16
|
+
} from '@open-mercato/ui/primitives/select'
|
|
10
17
|
import { CrudForm, type CrudField, type CrudFormGroup } from '@open-mercato/ui/backend/CrudForm'
|
|
11
18
|
import { collectCustomFieldValues } from '@open-mercato/ui/backend/utils/customFieldValues'
|
|
12
19
|
import { apiCall } from '@open-mercato/ui/backend/utils/apiCall'
|
|
@@ -524,23 +531,28 @@ export function AdjustmentDialog({
|
|
|
524
531
|
}
|
|
525
532
|
return (
|
|
526
533
|
<div className="flex items-center gap-2">
|
|
527
|
-
<
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
onChange={handleChange}
|
|
534
|
+
<Select
|
|
535
|
+
value={rateId || undefined}
|
|
536
|
+
onValueChange={(value) => handleChange({ target: { value } } as React.ChangeEvent<HTMLSelectElement>)}
|
|
531
537
|
disabled={!taxRates.length}
|
|
532
538
|
>
|
|
533
|
-
<
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
539
|
+
<SelectTrigger>
|
|
540
|
+
<SelectValue
|
|
541
|
+
placeholder={
|
|
542
|
+
taxRates.length
|
|
543
|
+
? t('sales.documents.adjustments.taxRate.placeholder', 'No tax class selected')
|
|
544
|
+
: t('sales.documents.adjustments.taxRate.empty', 'No tax classes available')
|
|
545
|
+
}
|
|
546
|
+
/>
|
|
547
|
+
</SelectTrigger>
|
|
548
|
+
<SelectContent>
|
|
549
|
+
{taxRates.map((rate) => (
|
|
550
|
+
<SelectItem key={rate.id} value={rate.id}>
|
|
551
|
+
{formatTaxRateLabel(rate)}
|
|
552
|
+
</SelectItem>
|
|
553
|
+
))}
|
|
554
|
+
</SelectContent>
|
|
555
|
+
</Select>
|
|
544
556
|
<Button
|
|
545
557
|
type="button"
|
|
546
558
|
variant="ghost"
|
|
@@ -23,6 +23,13 @@ import {
|
|
|
23
23
|
} from "@open-mercato/ui/primitives/dialog";
|
|
24
24
|
import { Button } from "@open-mercato/ui/primitives/button";
|
|
25
25
|
import { Input } from "@open-mercato/ui/primitives/input";
|
|
26
|
+
import {
|
|
27
|
+
Select,
|
|
28
|
+
SelectContent,
|
|
29
|
+
SelectItem,
|
|
30
|
+
SelectTrigger,
|
|
31
|
+
SelectValue,
|
|
32
|
+
} from "@open-mercato/ui/primitives/select";
|
|
26
33
|
import { DollarSign, Settings } from "lucide-react";
|
|
27
34
|
import { normalizeCustomFieldValues } from "@open-mercato/shared/lib/custom-fields/normalize";
|
|
28
35
|
import {
|
|
@@ -1969,22 +1976,25 @@ export function LineItemDialog({
|
|
|
1969
1976
|
onChange={(event) => setValue(event.target.value)}
|
|
1970
1977
|
placeholder="0.00"
|
|
1971
1978
|
/>
|
|
1972
|
-
<
|
|
1973
|
-
className="w-32 rounded border px-2 text-sm"
|
|
1979
|
+
<Select
|
|
1974
1980
|
value={mode}
|
|
1975
|
-
|
|
1976
|
-
const nextMode =
|
|
1977
|
-
event.target.value === "net" ? "net" : "gross";
|
|
1981
|
+
onValueChange={(value) => {
|
|
1982
|
+
const nextMode = value === "net" ? "net" : "gross";
|
|
1978
1983
|
setFormValue?.("priceMode", nextMode);
|
|
1979
1984
|
}}
|
|
1980
1985
|
>
|
|
1981
|
-
<
|
|
1982
|
-
|
|
1983
|
-
</
|
|
1984
|
-
<
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1986
|
+
<SelectTrigger className="w-32">
|
|
1987
|
+
<SelectValue />
|
|
1988
|
+
</SelectTrigger>
|
|
1989
|
+
<SelectContent>
|
|
1990
|
+
<SelectItem value="gross">
|
|
1991
|
+
{t("sales.documents.items.priceGross", "Gross")}
|
|
1992
|
+
</SelectItem>
|
|
1993
|
+
<SelectItem value="net">
|
|
1994
|
+
{t("sales.documents.items.priceNet", "Net")}
|
|
1995
|
+
</SelectItem>
|
|
1996
|
+
</SelectContent>
|
|
1997
|
+
</Select>
|
|
1988
1998
|
</div>
|
|
1989
1999
|
{isCatalogLine && selectedPrice && quantityUnitCode && baseUnitCode ? (
|
|
1990
2000
|
unitFactor !== null && convertedAmount !== null ? (
|
|
@@ -2048,31 +2058,36 @@ export function LineItemDialog({
|
|
|
2048
2058
|
};
|
|
2049
2059
|
return (
|
|
2050
2060
|
<div className="flex items-center gap-2">
|
|
2051
|
-
<
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
onChange={handleChange}
|
|
2061
|
+
<Select
|
|
2062
|
+
value={resolvedValue || undefined}
|
|
2063
|
+
onValueChange={(value) => handleChange({ target: { value } } as React.ChangeEvent<HTMLSelectElement>)}
|
|
2055
2064
|
disabled={!taxRates.length}
|
|
2056
2065
|
>
|
|
2057
|
-
<
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2066
|
+
<SelectTrigger>
|
|
2067
|
+
<SelectValue
|
|
2068
|
+
placeholder={
|
|
2069
|
+
taxRates.length
|
|
2070
|
+
? t(
|
|
2071
|
+
"sales.documents.items.taxRate.none",
|
|
2072
|
+
"No tax class selected",
|
|
2073
|
+
)
|
|
2074
|
+
: t(
|
|
2075
|
+
"sales.documents.items.taxRate.empty",
|
|
2076
|
+
"No tax classes available",
|
|
2077
|
+
)
|
|
2078
|
+
}
|
|
2079
|
+
/>
|
|
2080
|
+
</SelectTrigger>
|
|
2081
|
+
<SelectContent>
|
|
2082
|
+
{taxRates.map((rate) => (
|
|
2083
|
+
<SelectItem key={rate.id} value={rate.id}>
|
|
2084
|
+
{rate.name}
|
|
2085
|
+
{rate.code ? ` • ${rate.code.toUpperCase()}` : ""}
|
|
2086
|
+
{Number.isFinite(rate.rate) ? ` • ${rate.rate}%` : ""}
|
|
2087
|
+
</SelectItem>
|
|
2088
|
+
))}
|
|
2089
|
+
</SelectContent>
|
|
2090
|
+
</Select>
|
|
2076
2091
|
<Button
|
|
2077
2092
|
type="button"
|
|
2078
2093
|
variant="ghost"
|
|
@@ -2120,11 +2135,10 @@ export function LineItemDialog({
|
|
|
2120
2135
|
);
|
|
2121
2136
|
}
|
|
2122
2137
|
return (
|
|
2123
|
-
<
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
const nextValue = event.target.value || null;
|
|
2138
|
+
<Select
|
|
2139
|
+
value={typeof value === "string" && value ? value : undefined}
|
|
2140
|
+
onValueChange={(next) => {
|
|
2141
|
+
const nextValue = next || null;
|
|
2128
2142
|
const nextUnitPrice = convertUnitPriceForUnitChange(
|
|
2129
2143
|
values?.unitPrice,
|
|
2130
2144
|
typeof value === "string" ? value : null,
|
|
@@ -2172,17 +2186,21 @@ export function LineItemDialog({
|
|
|
2172
2186
|
}}
|
|
2173
2187
|
disabled={!productId}
|
|
2174
2188
|
>
|
|
2175
|
-
<
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2189
|
+
<SelectTrigger>
|
|
2190
|
+
<SelectValue
|
|
2191
|
+
placeholder={t("sales.documents.items.quantityUnitSelect", "Select unit")}
|
|
2192
|
+
/>
|
|
2193
|
+
</SelectTrigger>
|
|
2194
|
+
<SelectContent>
|
|
2195
|
+
{unitOptions.map((option) => (
|
|
2196
|
+
<SelectItem key={option.code} value={option.code}>
|
|
2197
|
+
{option.isBase
|
|
2198
|
+
? `${option.code} (${t("sales.documents.items.baseUnitTag", "base")})`
|
|
2199
|
+
: option.code}
|
|
2200
|
+
</SelectItem>
|
|
2201
|
+
))}
|
|
2202
|
+
</SelectContent>
|
|
2203
|
+
</Select>
|
|
2186
2204
|
);
|
|
2187
2205
|
},
|
|
2188
2206
|
} satisfies CrudField,
|