NS Máquinas – Smart Purchasing

At NS Máquinas, more than 1 in 3 consumable order lines arrived late and stock checks were manual. Our app turns PHC data into a ready-to-review weekly list and supplier drafts, cutting about 8 h/week

  • 129 Raised
  • 141 Views
  • 2 Judges

Tags

  • Internal Processes

Categories

  • Automation
  • Data Handling
  • Room 3

Gallery

Description

NS Máquinas – Compras

Tagline: From the PHC ERP to a weekly purchasing decision: an AI-assisted proof of concept for consumables, now updating stock parameters in PHC.

Short description (≤ 200 characters): AI-assisted PoC that turns PHC ERP data into a weekly purchasing list based on real usage and real supplier lead times, and updates stock parameters in PHC after human approval.


PROBLEM

  • NS Máquinas buys machining consumables (family A15) by hand: check stock in PHC item by item, compare with a fixed minimum, decide quantities case by case, recall supplier lead times from memory, group needs by supplier in Excel, issue orders one by one and chase delays by email and phone. That is 7 manual steps across scattered sources.
  • More than 1 in 3 A15 lines arrived late: 851 of 2,255 delivered lines (37.7%), Jan 2022 to 23 Oct 2026.
  • 10.8 days average delay when late (median 6 days). 562 of 1,371 A15 orders had at least one late line.
  • 13 A15 items below minimum stock at the main warehouse (5 of them even counting open orders). 256 items below minimum across all families, from 50 suppliers.
  • Lead times are not updated from history, yet each supplier behaves differently: average lead time from 6.1 to 12.6 days among the top 5 A15 suppliers, with P90 up to 30.6 days.
  • ≈ 8 h/week of one person's manual work goes into this process *(NS estimate)*¹.

SOLUTION

An app that turns PHC data into a ready-to-review weekly purchasing decision.

  • Reads PHC automatically: stock, open orders, usage and delivery history, with no manual checking item by item.
  • Knows when and how much to order for each item, based on real usage instead of fixed minimums.
  • Uses each supplier's real lead time, learned from delivery history instead of memory.
  • Flags what needs attention: items to order and items to review, and groups the needs by supplier into a ready purchasing list.
  • Keeps PHC up to date: stock parameters are updated in PHC only after a person confirms, and every change is logged for audit.
  • Spots late deliveries and prepares follow-up email drafts for suppliers (in the proof of concept; never sent automatically).
  • People stay in control: Purchasing reviews, approves and decides.

RESULTS (measured at the Lab)

  • 75,857 purchase-order delivery lines analysed (Dec 2021 to Oct 2026), 372 suppliers, 17,553 distinct items.
  • 616 lines excluded by 6 data-quality rules, including 395 where the due date was before the order date (entry errors); 75,241 valid lines.
  • Family A15: 91 suppliers, 2,255 clean delivered lines used for the late-delivery analysis.
  • Working app (v0.12.4) connected to the live PHC database: weekly A15 purchasing list, needs grouped by supplier and confirmed updates of stock parameters in PHC. Published in the team's shared GitHub repository.
  • 95 automated tests written: 80 in the app and 15 in the proof-of-concept engine.
  • A15 annual usage read from the live PHC database and cross-checked directly in the database.
  • PHC supplier-order document mapped from real orders, as groundwork for creating orders directly in PHC.

BUILT AT THE LAB (26 to 27 October)

All times Lisbon time, from the project log.

  • 26 Oct 11:18 Project log started.
  • 11:19 First PHC connection job ready.
  • 11:34 Shared Slack channel connected for the team and Grok bots.
  • 11:41 Two PHC exports shared: late deliveries and items below minimum stock.
  • 11:47 Both exports analysed: 256 items below minimum; 75,857 delivery lines, 372 suppliers, 17,553 items.
  • 12:11 First proof of concept delivered by the Grok bots (real lead times and delays, email drafts).
  • 12:14 Scope decisions by the team: family A7 (abrasives) out of scope; lines with due date before order date excluded.
  • 12:19 Proof of concept rebuilt with the data-quality rules.
  • 15:21 A15 annual usage read from live PHC and validated.
  • 19:25 App and hourly progress log published in the shared repository.
  • 27 Oct 08:30 Last day starts: the team aims to have the app run autonomously and to prepare the final presentation.
  • 08:48 One-button purchasing flow in the app.
  • 09:28 Editable order parameters, warehouse-style wording, language choice and NS branding (v0.9 to v0.11).
  • 10:52 First update of PHC stock parameters, only after the user confirms (v0.12.0).
  • 11:39 Order multiple also updated in PHC, with an audit log of every change (v0.12.3).
  • 11:47 Final app version v0.12.4.
  • 12:03 Supplier-order document mapped in PHC from real orders, as groundwork for creating orders directly in PHC.
  • 12:38 Final presentation, Taikai page and images prepared; final description delivered.

ARCHITECTURE

  • PHC ERP (live database) → calculation engine → weekly purchasing list in Excel, grouped by supplier → human review and approval → stock parameters updated in PHC, with an audit log.
  • Historical PHC exports feed the delivery and lead-time analysis.

TECHNOLOGY

  • Python app with a simple desktop window, connected to PHC on SQL Server; Excel output.
  • Data analysis and charts in Python for the proof of concept; automated tests.
  • Cursor and Grok bots for development, data analysis and the progress log; Slack for team coordination; GitHub for shared code.

WHY NOW / OUR PLAN

  • The data is already in PHC, and the delivery history shows the cost of the manual process: more than 1 in 3 A15 lines late.
  • Plan:
    1. Proof of concept (done): weekly A15 purchasing list, real lead times, needs by supplier and confirmed updates of stock parameters in PHC.
    2. Validate: results reviewed point by point with Purchasing.
    3. In progress — supplier orders in PHC: create supplier orders in PHC directly from the purchasing list. Not implemented yet: no order is created in PHC today.
    4. Then: validate each order and send it to the supplier by email with its PDF.
    5. More families: extend beyond A15 (256 items below minimum across all families).
    6. Other PHC companies and MRP on always-current data.
  • Our ask: help us validate the PoC with NS Máquinas Purchasing and with other companies running PHC, so it can grow into an advanced purchasing module for PHC and other ERPs.

¹ ≈ 8 h/week is an NS Máquinas estimate, not a measurement. ² Data sources: PHC delivery-history export (real), PHC below-minimum-stock snapshot of 23 Oct 2026 (real), project log, app repository and proof-of-concept results.

Attachments