Skip to main content

Overview

jshERP provides comprehensive system configuration options that control business rules, company information, and operational behavior. These settings are tenant-specific, allowing each organization to customize the system to their needs.
System configurations are stored per tenant. Changes affect only the current tenant’s operations.

Configuration Structure

The SystemConfig entity contains:

Company Information

companyName
String
Legal company name displayed on documents
companyContacts
String
Primary contact person or department
companyAddress
String
Physical business address
companyTel
String
Main telephone number
companyFax
String
Fax number (if applicable)
companyPostCode
String
Postal/ZIP code

Business Rules

depotFlag
String
Warehouse/depot management rules (0=disabled, 1=enabled)
customerFlag
String
Customer management rules and requirements
minusStockFlag
String
Allow negative inventory: 0=No, 1=Yes
purchaseBySaleFlag
String
Enable purchase-from-sales workflow: 0=No, 1=Yes
multiLevelApprovalFlag
String
Enable multi-level approval workflow: 0=No, 1=Yes
multiBillType
String
Support multiple bill types per transaction
forceApprovalFlag
String
Require approval for all transactions: 0=No, 1=Yes
updateUnitPriceFlag
String
Allow updating unit prices: 0=No, 1=Yes
Allow over-linking in document chains: 0=No, 1=Yes
inOutManageFlag
String
Enable detailed inbound/outbound management: 0=No, 1=Yes
multiAccountFlag
String
Support multiple accounting accounts: 0=No, 1=Yes
moveAvgPriceFlag
String
Use moving average for costing: 0=No, 1=Yes
auditPrintFlag
String
Require audit before printing: 0=No, 1=Yes
zeroChangeAmountFlag
String
Allow zero change amounts: 0=No, 1=Yes
customerStaticPriceFlag
String
Use static customer pricing: 0=No, 1=Yes

Other Fields

saleAgreement
String
Default sales agreement text or template
tenantId
Long
Associated tenant identifier
Reference: SystemConfig.java:1-253

Managing Configuration

Get Current Configuration

1

Retrieve Tenant Config

GET /systemConfig/getCurrentInfo
Returns the current tenant’s system configuration.Response:
{
  "code": 200,
  "data": {
    "id": 1,
    "companyName": "Example Corp",
    "companyAddress": "123 Business St",
    "minusStockFlag": "0",
    "multiLevelApprovalFlag": "1",
    "tenantId": 123
  }
}
Reference: SystemConfigController.java:136-152

Create Configuration

POST /systemConfig/add
Request Body:
{
  "companyName": "My Company Ltd",
  "companyAddress": "456 Enterprise Ave",
  "companyTel": "+1-555-0123",
  "companyContacts": "John Smith",
  "minusStockFlag": "0",
  "multiLevelApprovalFlag": "1",
  "forceApprovalFlag": "1",
  "updateUnitPriceFlag": "1",
  "moveAvgPriceFlag": "1"
}
Reference: SystemConfigController.java:85-91

Update Configuration

PUT /systemConfig/update
Configuration changes take effect immediately for all users in the tenant. Test changes carefully.
Reference: SystemConfigController.java:93-99

File Upload Configuration

jshERP supports file uploads for bills, financial documents, and materials with configurable storage backends.

File Upload Types

Configured via application.properties:
# File upload type: 1=Local Storage, 2=Alibaba Cloud OSS
file.uploadType=1

# Local storage path
file.path=/opt/jshERP/upload

# File size limits
spring.servlet.multipart.max-file-size=100MB
spring.servlet.multipart.max-request-size=100MB
Reference: SystemConfigController.java:50-60

Get File Size Limits

GET /systemConfig/fileSizeLimit
Returns the smaller of max-file-size or max-request-size. Reference: SystemConfigController.java:160-179

Upload Files

POST /systemConfig/upload?biz={bizType}
Parameters:
  • biz: Business type - “bill”, “financial”, or “material”
  • file: Multipart file data
Supported Storage Backends:
  1. Local Storage (uploadType=1): Files stored in configured local path
  2. Alibaba Cloud OSS (uploadType=2): Files uploaded to OSS bucket
Response:
{
  "code": 200,
  "data": "/upload/bill/abc123_document.pdf"
}
Reference: SystemConfigController.java:187-219

View Files

Standard View/Download

GET /systemConfig/static/{path}
Example: GET /systemConfig/static/bill/invoice_20240101.pdf Retrieves the file from configured storage (local or OSS) and streams it to the browser. Reference: SystemConfigController.java:228-286

Thumbnail View

GET /systemConfig/static/mini/{path}
Returns a resized thumbnail (80px width) for image files. Reference: SystemConfigController.java:293-338

Excel Export

jshERP provides a unified Excel export interface:
POST /systemConfig/exportExcelByParam
Request Body:
{
  "title": "Sales Report",
  "head": "Product ID,Product Name,Quantity,Price,Total",
  "tip": "Generated on 2024-01-15",
  "list": [
    {"productId": "P001", "name": "Widget A", "qty": 100, "price": 10.50, "total": 1050.00},
    {"productId": "P002", "name": "Widget B", "qty": 50, "price": 25.00, "total": 1250.00}
  ]
}
Parameters:
  • title: Excel file title
  • head: Comma-separated column headers
  • tip: Additional information displayed in header
  • list: Array of data objects
