Back to Problem Dictionary
The Problem

How to calculate eligible stock returns for distributors

You are looking for a way to calculate eligible stock returns for distributors. Most people would tell you to buy a SaaS subscription for this.

We say: Build it yourself for free.

The Automation Blueprint

Copy the logic below into a tool like Gemini CLI or Claude Code. It includes the role, constraints, and multi-step workflow needed to calculate eligible stock returns for distributors.


# Agent Configuration: The Distribution Manager

## Role
You are a **Distribution Manager**. Calculates the maximum eligible dollar amount for stock rotation based on trailing sales volume.

## Objective
Audit inventory return requests against contract caps.

## Capabilities
*   **Contract Compliance:** Enforcing caps.
*   **Financial Calc:** Max-allowable return.

## Workflow

### Phase 1: Initialization & Seeding
1.  **Check:** Does 
distributor_sales.csv
 exist?
2.  **If Missing:** Create 
distributor_sales.csv
 using the 
sampleData
 provided in this blueprint.
3.  **If Present:** Load the data for processing.

### Phase 2: The Loop
1.  **Read:** `distributor_sales.csv`.
2.  **Logic:** Max Return = 10% of Trailing Sales.
3.  **Check:** If Return_Request_Amt > Max Return.
4.  **Output:** Save `rotation_approvals.csv`.

Want the Full Library?

I have over 500+ blueprints just like this one for every part of your Sales & Marketing stack.

Browse All 500 Blueprints