mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-21 14:08:15 +02:00
5 files changed
+249
-22
No files matched your search
+235
@@ -0,0 +1,235 @@
|
|||||||
|
Administration
|
||||||
|
|
||||||
|
User-related
|
||||||
|
|
||||||
|
|
||||||
|
Environment-related
|
||||||
|
|
||||||
|
Registries
|
||||||
|
|
||||||
|
Logs
|
||||||
|
|
||||||
|
Notifications
|
||||||
|
|
||||||
|
Settings
|
||||||
|
|
||||||
|
New version available 2.33.1
|
||||||
|
DismissSee what's new
|
||||||
|
Community Edition
|
||||||
|
2.27.6 LTS
|
||||||
|
Containers>logiflow-logiflow-1>Logs
|
||||||
|
Container logs
|
||||||
|
|
||||||
|
|
||||||
|
admin
|
||||||
|
Log viewer settings
|
||||||
|
Auto-refresh logs
|
||||||
|
Wrap lines
|
||||||
|
Display timestamps
|
||||||
|
Fetch
|
||||||
|
All logs
|
||||||
|
Search
|
||||||
|
Filter...
|
||||||
|
Lines
|
||||||
|
100
|
||||||
|
Actions
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
code: '42703',
|
||||||
|
|
||||||
|
detail: undefined,
|
||||||
|
|
||||||
|
hint: undefined,
|
||||||
|
|
||||||
|
position: '183',
|
||||||
|
|
||||||
|
internalPosition: undefined,
|
||||||
|
|
||||||
|
internalQuery: undefined,
|
||||||
|
|
||||||
|
where: undefined,
|
||||||
|
|
||||||
|
schema: undefined,
|
||||||
|
|
||||||
|
table: undefined,
|
||||||
|
|
||||||
|
column: undefined,
|
||||||
|
|
||||||
|
dataType: undefined,
|
||||||
|
|
||||||
|
constraint: undefined,
|
||||||
|
|
||||||
|
file: 'parse_target.c',
|
||||||
|
|
||||||
|
line: '1075',
|
||||||
|
|
||||||
|
routine: 'checkInsertTargets'
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
❌ Erreur sauvegarde cache not found BL: error: column "is_reconciled" of relation "invoice_verification_cache" does not exist
|
||||||
|
|
||||||
|
at /app/node_modules/pg-pool/index.js:45:11
|
||||||
|
|
||||||
|
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
|
||||||
|
|
||||||
|
at async file:///app/node_modules/drizzle-orm/node-postgres/session.js:83:22
|
||||||
|
|
||||||
|
at async DatabaseStorage.createInvoiceVerificationCache (file:///app/dist/index.js:2193:27)
|
||||||
|
|
||||||
|
at async InvoiceVerificationService.verifyInvoiceByBL (file:///app/dist/index.js:4947:15)
|
||||||
|
|
||||||
|
at async file:///app/dist/index.js:6758:18 {
|
||||||
|
|
||||||
|
length: 153,
|
||||||
|
|
||||||
|
severity: 'ERROR',
|
||||||
|
|
||||||
|
code: '42703',
|
||||||
|
|
||||||
|
detail: undefined,
|
||||||
|
|
||||||
|
hint: undefined,
|
||||||
|
|
||||||
|
position: '183',
|
||||||
|
|
||||||
|
internalPosition: undefined,
|
||||||
|
|
||||||
|
internalQuery: undefined,
|
||||||
|
|
||||||
|
where: undefined,
|
||||||
|
|
||||||
|
schema: undefined,
|
||||||
|
|
||||||
|
table: undefined,
|
||||||
|
|
||||||
|
column: undefined,
|
||||||
|
|
||||||
|
dataType: undefined,
|
||||||
|
|
||||||
|
constraint: undefined,
|
||||||
|
|
||||||
|
file: 'parse_target.c',
|
||||||
|
|
||||||
|
line: '1075',
|
||||||
|
|
||||||
|
routine: 'checkInsertTargets'
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
🔗 PRODUCTION: getOrder #58 found 1 associated deliveries
|
||||||
|
|
||||||
|
✅ PRODUCTION: getDelivery #88 found associated order #58 with status: delivered
|
||||||
|
|
||||||
|
POST /api/deliveries/88/verify-invoice 403 in 1919ms
|
||||||
|
|
||||||
|
❌ Erreur création cache: error: column "is_reconciled" of relation "invoice_verification_cache" does not exist
|
||||||
|
|
||||||
|
at /app/node_modules/pg-pool/index.js:45:11
|
||||||
|
|
||||||
|
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
|
||||||
|
|
||||||
|
at async file:///app/node_modules/drizzle-orm/node-postgres/session.js:83:22
|
||||||
|
|
||||||
|
at async DatabaseStorage.createInvoiceVerificationCache (file:///app/dist/index.js:2193:27)
|
||||||
|
|
||||||
|
at async InvoiceVerificationService.verifyInvoiceByBL (file:///app/dist/index.js:4947:15)
|
||||||
|
|
||||||
|
at async file:///app/dist/index.js:6758:18 {
|
||||||
|
|
||||||
|
length: 153,
|
||||||
|
|
||||||
|
severity: 'ERROR',
|
||||||
|
|
||||||
|
code: '42703',
|
||||||
|
|
||||||
|
detail: undefined,
|
||||||
|
|
||||||
|
hint: undefined,
|
||||||
|
|
||||||
|
position: '183',
|
||||||
|
|
||||||
|
internalPosition: undefined,
|
||||||
|
|
||||||
|
internalQuery: undefined,
|
||||||
|
|
||||||
|
where: undefined,
|
||||||
|
|
||||||
|
schema: undefined,
|
||||||
|
|
||||||
|
table: undefined,
|
||||||
|
|
||||||
|
column: undefined,
|
||||||
|
|
||||||
|
dataType: undefined,
|
||||||
|
|
||||||
|
constraint: undefined,
|
||||||
|
|
||||||
|
file: 'parse_target.c',
|
||||||
|
|
||||||
|
line: '1075',
|
||||||
|
|
||||||
|
routine: 'checkInsertTargets'
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
❌ Erreur sauvegarde cache not found BL: error: column "is_reconciled" of relation "invoice_verification_cache" does not exist
|
||||||
|
|
||||||
|
at /app/node_modules/pg-pool/index.js:45:11
|
||||||
|
|
||||||
|
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
|
||||||
|
|
||||||
|
at async file:///app/node_modules/drizzle-orm/node-postgres/session.js:83:22
|
||||||
|
|
||||||
|
at async DatabaseStorage.createInvoiceVerificationCache (file:///app/dist/index.js:2193:27)
|
||||||
|
|
||||||
|
at async InvoiceVerificationService.verifyInvoiceByBL (file:///app/dist/index.js:4947:15)
|
||||||
|
|
||||||
|
at async file:///app/dist/index.js:6758:18 {
|
||||||
|
|
||||||
|
length: 153,
|
||||||
|
|
||||||
|
severity: 'ERROR',
|
||||||
|
|
||||||
|
code: '42703',
|
||||||
|
|
||||||
|
detail: undefined,
|
||||||
|
|
||||||
|
hint: undefined,
|
||||||
|
|
||||||
|
position: '183',
|
||||||
|
|
||||||
|
internalPosition: undefined,
|
||||||
|
|
||||||
|
internalQuery: undefined,
|
||||||
|
|
||||||
|
where: undefined,
|
||||||
|
|
||||||
|
schema: undefined,
|
||||||
|
|
||||||
|
table: undefined,
|
||||||
|
|
||||||
|
column: undefined,
|
||||||
|
|
||||||
|
dataType: undefined,
|
||||||
|
|
||||||
|
constraint: undefined,
|
||||||
|
|
||||||
|
file: 'parse_target.c',
|
||||||
|
|
||||||
|
line: '1075',
|
||||||
|
|
||||||
|
routine: 'checkInsertTargets'
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
✅ Résultat vérification: {
|
||||||
|
|
||||||
|
exists: false,
|
||||||
|
|
||||||
|
matchType: 'none',
|
||||||
|
|
||||||
|
errorMessage: 'Aucun BL correspondant trouvé dans NocoDB'
|
||||||
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 259 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 159 KiB |
@@ -213,7 +213,7 @@ export default function BLReconciliation() {
|
|||||||
queryKey: ['/api/deliveries/bl', selectedStoreId],
|
queryKey: ['/api/deliveries/bl', selectedStoreId],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const params = new URLSearchParams({});
|
const params = new URLSearchParams({});
|
||||||
if (selectedStoreId && user?.role === 'admin') {
|
if (selectedStoreId && (user?.role === 'admin' || user?.role === 'directeur')) {
|
||||||
params.append('storeId', selectedStoreId.toString());
|
params.append('storeId', selectedStoreId.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+13
-21
@@ -80,28 +80,12 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
|||||||
return res.status(404).json({ message: "User not found" });
|
return res.status(404).json({ message: "User not found" });
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('🔍 [DEBUG] Groups request:', {
|
|
||||||
userId,
|
|
||||||
userRole: user.role,
|
|
||||||
userGroupsCount: (user as any).userGroups?.length || 0,
|
|
||||||
userGroups: (user as any).userGroups?.map((ug: any) => ({
|
|
||||||
groupId: ug.groupId,
|
|
||||||
groupName: ug.group?.name
|
|
||||||
})) || []
|
|
||||||
});
|
|
||||||
|
|
||||||
// Only admin sees all groups, all other roles (manager, employee, directeur) see only their assigned groups
|
// Only admin sees all groups, all other roles (manager, employee, directeur) see only their assigned groups
|
||||||
if (user.role === 'admin') {
|
if (user.role === 'admin') {
|
||||||
const groups = await storage.getGroups();
|
const groups = await storage.getGroups();
|
||||||
console.log('🔍 [DEBUG] Admin - returning all groups:', groups.length);
|
|
||||||
res.json(groups);
|
res.json(groups);
|
||||||
} else {
|
} else {
|
||||||
const userGroups = (user as any).userGroups?.map((ug: any) => ug.group).filter(Boolean) || [];
|
const userGroups = (user as any).userGroups?.map((ug: any) => ug.group).filter(Boolean) || [];
|
||||||
console.log('🔍 [DEBUG] Non-admin - returning filtered groups:', {
|
|
||||||
role: user.role,
|
|
||||||
filteredGroupsCount: userGroups.length,
|
|
||||||
groups: userGroups.map((g: any) => ({ id: g.id, name: g.name }))
|
|
||||||
});
|
|
||||||
res.json(userGroups);
|
res.json(userGroups);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -694,15 +678,15 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
|||||||
|
|
||||||
console.log('Deliveries API called with:', { startDate, endDate, storeId, withBL, userRole: user.role });
|
console.log('Deliveries API called with:', { startDate, endDate, storeId, withBL, userRole: user.role });
|
||||||
|
|
||||||
if (user.role === 'admin' || user.role === 'directeur') {
|
if (user.role === 'admin') {
|
||||||
let groupIds: number[] | undefined;
|
let groupIds: number[] | undefined;
|
||||||
|
|
||||||
// If admin/directeur selected a specific store, filter by it
|
// If admin selected a specific store, filter by it
|
||||||
if (storeId) {
|
if (storeId) {
|
||||||
groupIds = [parseInt(storeId as string)];
|
groupIds = [parseInt(storeId as string)];
|
||||||
console.log('🔍 Admin/Directeur deliveries filtering by store:', { storeId, groupIds, role: user.role });
|
console.log('🔍 Admin deliveries filtering by store:', { storeId, groupIds, role: user.role });
|
||||||
} else {
|
} else {
|
||||||
console.log('🔍 Admin/Directeur deliveries - showing all stores', { role: user.role });
|
console.log('🔍 Admin deliveries - showing all stores', { role: user.role });
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only filter by date if both startDate and endDate are provided
|
// Only filter by date if both startDate and endDate are provided
|
||||||
@@ -1038,9 +1022,17 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
|||||||
return res.status(403).json({ message: "Insufficient permissions" });
|
return res.status(403).json({ message: "Insufficient permissions" });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (user.role !== 'admin') {
|
// Admin and directeur have access to all deliveries, others must be in the same group
|
||||||
|
if (user.role !== 'admin' && user.role !== 'directeur') {
|
||||||
const userGroupIds = user.userGroups?.map((ug: any) => ug.groupId) || [];
|
const userGroupIds = user.userGroups?.map((ug: any) => ug.groupId) || [];
|
||||||
if (!userGroupIds.includes(delivery.groupId)) {
|
if (!userGroupIds.includes(delivery.groupId)) {
|
||||||
|
console.log('🚫 Access denied - User groups check:', {
|
||||||
|
userId: user.id,
|
||||||
|
userRole: user.role,
|
||||||
|
userGroupIds,
|
||||||
|
deliveryGroupId: delivery.groupId,
|
||||||
|
deliverySupplier: delivery.supplier?.name
|
||||||
|
});
|
||||||
return res.status(403).json({ message: "Access denied to this group" });
|
return res.status(403).json({ message: "Access denied to this group" });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user