No Description

name e8c5fcfacb zjj 测试提交 1 month ago
upsystem e8c5fcfacb zjj 测试提交 1 month ago
.editorconfig e77a387817 feat: Initialize App 2 months ago
.eslintrc e77a387817 feat: Initialize App 2 months ago
.gitignore e77a387817 feat: Initialize App 2 months ago
.pre-commit-config.yaml e77a387817 feat: Initialize App 2 months ago
README.md 6f63686660 feat: 添加客户缩写功能,支持SKU编码系统 2 months ago
license.txt e77a387817 feat: Initialize App 2 months ago
pyproject.toml e77a387817 feat: Initialize App 2 months ago

README.md

Upsystem

up

Features

Customer Abbreviation System

  • Automatic Generation: Automatically generates 3-character customer abbreviations based on customer names
  • Smart Conflict Resolution: Handles duplicate abbreviations using numbers (1-9) and letters (A-W)
  • SKU Integration Ready: Designed to work with SKU encoding systems
  • Validation: Ensures unique, properly formatted abbreviations

Abbreviation Generation Rules:

  1. Takes first 2 characters from customer name
  2. If conflicts exist, appends numbers 1-9
  3. If still conflicts, appends letters A-W
  4. Falls back to numeric sequences if needed

Installation

You can install this app using the bench CLI:

cd $PATH_TO_YOUR_BENCH
bench get-app $URL_OF_THIS_REPO --branch develop
bench install-app upsystem

Note: After installation, existing customers will automatically get abbreviations generated.

Testing

To test the abbreviation generation logic:

bench --site <site> console

Then run:

exec(open('apps/upsystem/upsystem/test_customer_abbr.py').read())

Contributing

This app uses pre-commit for code formatting and linting. Please install pre-commit and enable it for this repository:

cd apps/upsystem
pre-commit install

Pre-commit is configured to use the following tools for checking and formatting your code:

  • ruff
  • eslint
  • prettier
  • pyupgrade

License

mit