Skip to content
create-purchase-receipt logo

Create Purchase Receipt Skill

create-purchase-receipt

Create goods receipt (GR) record when receiving goods from supplier

SKILL.md

Full skill instructions

Create Purchase Receipt Skill

Purpose

Creates a Goods Receipt (GR) record in NexERP when goods are physically received from a supplier. This is triggered by a Delivery Order from the supplier.

When to Use

  • Supplier truck arrives with goods
  • Driver provides Delivery Order (DO)
  • Warehouse receives and inspects goods
  • Need to update inventory levels

Database Tables

  • tbl_preceipt_txn - Goods receipt header
  • tbl_preceipt_item - Line items received
  • tbl_preceipt_movement - Inventory movement records

Usage

python create-purchase-receipt/​main.py \
  --supplier-name "NINGBO METALWIRE" \
  --receipt-date "2025-10-27" \
  --items '[
    {
      "product_name": "WIRE D1.2-L105.8",
      "quantity": 200,
      "unit_price": 8.50,
      "po_reference": "PO25100055"
    }
  ]' \
  --delivery-order "DO-2024000" \
  --json

Required Fields

FieldTypeDescription
supplier_namestringSupplier name (fuzzy match)
receipt_datestringReceipt date (YYYY-MM-DD)
itemsJSON arrayLine items received

Optional Fields

FieldTypeDescription
delivery_orderstringSupplier's DO number
po_referencestringRelated PO number
remarkstringAny notes

Item Fields

FieldRequiredDescription
product_nameYesProduct name or SKU
quantityYesQuantity received
unit_priceYesPrice per unit
discountNoDiscount percentage (0-100)
remarkNoItem-specific notes

Output (JSON)

Success

{
  "success": true,
  "gr_number": "GR25100048",
  "txn_id": 2210,
  "supplier": "NINGBO METALWIRE PRODUCTS CO.,LTD",
  "receipt_date": "2025-10-27",
  "items_count": 1,
  "subtotal": 1700.00,
  "grand_total": 1700.00,
  "delivery_order": "DO-2024000"
}

Error

{
  "success": false,
  "error": "Supplier 'XYZ' not found"
}

Document Number Format

  • Format: GR{YY}{MM}{NNNN}
  • Example: GR25100048 = October 2025, receipt #48

Business Rules

  1. Supplier Validation: Must exist in tbl_supplier
  2. Product Validation: Must exist in tbl_product_code
  3. Inventory Update: Automatically updates stock levels
  4. PO Linking: Can link to existing PO for tracking
  5. No Tax Calculation: GR records quantities only (tax on invoice)

Example Scenarios

Scenario 1: Full Delivery

# All items from PO received
python create-purchase-receipt/​main.py \
  --supplier-name "ACTION BOLT" \
  --receipt-date "2025-10-27" \
  --items '[
    {"product_name": "WIRE D1.2", "quantity": 200, "unit_price": 8.50}
  ]' \
  --po-reference "PO25100055" \
  --json

Scenario 2: Partial Delivery

# Only 150 out of 200 units received
python create-purchase-receipt/​main.py \
  --supplier-name "ACTION BOLT" \
  --receipt-date "2025-10-27" \
  --items '[
    {"product_name": "WIRE D1.2", "quantity": 150, "unit_price": 8.50}
  ]' \
  --po-reference "PO25100055" \
  --remark "Partial delivery - 50 units backordered" \
  --json

Scenario 3: Multi-Item Delivery

python create-purchase-receipt/​main.py \
  --supplier-name "NINGBO" \
  --receipt-date "2025-10-27" \
  --delivery-order "DO-2024000" \
  --items '[
    {"product_name": "WIRE D1.2-L105.8", "quantity": 100, "unit_price": 8.50},
    {"product_name": "WIRE D0.8-L133.5", "quantity": 200, "unit_price": 7.30}
  ]' \
  --json

Integration with Database Agent

