Search by

jaizendra-netizen / partner-sourced-pipeline-report

onegtmlab

PHP CLI and library: split a deal list into partner-sourced and direct pipeline, with open pipeline, won amount, win rate and a ranking of partners by won amount.

Package info

github.com/jaizendra-netizen/partner-sourced-pipeline-report

Homepage

Type:project

pkg:composer/jaizendra-netizen/partner-sourced-pipeline-report

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-11-29 00:07 UTC

This package is not auto-updated.

Last update: 2026-11-29 22:29:38 UTC


README

PHP command line tool and library. Give it a CSV of deals with a source type (partner or direct), the partner name, a status (open, won or lost) and an amount, and it prints for each source type the number of deals, the open pipeline amount, the won amount and the win rate. It then shows the partner share of open pipeline and of won revenue, and ranks the partners by won amount. Win rate is counted in deals: won deals divided by won plus lost deals, and it prints n/a when nothing has closed. Shares print n/a when the total is zero. Amounts are summed exactly in whole cents.

Part of the OneGTMLab free GTM tools. Background on the idea: channel partner.

Install

composer require jaizendra-netizen/partner-sourced-pipeline-report

Use

Input is a CSV with the columns deal_id, source_type, partner, status and amount. Column names are matched without regard to case and may be in any order. source_type is partner or direct (any case); status is open, won or lost; amount is a number of 0 or more written like 1500 or 1500.50, with no currency symbol and no thousands separator. A partner deal must name its partner; the partner column is ignored for direct deals. The command stops at the first bad row and names it. A bad source_type, status or amount, a partner deal with no partner name, a missing column, a row with the wrong number of cells or a file with no deals exits 1 with a message; an unreadable file or a missing argument exits 2.

$ php bin/partner-sourced-pipeline-report sample.csv
deals: 10
partner: 6 deals, open pipeline 14000.00, won 20000.00, win rate 75.0%
direct: 4 deals, open pipeline 10000.00, won 27000.00, win rate 66.7%
partner share of open pipeline: 58.3%
partner share of won revenue: 42.6%
partners by won amount:
  Partner A: won deals 2, won amount 15000.00
  Partner B: won deals 1, won amount 5000.00
  Partner C: won deals 0, won amount 0.00

Test

php tests/run.php

Offline, no network calls, no dependencies beyond the language runtime. MIT licensed.