sale order
SAP-ERP Portal CI/CD / build (push) Successful in 3m57s

This commit is contained in:
John
2026-10-05 18:45:17 +05:30
parent e725a6571b
commit eead8f5ffd
129 changed files with 14252 additions and 452 deletions
+22
View File
@@ -38,6 +38,14 @@ const BUILTIN_STEPS = [
// Issued/Received/Verified stamps since different items can be issued,
// received and verified on different days by different people.
{ workflow: 'work_order', key: 'issue', label: 'Issued By (per-row post-Issuance sign-off)', order: 8 },
// Send back to QA — previously Admin/System Admin role ONLY, no
// assignable step at all: recalls a FULLY APPROVED Work Order back to the
// first QA step for editing (re-uses the normal Reject status, so once
// edited it restarts the full 5-step chain from Prepared By QA — see
// routes/workOrders.js's POST /:id/send-to-qa). Now also grantable to a
// regular user via 'approve' on this key; admin/system_admin still always
// bypass regardless.
{ workflow: 'work_order', key: 'send_to_qa', label: 'Send back to QA (recall a fully approved WO for editing)', order: 9 },
// BOM — up to 4 levels (BOM_APPROVAL_LEVELS controls how many are actually used)
{ workflow: 'bom', key: 'level1', label: 'Level 1 (Manager)', order: 1 },
{ workflow: 'bom', key: 'level2', label: 'Level 2 (Sr. Manager)', order: 2 },
@@ -123,6 +131,12 @@ const BUILTIN_STEPS = [
{ workflow: 'production_order', key: 'consumable_release', label: 'Consumable Order — Release', order: 15 },
{ workflow: 'production_order', key: 'consumable_issue', label: 'Consumable Order — Issue', order: 16 },
{ workflow: 'production_order', key: 'consumable_close', label: 'Consumable Order — Close', order: 17 },
// Cancel — previously Admin/System Admin role ONLY, no assignable step at
// all (an explicit, deliberate restriction — see routes/sap.js's
// isPoAdminOverride()). Now also grantable to a regular user like any
// other step, via 'approve' on this key; admin/system_admin still always
// bypass regardless, same as every other production_order step.
{ workflow: 'production_order', key: 'cancel', label: 'Cancel (bypasses all normal Close checks — irreversible)', order: 18 },
// Man Power — single entry step; its view/add/edit perms gate the whole
// Man Power module CRUD (routes/manpower.js). 'edit' also gates Cancel.
{ workflow: 'man_power', key: 'entry', label: 'Man Power Data Entry', order: 1 },
@@ -166,6 +180,10 @@ const BUILTIN_STEPS = [
// plan, stamping Approved By/Date on it (used in the Excel export).
{ workflow: 'production_planning', key: 'entry', label: 'Production Planning Data Entry', order: 1 },
{ workflow: 'production_planning', key: 'approve', label: 'Production Planning Approval', order: 2 },
// Sales Order module (replacement for the msale portal) — order workflow,
// sample requests and masters. Defined in services/sales/constants.js
// (also the source of the per-"Sales User Type" default templates).
...require('./sales/constants').STEPS,
];
const WORKFLOW_LABELS = {
@@ -179,6 +197,10 @@ const WORKFLOW_LABELS = {
requirement: 'Requirements',
rejection_register: 'Rejection Register',
production_planning: 'Production Planning',
sales_order: 'Sales Order',
sales_sample: 'Sample Request (Domestic)',
sales_export_sample: 'Sample Request (Export)',
sales_master: 'Sales Masters',
};
async function exec(sqlQuery, params = []) {