# After Document Agent extracts Delivery Order
extracted_data = {
    "document_type": "delivery_order",
    "issuer": "NINGBO METALWIRE PRODUCTS CO.,LTD",
    "do_number": "DO-2024000",
    "po_reference": "PO25100054",
    "delivery_date": "2025-10-27",
    "line_items": [
        {"description": "WIRE D1.2-L105.8", "qty_delivered": 100, "unit_price": 8.50}
    ]
}

# Call skill via Bash
result = bash_tool.execute(
    f"python skills/​purchasing/​create-purchase-receipt/​main.py "
    f"--supplier-name '{extracted_data['issuer']}' "
    f"--receipt-date '{extracted_data['delivery_date']}' "
    f"--delivery-order '{extracted_data['do_number']}' "
    f"--items '{json.dumps(items)}' "
    "--json"
)

Error Handling

ErrorCauseSolution
Supplier not foundInvalid supplier nameCheck tbl_supplier
Product not foundInvalid SKU/​nameCheck tbl_product_code
Invalid dateWrong date formatUse YYYY-MM-DD
Negative quantityInvalid inputQuantity must be > 0

Testing

# Test with sample delivery order
python create-purchase-receipt/​main.py \
  --supplier-name "NINGBO" \
  --receipt-date "2025-10-27" \
  --items '[{"product_name": "WIRE D1.2", "quantity": 50, "unit_price": 8.50}]' \
  --verbose --json

Notes

  • GR updates inventory immediately
  • Can create GR without PO (direct receipt)
  • Multiple GRs can reference same PO (partial deliveries)
  • GR is the SOURCE for Purchase Return (if defects found)

Database: carrickc (MariaDB) Tables: tbl_preceipt_txn, tbl_preceipt_item, tbl_preceipt_movement Document Format: GR25100048 Inventory Impact: Yes (increases stock)

More Finance & Trading skills

ponytail-debt logo
Finance & Trading

ponytail-debt

Harvest every `ponytail:` comment in the codebase into a debt ledger, so the deliberate shortcuts and deferrals ponytail leaves behind get tracked instead of rotting into "later means never". One-shot report, changes nothing.

155.5K 27.9K
View
stripe-integration logo
Finance & Trading

stripe-integration

Stripe payment processing with checkout sessions, subscriptions, webhooks, and customer management.

40.2K 12.9K
View

Build comprehensive 3-5 year financial models with revenue projections, cost structures, cash flow analysis, and scenario planning for early-stage startups. Use this skill when creating financial projections, calculating burn rate or runway, modeling fundraising scenarios, or preparing investor-r...

40.2K 12K
View
stock-analysis logo
Finance & Trading

stock-analysis

Stock and cryptocurrency analysis with portfolio management and multi-dimensional scoring.

46 11.9K
View
coinglass logo
Finance & Trading

coinglass

Real-time crypto derivatives positioning, whale tracking, liquidations, and institutional ETF flows across 37 specialized tools.

27 11.5K
View

Master dbt (data build tool) for analytics engineering with model organization, testing, documentation, and incremental strategies. Use when building data transformations, creating data models, or implementing analytics engineering best practices.

40.2K 10.5K
View

Finance AI tools

C

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

Freemium
View
Finalle.ai logo
Finance

Finalle.ai

Stay Ahead with Finalle.ai: The Ultimate Financial News and Tools Platform

Free
View

AI-powered Pine Script code generator for TradingView

Paid
View
TradeUI logo
Finance

TradeUI

Empower your investment strategies with AI signals, option flow data, and advanced chart patterns.

Paid
View
D
Finance

Danelfin

Danelfin review covering its AI stock and ETF scores, rankings, portfolio tools, current pricing, strengths, risks, and alternatives for investors.

Freemium
View
E
Finance

Ellisense

A software for comprehensive market sentiment analysis.

Paid
View

'Stock Correlations' App by Freshly.ai: Reveal Stock Patterns and Trends

Free
View