Ensure order taker information is provided for customer orders

Update the customer order form to include the order taker's name and other previously missing fields, and add backend logging for debugging failed submissions related to the 'order_taker' column.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 31f9bd88-0285-4787-81b3-31ceeea5a08b
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/31f9bd88-0285-4787-81b3-31ceeea5a08b/5hCjnif
This commit is contained in:
michaelschal committed 2025-08-14 11:58:17 +00:00
1 parent cd436070cd
commit 483dfc4936
4 files changed
+220 -8

No files matched your search

+11 -8
View File
@@ -170,18 +170,21 @@ export function CustomerOrderForm({
// Prepare final data with user's assigned group
const submitData = {
orderTaker: data.orderTaker || user?.firstName + ' ' + user?.lastName || user?.username || "Inconnu",
customerName: data.customerName.trim(),
contactNumber: data.contactNumber || '',
productName: data.productName || '',
customerPhone: data.contactNumber || '',
customerEmail: data.customerEmail || '',
productDesignation: data.productName || '',
productReference: data.productReference || '',
gencode: data.gencode || '',
quantity: data.quantity,
groupId: groupId, // Always use the assigned group
isPickup: false,
notes: data.notes,
supplierId: data.supplierId || 1,
status: data.status || "En attente de Commande",
deposit: data.deposit || 0,
isPromotionalPrice: data.isPromotionalPrice || false,
customerEmail: data.customerEmail,
gencode: data.gencode || '',
supplierId: data.supplierId || 1,
customerNotified: data.customerNotified || false,
notes: data.notes || '',
groupId: groupId, // Always use the assigned group
};
console.log("✅ Customer Order Submit FINAL:", {