fix: убрать генерацию pickup_code — приходит из 1С, показывать только при самовывозе
This commit is contained in:
parent
9408b98f06
commit
37ea7d3a19
|
|
@ -863,7 +863,7 @@ export const OrderDetailPanel = ({
|
|||
<p className="text-xs text-[var(--color-text-muted)]">{isPickupOrder ? "Статус самовывоза" : "Статус доставки"}</p>
|
||||
<p className="font-medium !text-[var(--color-text)]">{getOrderGroupDeliveryStatusLabel(order.deliveryStatus || order.delivery_status)}</p>
|
||||
</div>
|
||||
{(order.pickupCode || order.pickup_code) ? (
|
||||
{(order.pickupCode || order.pickup_code) && (order.deliveryType === "pickup" || order.delivery_type === "pickup") ? (
|
||||
<div>
|
||||
<p className="text-xs text-[var(--color-text-muted)]">Код выдачи</p>
|
||||
<p className="text-2xl font-bold tracking-[0.3em] text-[var(--color-accent)]">{order.pickupCode || order.pickup_code}</p>
|
||||
|
|
|
|||
|
|
@ -293,16 +293,6 @@ export const updateOrderGroupDeliveryChoice = async ({
|
|||
updatePayload.pickup_time_slot = pickupTimeSlot || null;
|
||||
// Pickup orders don't need a driver — clear assignment
|
||||
updatePayload.assigned_driver_id = null;
|
||||
// Generate pickup code if not already set
|
||||
const { data: existing } = await client
|
||||
.from("order_groups")
|
||||
.select("pickup_code")
|
||||
.eq("id", orderGroupId)
|
||||
.single();
|
||||
if (!existing?.pickup_code) {
|
||||
const code = String(100000 + Math.floor(Math.random() * 900000));
|
||||
updatePayload.pickup_code = code;
|
||||
}
|
||||
} else {
|
||||
updatePayload.pickup_date = null;
|
||||
updatePayload.pickup_time_slot = null;
|
||||
|
|
|
|||
|
|
@ -210,16 +210,6 @@ Deno.serve(async (request) => {
|
|||
groupUpdateData.pickup_time_slot = body.pickupTimeSlot || requestedSlot.deliveryTime || null;
|
||||
// Pickup orders don't need a driver — clear assignment
|
||||
groupUpdateData.assigned_driver_id = null;
|
||||
// Generate pickup code if not already set
|
||||
const { data: existingGroup } = await supabase
|
||||
.from("order_groups")
|
||||
.select("pickup_code")
|
||||
.eq("id", invitation.order_group_id)
|
||||
.single();
|
||||
if (!existingGroup?.pickup_code) {
|
||||
const code = String(100000 + Math.floor(Math.random() * 900000));
|
||||
groupUpdateData.pickup_code = code;
|
||||
}
|
||||
}
|
||||
|
||||
const { error: groupUpdateError } = await supabase
|
||||
|
|
|
|||
|
|
@ -175,11 +175,6 @@ Deno.serve(async (request) => {
|
|||
updateData.pickup_date = body.pickupDate || deliveryDate || null;
|
||||
updateData.pickup_time_slot = body.pickupTimeSlot || deliveryTime || null;
|
||||
updateData.assigned_driver_id = null;
|
||||
// Generate pickup code if not already set
|
||||
if (!currentGroup.pickup_code) {
|
||||
const code = String(100000 + Math.floor(Math.random() * 900000));
|
||||
updateData.pickup_code = code;
|
||||
}
|
||||
} else {
|
||||
updateData.pickup_date = null;
|
||||
updateData.pickup_time_slot = null;
|
||||
|
|
|
|||
Loading…
Reference in New Issue