Skip to content
create-purchase-order logo

Create Purchase Order Skill

create-purchase-order

Create purchase order (PO) in NexERP database

SKILL.md

Full skill instructions

Create Purchase Order Skill

Creates a purchase order (PO) record in the NexERP system. A purchase order represents goods/​services to be ordered from a supplier.

Usage

python main.py \
  --supplier-name "ACTION BOLT" \
  --order-date "2025-10-26" \
  --items '[{"product_name": "WIRE D1.2", "quantity": 100, "unit_price": 10.50}]' \
  --json

Required Fields

  • --supplier-name: Supplier name (fuzzy match supported)
  • --order-date: Order date (YYYY-MM-DD format)
  • --items: JSON array of line items

Item Fields

Each item must have:

  • product_name: Product name or SKU (fuzzy match supported)
  • quantity: Quantity to order (positive number)
  • unit_price: Price per unit

Optional item fields:

  • discount: Line discount percentage (0-100)
  • remark: Line item remark/​notes

Optional PO Fields

  • --supplier-ref: Supplier's reference number
  • --expiry-date: PO expiry date (YYYY-MM-DD)
  • --tax-rate: Tax rate as decimal (default: 0.06 for 6% tax)
  • --remark: PO remark/​notes

Output

Returns JSON with PO details:

{
  "success": true,
  "po_number": "PO25100036",
  "txn_id": 2126,
  "supplier": "ACTION BOLT & NUTS SDN BHD",
  "order_date": "2025-10-26",
  "items_count": 1,
  "subtotal": 1050.00,
  "tax": 63.00,
  "grand_total": 1113.00,
  "status": "Pending"
}

Error Handling

Returns error JSON if:

  • Supplier not found (suggests alternatives)
  • Product not found for any item
  • Invalid date format
  • Invalid amounts or quantities
  • Database connection fails

Database Tables

Writes to 3 tables:

  1. tbl_porder_txn - PO header
  2. tbl_porder_item - Line items
  3. tbl_porder_movement - Stock movement tracking

Document Number Format

PO numbers follow pattern: PO{YY}{MM}{NNNN}

  • Example: PO25100036 = October 2025, PO #36

Business Rules

  • Supplier must exist and be active (Status_i = 1)
  • Products must exist in tbl_product_code
  • Order date must be valid date format
  • Quantities must be positive
  • Amounts rounded to 2 decimal places
  • Default tax rate: 6% (for purchase orders)
  • PO status defaults to 'P' (Pending)
  • Automatic calculation: SubTotal + Tax = GrandTotal

PO Status Values

  • P: Pending (default)
  • A: Approved
  • C: Confirmed
  • R: Received
  • X: Cancelled

Integration

This skill is called by the Database Agent when processing purchase order documents.

Examples

Single Item PO

python main.py \
  --supplier-name "ACTION" \
  --order-date "2025-10-26" \
  --items '[{"product_name": "WIRE D1.2-L105.8", "quantity": 100, "unit_price": 10.50}]' \
  --json

Multi-Item PO with Expiry Date

python main.py \
  --supplier-name "NINGBO" \
  --order-date "2025-10-26" \
  --expiry-date "2025-11-26" \
  --supplier-ref "REF-2025-ABC" \
  --items '[
    {"product_name": "WIRE D1.2", "quantity": 200, "unit_price": 5.00},
    {"product_name": "BOLT M10", "quantity": 1000, "unit_price": 0.50, "discount": 15}
  ]' \
  --remark "Urgent order - deliver by Nov 15" \
  --json

With Custom Tax Rate

python main.py \
  --supplier-name "Dell" \
  --order-date "2025-10-26" \
  --items '[{"product_name": "Laptop", "quantity": 5, "unit_price": 3500.00}]' \
  --tax-rate 0.08 \
  --json

Testing

# Test with verbose output
python main.py --supplier-name "ACTION" --order-date "2025-10-26" \
  --items '[{"product_name": "WIRE", "quantity": 50, "unit_price": 10.00}]' \
  --verbose --json

# Test error handling (invalid supplier)
python main.py --supplier-name "XYZ_NONEXISTENT" --order-date "2025-10-26" \
  --items '[{"product_name": "WIRE", "quantity": 50, "unit_price": 10.00}]' \
  --json

Exit Codes

  • 0: Success
  • 1: Error (invalid input, database error)
  • 2: Not found (supplier/​product not found)

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View