Revolutionizing Pricing & Cost Management: How I Built an Automated Pricing System with ERP•AI

By
ProfileERP•AI Bureau

Managing real-time purchase and selling price calculations for Raw Materials (RM), Semi-Finished Goods (SFG), and Finished Goods (FG) has always been a challenge for manufacturers. Constant price fluctuations, manual calculations, and errors lead to inefficiencies and financial discrepancies. But what if you could automate the entire process?

That’s exactly what I did using ERP•AI. I built an Automated Purchase Price & Selling Price Calculation System—a fully integrated solution that dynamically updates purchase and selling prices based on Bill of Materials (BOM) modifications. No manual tracking, no outdated prices - just real-time, accurate calculations. Here’s how I built it step by step.


App Overview

App Overview

This system automatically updates the purchase price of SFG and FG whenever an RM price is modified. Additionally, a profit margin field ensures selling prices are calculated dynamically at each level. With automation workflows, role-based access, and logging mechanisms, the system guarantees accuracy and transparency in pricing calculations.

Key Features:

  • Automated Purchase Price Updates across BOM
  • Dynamic Selling Price Calculations based on profit margins
  • Real-Time Data Syncing for all pricing levels
  • Role-Based Access Control for pricing modifications
  • Price Update Logs for auditing and tracking

Step 1: Build the Core App Using ‘Create App Agent’

I started by using the Create App Agent in ERP•AI to generate the application framework. Here’s the structured prompt I used to ensure the system was built with all the necessary components:

Build an app that should handle real-time purchase and selling price calculations for Raw Materials (RM), Semi-Finished Goods (SFG), and Finished Goods (FG) based on Bill of Materials (BOM).

**1. App Overview**

The system must automatically update the purchase price of SFG and FG whenever the RM purchase price is modified.
A profit margin field should be available at RM, SFG, and FG levels to automatically determine the selling price.
Prices should dynamically update across BOMs, ensuring real-time consistency.

**2. Database Schema & Key Entities**

**Raw Material (RM) Table:**
RM ID (Primary Key)
Name
Purchase Price
Profit Margin (Absolute/Percentage)
Selling Price (Auto-calculated)

**Semi-Finished Goods (SFG) Table:**
SFG ID (Primary Key)
Name
BOM (List of RM and their Quantities)
Purchase Price (Auto-calculated based on RM prices)
Profit Margin (Admin-defined)
Selling Price (Auto-calculated)

**Finished Goods (FG) Table:**
FG ID (Primary Key)
Name
BOM (List of SFGs and RMs with Quantities)
Purchase Price (Auto-calculated based on SFG and RM prices)
Profit Margin (Admin-defined)
Selling Price (Auto-calculated)

**3. Automated Pricing Calculations

3.1 SFG Purchase Price Calculation**
When an RM price is updated, recalculate the purchase price of all SFGs where this RM is used.

**3.2 FG Purchase Price Calculation**
When an SFG price is updated, recalculate all FG prices that contain this SFG.

**3.3 Selling Price Calculation with Profit Margin**
Profit margin field available at RM, SFG, and FG levels (Absolute Value or Percentage).
Selling price updates should reflect in the Sales Price Column or the Sales Pricelist.

**4. System Behavior & Automation**

Trigger: RM price update → Auto-update SFG price → Auto-update FG price → Apply profit margin → Update Selling Price.
Ensure all calculations execute in real-time or upon saving the changes.
Historical transactions should remain unchanged.

ERP•AI immediately broke down this request and generated:

  • Master Tables for RM, SFG, FG, and BOM

Masters

  • Views for different product types

Views

  • Dashboards for real-time price tracking

Dashboard

  • Reports to understand overall pricing and costing of products

Reports


Step 2: Set Up Pricing Logic Using ‘Edit App Agent’

Once the base structure was created, I refined the pricing logic by using the Edit App Agent to define formulas for automatic price recalculations.

“SFG Purchase Price Calculation:

(SFG Purchase Price) = Sum of (RM Price × Quantity in BOM)

FG Purchase Price Calculation:

(FG Purchase Price) = Sum of (SFG Price × Quantity) + Sum of (RM Price × Quantity)

Selling Price Calculation with Profit Margin:

(Selling Price) = Purchase Price + (Purchase Price × Profit Margin %)”

I prompted the Edit App Agent to embed these formulas into the system, ensuring that any change in RM prices cascaded across SFG and FG dynamically.

Edit App


Step 3: Configure Role Permissions Using ‘Roles Agent’

Since pricing data is sensitive, I used the Roles Agent to define specific access levels:

  • Admin: Can modify RM prices and profit margins
  • Finance Team: Can view all pricing calculations and audit logs
  • Sales Team: Can only view selling prices, without access to cost structures

I simply prompted:

"Create an Admin role with full pricing control and a Sales role with view-only access to selling prices."

Roles

The Roles Agent instantly configured access permissions accordingly.


Step 4: Automate Price Updates Using ‘Automation Workflows’

To automate critical discussion reminders, I set up an automation workflow to handle cost increases. Here’s how:

  1. Trigger: Whenever an Finished Good’s cost is updated more than 10000
  2. Action: Send an email to my boss “silvia@packproinc.com” that we need to discuss on cost cutting.

Automation

With just a few clicks, ERP•AI automated the entire process and now I’ll never have to worry about delayed decision making.


Step 5: Real-Time Price Insights with ‘Dashboard Agent’

To ensure clear visibility, I used the Dashboard Agent to create real-time pricing chart by prompting that I needed a pie chart for:

  • Material Cost Trends (Tracks RM price fluctuations over time)

Edit Dashboard App

Now, all pricing insights can be accessible in one place, making strategic decision-making easier.


Step 6: Testing with Synthetic Data

Before launching, I used ERP•AI’s synthetic data generator to simulate real-world scenarios. This helped me validate:

✔ Price recalculations were accurate

✔ Selling prices reflected correct profit margins

✔ Automation workflows triggered without delay

✔ Role-based access controls worked as expected

Synthetic Records

Once testing was successful, I onboarded my team with confidence.


The Final Result: A Fully Automated Pricing System

In just a few steps, I created an intelligent pricing system that:

Eliminates Manual Pricing Errors

Ensures Real-Time Price Updates

Optimizes Profit Margins Instantly

Provides Secure Role-Based Access

Enhances Financial Transparency

What used to take hours of manual calculations is now done instantly with ERP•AI. Whether you're a manufacturer, wholesaler, or distributor, this system ensures that your pricing is always accurate and up to date.

Want to automate your pricing strategy? Try it now on ERP•AI and transform your business! 🚀