seperate delivery and billig adresses in contract added
This commit is contained in:
@@ -207,6 +207,7 @@ export default function ContractForm() {
|
||||
type: c.type,
|
||||
status: c.status,
|
||||
addressId: c.addressId?.toString() || '',
|
||||
billingAddressId: c.billingAddressId?.toString() || '',
|
||||
bankCardId: c.bankCardId?.toString() || '',
|
||||
identityDocumentId: c.identityDocumentId?.toString() || '',
|
||||
salesPlatformId: c.salesPlatformId?.toString() || '',
|
||||
@@ -422,6 +423,7 @@ export default function ContractForm() {
|
||||
contractCategoryId: selectedCategory.id,
|
||||
status: data.status,
|
||||
addressId: safeParseInt(data.addressId) ?? null,
|
||||
billingAddressId: safeParseInt(data.billingAddressId) ?? null,
|
||||
bankCardId: safeParseInt(data.bankCardId) ?? null,
|
||||
identityDocumentId: safeParseInt(data.identityDocumentId) ?? null,
|
||||
salesPlatformId: safeParseInt(data.salesPlatformId) ?? null,
|
||||
@@ -658,16 +660,31 @@ export default function ContractForm() {
|
||||
|
||||
{customerId && (
|
||||
<Card className="mb-6" title="Kundendaten verknüpfen">
|
||||
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4">
|
||||
<Select
|
||||
label="Adresse"
|
||||
label="Lieferadresse"
|
||||
{...register('addressId')}
|
||||
options={addresses.map((a) => ({
|
||||
value: a.id,
|
||||
label: `${a.street} ${a.houseNumber}, ${a.postalCode} ${a.city} (${a.type === 'BILLING' ? 'Rechnung' : 'Liefer'})`,
|
||||
}))}
|
||||
options={addresses
|
||||
.filter((a) => a.type === 'DELIVERY_RESIDENCE')
|
||||
.map((a) => ({
|
||||
value: a.id,
|
||||
label: `${a.street} ${a.houseNumber}, ${a.postalCode} ${a.city}`,
|
||||
}))}
|
||||
/>
|
||||
|
||||
<Select
|
||||
label="Rechnungsadresse"
|
||||
{...register('billingAddressId')}
|
||||
options={addresses
|
||||
.filter((a) => a.type === 'BILLING')
|
||||
.map((a) => ({
|
||||
value: a.id,
|
||||
label: `${a.street} ${a.houseNumber}, ${a.postalCode} ${a.city}`,
|
||||
}))}
|
||||
placeholder="Wie Lieferadresse"
|
||||
/>
|
||||
</div>
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<Select
|
||||
label="Bankkarte"
|
||||
{...register('bankCardId')}
|
||||
|
||||
Reference in New Issue
Block a user