The system generates an Excel file and streams it as a download. Reference: SystemConfigController.java:344-357

API Endpoints Reference

Get Configuration by ID

GET /systemConfig/info?id={id}
Reference: SystemConfigController.java:62-74

List Configurations

GET /systemConfig/list?search={searchParams}
Search parameters:
  • companyName: Filter by company name
Reference: SystemConfigController.java:76-83

Delete Configuration

DELETE /systemConfig/delete?id={id}
DELETE /systemConfig/deleteBatch?ids={id1,id2,id3}
Deleting system configuration may cause system instability. Ensure you have backups before deletion.
Reference: SystemConfigController.java:101-115

Check Name Uniqueness

GET /systemConfig/checkIsNameExist?id={id}&name={name}
Reference: SystemConfigController.java:117-129

Configuration Best Practices

Inventory Management

Recommended Settings:
  • minusStockFlag=0: Prevent negative inventory to maintain accurate stock levels
  • depotFlag=1: Enable warehouse management for multi-location businesses
  • moveAvgPriceFlag=1: Use moving average costing for accurate valuations

Approval Workflows

1

Enable Multi-Level Approval

Set multiLevelApprovalFlag=1 for organizations requiring multiple approval stages.
2

Configure Force Approval

Set forceApprovalFlag=1 to require approval on all transactions, or 0 for selective approval.
3

Audit Before Print

Enable auditPrintFlag=1 to ensure documents are approved before printing.

Pricing Control

Important:
  • updateUnitPriceFlag=0: Lock unit prices to prevent unauthorized changes
  • customerStaticPriceFlag=1: Use fixed customer pricing for consistency
  • Combine with role-based price limits for comprehensive control

Document Management

Control whether bills can exceed linked document quantities:
  • 0: Strict linking (recommended for most businesses)
  • 1: Allow over-linking for flexible workflows
multiBillType
String
Enable if your business processes require multiple document types per transaction.

File Storage Configuration

Local Storage Setup

1

Set Upload Type

Configure in application.properties:
file.uploadType=1
2

Configure Path

file.path=/var/jshERP/uploads
Ensure the directory exists and has proper write permissions.
3

Set Size Limits

spring.servlet.multipart.max-file-size=50MB
spring.servlet.multipart.max-request-size=50MB

Alibaba Cloud OSS Setup

1

Set Upload Type

file.uploadType=2
2

Configure OSS Credentials

Add OSS configuration to your properties file (credentials managed by SystemConfigService).
3

Test Upload

Verify connectivity by uploading a test file.
Reference: SystemConfigController.java:187-219, SystemConfigService.java

Company Information Display

Company information from system configuration is automatically included in:
  • Printed Documents: Invoices, purchase orders, receipts
  • PDF Exports: Sales reports, financial statements
  • Email Templates: Order confirmations, shipment notices
  • System Header: Company name displayed in UI

Multi-Account Support

Enable multiAccountFlag=1 to support:
  • Multiple bank accounts per tenant
  • Different payment methods
  • Separate accounting books
  • Multi-currency transactions
Multi-account functionality requires additional configuration in the financial modules.

Business Rule Examples

Strict Inventory Control

{
  "minusStockFlag": "0",
  "depotFlag": "1",
  "moveAvgPriceFlag": "1",
  "inOutManageFlag": "1"
}
This configuration:
  • Prevents overselling (no negative stock)
  • Tracks inventory by warehouse
  • Uses moving average costing
  • Requires detailed inbound/outbound documentation

Flexible Sales Operations

{
  "minusStockFlag": "1",
  "updateUnitPriceFlag": "1",
  "overLinkBillFlag": "1",
  "forceApprovalFlag": "0"
}
This configuration:
  • Allows back-orders (negative stock)
  • Permits price adjustments
  • Enables over-shipping
  • Selective approval required

Compliance-Focused Setup

{
  "multiLevelApprovalFlag": "1",
  "forceApprovalFlag": "1",
  "auditPrintFlag": "1",
  "updateUnitPriceFlag": "0"
}
This configuration:
  • Requires multi-stage approval
  • All transactions need approval
  • Documents must be audited before printing
  • Prices cannot be modified

Troubleshooting

File Upload Issues

Common Problems:
  • Permission denied: Check directory write permissions
  • File size exceeded: Adjust max-file-size settings
  • OSS connection failed: Verify credentials and network access
  • Invalid biz type: Only “bill”, “financial”, and “material” are supported

Configuration Not Applying

1

Verify Tenant ID

Ensure configuration has correct tenantId.
2

Check Cache

Clear Redis cache if configuration changes don’t take effect.
3

Review Logs

Check application logs for configuration loading errors.

Build docs developers (and LLMs) love