# claude · R1D · run 4
- Model requested: `claude-opus-5-5` · reported: `claude-opus-5-5`
- Started 2026-12-04T22:09:03+05:30 · finished 2026-12-04T22:10:57+05:30 · latency 114 s
- Tokens: {"in": 194523, "out": 10673, "cache_read": 0, "cache_write": 0} · cost estimate $0.992
- System prompt: none · effort: medium
## Prompt
```
Net revenue fell in October compared with September. Why?
Net revenue means invoices minus credit notes; use that for the total and for every breakdown.
```
Files attached: invoices.csv, credit_notes.csv, customers.csv, columns_note.txt
## Transcript
**Code (bash_code_execution):**
```
cd $INPUT_DIR; cat columns_note.txt; for f in *.csv; do echo "== $f"; wc -l $f; head -5 $f; done
```
**Output:**
```
Indigo Thread Co. - export from the ERP (sales ledger). Three tables, CSV, all history from April 2024 up to 31 Oct 2026.
Amounts are in Indian rupees (INR) unless a column says otherwise.
invoices.csv - one row per sales invoice
invoice_id internal id of the invoice
invoice_no invoice number as printed
invoice_date date of the invoice
customer_id links to customers.customer_id
currency currency the invoice was raised in (INR or EUR)
fx_rate rupees per unit of that currency, used to convert
amount_fc amount in the invoice currency (blank for INR invoices)
net_amount invoice value in INR, before GST
gst_amount GST charged, in INR
gross_amount net_amount + gst_amount
order_ref sales order the invoice was raised against
created_at when the row was entered in the ERP
credit_notes.csv - one row per credit note issued to a customer
cn_id internal id of the credit note
cn_no credit note number
cn_date date of the credit note
invoice_id the invoice it credits (links to invoices.invoice_id)
customer_id links to customers.customer_id
net_amount credit value in INR, before GST (a positive number that reduces revenue)
gst_amount GST reversed, in INR
reason reason recorded for the credit
created_at when the row was entered in the ERP
customers.csv - one row per customer account
customer_id internal id
customer_code customer code
name customer name
region sales region the account is managed under (South, West, East, North, Export)
city customer's city
segment account size band used by sales (key, mid, small)
currency usual invoicing currency
status account status in the ERP (active / inactive)
payment_terms_days agreed payment terms in days
credit_limit credit limit in INR
created_at when the account was created
Net revenue, as the company reports it from these tables: invoice net_amount minus credit note net_amount, by date.
== credit_notes.csv
861 credit_notes.csv
cn_id,cn_no,cn_date,invoice_id,customer_id,net_amount,gst_amount,reason,created_at
1,CN/000001,2024-04-08,5448,50,3874.57,193.73,Quality claim,2024-04-08 16:30:56
2,CN/000002,2024-04-10,5433,142,5507.46,275.37,Return,2024-04-10 15:27:01
3,CN/000003,2024-04-13,5489,6,18492.12,924.61,Rate difference,2024-04-13 14:00:56
4,CN/000004,2024-04-18,5441,143,5035.80,251.79,Quality claim,2024-04-18 16:26:02
== customers.csv
144 customers.csv
customer_id,customer_code,name,region,city,segment,currency,status,payment_terms_days,credit_limit,created_at
1,C0001,Ravira Exports,South,Tiruppur,key,INR,active,30,33600000.00,2023-08-05 17:08:04
2,C0002,Tessora EU,South,Rotterdam,key,EUR,active,45,43700000.00,2021-12-11 17:53:30
3,C0003,Skarfab,South,Aarhus,key,EUR,active,45,22800000.00,2022-05-07 16:51:47
4,C0004,Merai Apparels,West,Mumbai,key,INR,active,30,15600000.00,2022-03-02 17:53:33
== invoices.csv
8773 invoices.csv
invoice_id,invoice_no,invoice_date,customer_id,currency,fx_rate,amount_fc,net_amount,gst_amount,gross_amount,order_ref,created_at
5411,BI/2425/000001,2024-04-01,11,INR,1.0000,,117738.91,5886.95,123625.86,SO-24005358,2024-04-01 18:43:04
5412,BI/2425/000002,2024-04-01,21,EUR,100.6756,3671.50,369630.47,0.00,369630.47,SO-24005296,2024-04-01 17:59:42
5413,BI/2425/000003,2024-04-01,95,INR,1.0000,,67337.59,3366.88,70704.47,SO-24005494,2024-04-01 19:00:03
5414,BI/2425/000004,2024-04-01,99,INR,1.0000,,56480.17,2824.01,59304.18,SO-24005522,2024-04-01 19:02:32
```
Thinking (summary)
I'm starting the exploration with pandas, and I want to check for data quality problems as I go. The things to look for are duplicate rows, region values that look wrong (like EUR customers listed under South), currency conversion issues, and inconsistent date formats.
**Code (bash_code_execution):**
```
cd $INPUT_DIR; python3 -c "
import pandas as pd
i=pd.read_csv('invoices.csv');c=pd.read_csv('credit_notes.csv');cu=pd.read_csv('customers.csv')
for d in (i,c,cu): print(d.dtypes,d.isna().sum(),sep='\n')
print(i.invoice_date.str.len().value_counts(), c.cn_date.str.len().value_counts())
print(i.invoice_id.duplicated().sum(), i.invoice_no.duplicated().sum(), c.cn_no.duplicated().sum(), c.cn_id.duplicated().sum())
print(i.duplicated(subset=['invoice_date','customer_id','net_amount','order_ref']).sum())
print(cu.region.value_counts(), cu.currency.value_counts(), pd.crosstab(cu.region,cu.currency))
print(i.currency.value_counts()); print(i.describe())
"
```
**Output:**
```
invoice_id int64
invoice_no object
invoice_date object
customer_id int64
currency object
fx_rate float64
amount_fc float64
net_amount float64
gst_amount float64
gross_amount float64
order_ref object
created_at object
dtype: object
invoice_id 0
invoice_no 0
invoice_date 0
customer_id 0
currency 0
fx_rate 0
amount_fc 7212
net_amount 0
gst_amount 0
gross_amount 0
order_ref 0
created_at 0
dtype: int64
cn_id int64
cn_no object
cn_date object
invoice_id int64
customer_id int64
net_amount float64
gst_amount float64
reason object
created_at object
dtype: object
cn_id 0
cn_no 0
cn_date 0
invoice_id 0
customer_id 0
net_amount 0
gst_amount 0
reason 0
created_at 0
dtype: int64
customer_id int64
customer_code object
name object
region object
city object
segment object
currency object
status object
payment_terms_days int64
credit_limit float64
created_at object
dtype: object
customer_id 0
customer_code 0
name 0
region 0
city 0
segment 0
currency 0
status 0
payment_terms_days 0
credit_limit 0
created_at 0
dtype: int64
invoice_date
10 8772
Name: count, dtype: int64 cn_date
10 860
Name: count, dtype: int64
0 0 0 0
0
region
South 72
West 25
North 21
East 14
Export 11
Name: count, dtype: int64 currency
INR 115
EUR 28
Name: count, dtype: int64 currency EUR INR
region
East 2 12
Export 11 0
North 5 16
South 4 68
West 6 19
currency
INR 7212
EUR 1560
Name: count, dtype: int64
invoice_id customer_id ... gst_amount gross_amount
count 8772.000000 8772.000000 ... 8772.000000 8.772000e+03
mean 9796.500000 70.849407 ... 5023.184226 1.682085e+05
std 2532.402614 44.754645 ... 8836.928822 2.335798e+05
min 5411.000000 1.000000 ... 0.000000 1.055181e+04
25% 7603.750000 27.750000 ... 1484.210000 4.535273e+04
50% 9796.500000 75.000000 ... 2415.685000 6.966978e+04
75% 11989.250000 112.000000 ... 4128.520000 2.355243e+05
max 14182.000000 143.000000 ... 131677.080000 3.041255e+06
[8 rows x 7 columns]
```
**Code (bash_code_execution):**
```
cd $INPUT_DIR; cat > /tmp/a.py <<'EOF'
import pandas as pd
pd.set_option('display.width',250); pd.set_option('display.max_columns',30)
i=pd.read_csv('invoices.csv',parse_dates=['invoice_date','created_at']);c=pd.read_csv('credit_notes.csv',parse_dates=['cn_date','created_at']);cu=pd.read_csv('customers.csv')
i['m']=i.invoice_date.dt.to_period('M');c['m']=c.cn_date.dt.to_period('M')
m=pd.DataFrame({'inv':i.groupby('m').net_amount.sum(),'n_inv':i.groupby('m').size(),'cn':c.groupby('m').net_amount.sum(),'n_cn':c.groupby('m').size()}).fillna(0)
m['net']=m.inv-m.cn
print(m.tail(14).round(0))
# checks
print('gross mismatch',((i.net_amount+i.gst_amount-i.gross_amount).abs()>1).sum())
e=i[i.currency=='EUR']; print('fx mismatch',((e.amount_fc*e.fx_rate-e.net_amount).abs()>1).sum())
print(e.groupby('m').fx_rate.agg(['min','mean','max']).tail(8))
print('created lag', (i.created_at-i.invoice_date).dt.days.describe())
print('cn lag', (c.created_at-c.cn_date).dt.days.describe())
EOF
python3 /tmp/a.py
```
**Output:**
```
inv n_inv cn n_cn net
m
2025-09 47974220.0 297 682390.0 34 47291830.0
2025-10 47147730.0 324 750519.0 33 46397211.0
2025-11 45870502.0 254 391855.0 16 45478648.0
2025-12 48114703.0 326 803797.0 36 47310906.0
2026-01 45385563.0 303 410786.0 31 44974777.0
2026-02 45988712.0 272 531858.0 21 45456854.0
2026-03 53105676.0 346 685936.0 26 52419740.0
2026-04 47731256.0 274 1010248.0 32 46721008.0
2026-05 48341390.0 293 697792.0 33 47643599.0
2026-06 50169114.0 267 1064355.0 25 49104759.0
2026-07 48135248.0 245 485701.0 24 47649547.0
2026-08 45434672.0 237 692084.0 25 44742587.0
2026-09 49066633.0 293 867445.0 26 48199188.0
2026-10 47843737.0 319 1492156.0 30 46351580.0
gross mismatch 0
fx mismatch 0
min mean max
m
2026-03 100.1319 100.905982 102.3902
2026-04 100.4245 100.818667 101.3215
2026-05 100.5309 101.015526 101.2682
2026-06 100.4875 100.928635 101.3073
2026-07 99.2065 99.868319 101.0992
2026-08 97.4052 99.058422 99.8603
2026-09 97.1758 98.205645 99.4184
2026-10 99.7760 100.271650 101.0472
created lag count 8772.0
mean 0.0
std 0.0
min 0.0
25% 0.0
50% 0.0
75% 0.0
max 0.0
dtype: float64
cn lag count 860.000000
mean 0.018605
std 0.385570
min 0.000000
25% 0.000000
50% 0.000000
75% 0.000000
max 8.000000
dtype: float64
```
Thinking (summary)
The net figure falls from 48.20M to 46.35M, a drop of 1.85M, with invoices accounting for -1.22M and credit notes for +0.62M. Next I'm breaking it down by region, segment, customer, currency, and reason. I also need to check whether credit notes were backdated, with a lag of up to 8 days, and whether any reference invoices belonging to other customers.
**Code (bash_code_execution):**
```
cd $INPUT_DIR; cat >> /tmp/a.py <<'EOF'
S,O=pd.Period('2026-09'),pd.Period('2026-10')
i2=i.merge(cu[['customer_id','name','region','segment','currency','status','city']].rename(columns={'currency':'ccur'}),on='customer_id')
c2=c.merge(cu[['customer_id','name','region','segment','status']],on='customer_id').merge(i[['invoice_id','customer_id','invoice_date','currency','net_amount']].rename(columns={'customer_id':'inv_cust','net_amount':'inv_amt','currency':'icur'}),on='invoice_id',how='left')
print('cn cust mismatch',(c2.customer_id!=c2.inv_cust).sum(),'missing inv',c2.inv_cust.isna().sum(),'cn>inv',(c2.net_amount>c2.inv_amt).sum(), 'cn before inv',(c2.cn_date0][['cn_no','cn_date','created_at','net_amount']])
def br(k):
a=i2[i2.m.isin([S,O])].pivot_table(index=k,columns='m',values='net_amount',aggfunc='sum',fill_value=0)
b=c2[c2.m.isin([S,O])].pivot_table(index=k,columns='m',values='net_amount',aggfunc='sum',fill_value=0)
n=a.sub(b,fill_value=0); n['chg']=n[O]-n[S]
n['inv_chg']=a[O].sub(a[S]).reindex(n.index).fillna(0); n['cn_chg']=-(b.get(O,0)-b.get(S,0)).reindex(n.index).fillna(0)
print(n.sort_values('chg').round(0)); print('total',n.chg.sum().round(0))
for k in ['region','segment','currency','status']: br(k)
r=c2[c2.m.isin([S,O])].pivot_table(index='reason',columns='m',values='net_amount',aggfunc=['sum','count'],fill_value=0);print(r.round(0))
br('name')
EOF
python3 /tmp/a.py 2>&1 | sed -n '/cn cust/,$p'
```
**Output:**
```
cn cust mismatch 0 missing inv 0 cn>inv 0 cn before inv 0
cn backdated rows cn_no cn_date created_at net_amount
851 CN/000852 2026-10-23 2026-10-31 18:55:16 390720.93
852 CN/000853 2026-10-23 2026-10-31 14:34:04 190157.81
m 2026-09 2026-10 chg inv_chg cn_chg
region
South 28343727.0 14312869.0 -14030857.0 -13548993.0 -481865.0
North 4213694.0 4213345.0 -349.0 -35700.0 35351.0
Export 5208000.0 5207997.0 -3.0 97177.0 -97180.0
East 3399267.0 3399945.0 678.0 -123470.0 124149.0
West 7034500.0 19217424.0 12182923.0 12388089.0 -205166.0
total -1847607.0
m 2026-09 2026-10 chg inv_chg cn_chg
segment
mid 26947933.0 21826993.0 -5120941.0 -4414629.0 -706312.0
key 14610399.0 16182730.0 1572330.0 1525598.0 46732.0
small 6640855.0 8341858.0 1701003.0 1666135.0 34868.0
total -1847607.0
Traceback (most recent call last):
File "/tmp/a.py", line 25, in
for k in ['region','segment','currency','status']: br(k)
^^^^^
File "/tmp/a.py", line 21, in br
b=c2[c2.m.isin([S,O])].pivot_table(index=k,columns='m',values='net_amount',aggfunc='sum',fill_value=0)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pandas/core/frame.py", line 9516, in pivot_table
return pivot_table(
^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pandas/core/reshape/pivot.py", line 102, in pivot_table
table = __internal_pivot_table(
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pandas/core/reshape/pivot.py", line 172, in __internal_pivot_table
grouped = data.groupby(keys, observed=observed_bool, sort=sort, dropna=dropna)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pandas/core/frame.py", line 9190, in groupby
return DataFrameGroupBy(
^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pandas/core/groupby/groupby.py", line 1330, in __init__
grouper, exclusions, obj = get_grouper(
^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pandas/core/groupby/grouper.py", line 1043, in get_grouper
raise KeyError(gpr)
KeyError: 'currency'
```
Thinking (summary)
The South-to-West shift looks like customers being reassigned to a different region, since the customers table only shows their current region. I can't see the earlier assignments, so I'll look at which West customers had large invoices in September.
**Code (bash_code_execution):**
```
cd /tmp; sed -i "s/for k in \['region','segment','currency','status'\]/for k in ['icur','status']/" a.py; sed -i "s/i2=i.merge/i['icur']=i.currency\ni2=i.merge/" a.py; python3 a.py 2>&1 | sed -n '/^m *2026-09 *2026-10 *chg *inv_chg *cn_chg$/,$p' | tail -n +20
```
**Output:**
```
{"stdout": "", "stderr": "", "return_code": 0, "content": [], "type": "bash_code_execution_result"}
```
**Code (bash_code_execution):**
```
cd $INPUT_DIR; python3 /tmp/a.py 2>&1 | sed -n '/^status/,$p;/^icur/,/total/p'
```
**Output:**
```
icur
EUR 25436327.0 13387298.0 -12049029.0 -11914533.0 -134496.0
INR 22762861.0 32964282.0 10201421.0 10691637.0 -490215.0
total -1847607.0
status
active 48199188.0 46351580.0 -1847607.0 -1222896.0 -624711.0
total -1847607.0
sum count
m 2026-09 2026-10 2026-09 2026-10
reason
Quality claim 419432.0 55876.0 9 6
Rate difference 182766.0 652810.0 6 10
Return 265247.0 783471.0 11 14
m 2026-09 2026-10 chg inv_chg cn_chg
name
Tessora EU 5869835.0 1127046.0 -4742789.0 -4742789.0 -0.0
Skarfab 3728989.0 567500.0 -3161489.0 -3088934.0 -72555.0
Ravira Exports 4298728.0 2115844.0 -2182884.0 -2434469.0 251585.0
Wattmeer Textil 1328526.0 337207.0 -991319.0 -946361.0 -44958.0
Atelier Saône 902758.0 -45206.0 -947964.0 -902758.0 -45206.0
... ... ... ... ... ...
Tatrava Cloth 658575.0 1257941.0 599366.0 648387.0 -49021.0
Sahvira Garments 286960.0 1101554.0 814594.0 814594.0 -0.0
Maison Vallin 423283.0 1238462.0 815179.0 815179.0 -0.0
Saurava Fabrics 153897.0 1239302.0 1085405.0 1085405.0 -0.0
Merai Apparels 712846.0 12372339.0 11659492.0 11791790.0 -132298.0
[123 rows x 5 columns]
total -1847607.0
```
Thinking (summary)
The Merai Apparels figure of +11.66M in October looks off, so I'm suspecting a duplicate or an unusually large invoice and will check Merai's October invoices. I also notice the EUR customers, like Tessora EU and Skarfab, are sitting under the "South" region even though their cities are Rotterdam and Aarhus, which points to a region labeling problem even though an Export region exists.
**Code (bash_code_execution):**
```
cd $INPUT_DIR; cat > /tmp/b.py <<'EOF'
exec(open('/tmp/a.py').read().split("def br")[0])
mer=i2[i2.name=='Merai Apparels']
print(mer.groupby('m').net_amount.agg(['sum','count']).tail(14))
print(mer[mer.m==O].sort_values('net_amount',ascending=False).head(10)[['invoice_no','invoice_date','net_amount','order_ref','created_at']])
print(i[i.order_ref.duplicated(keep=False)].shape)
print(cu[cu.currency=='EUR'][['customer_id','name','region','city','segment']])
EOF
python3 /tmp/b.py 2>&1 | grep -v "^cn\|^ *cn_no\|^85"
```
**Output:**
```
inv n_inv cn n_cn net
m
2025-09 47974220.0 297 682390.0 34 47291830.0
2025-10 47147730.0 324 750519.0 33 46397211.0
2025-11 45870502.0 254 391855.0 16 45478648.0
2025-12 48114703.0 326 803797.0 36 47310906.0
2026-01 45385563.0 303 410786.0 31 44974777.0
2026-02 45988712.0 272 531858.0 21 45456854.0
2026-03 53105676.0 346 685936.0 26 52419740.0
2026-04 47731256.0 274 1010248.0 32 46721008.0
2026-05 48341390.0 293 697792.0 33 47643599.0
2026-06 50169114.0 267 1064355.0 25 49104759.0
2026-07 48135248.0 245 485701.0 24 47649547.0
2026-08 45434672.0 237 692084.0 25 44742587.0
2026-09 49066633.0 293 867445.0 26 48199188.0
2026-10 47843737.0 319 1492156.0 30 46351580.0
gross mismatch 0
fx mismatch 0
min mean max
m
2026-03 100.1319 100.905982 102.3902
2026-04 100.4245 100.818667 101.3215
2026-05 100.5309 101.015526 101.2682
2026-06 100.4875 100.928635 101.3073
2026-07 99.2065 99.868319 101.0992
2026-08 97.4052 99.058422 99.8603
2026-09 97.1758 98.205645 99.4184
2026-10 99.7760 100.271650 101.0472
created lag count 8772.0
mean 0.0
std 0.0
min 0.0
25% 0.0
50% 0.0
75% 0.0
max 0.0
dtype: float64
mean 0.018605
std 0.385570
min 0.000000
25% 0.000000
50% 0.000000
75% 0.000000
max 8.000000
dtype: float64
sum count
m
2025-08 1055984.08 2
2025-10 1028546.05 3
2025-11 3571337.06 6
2025-12 1678429.12 4
2026-01 918594.87 2
2026-02 2205366.39 4
2026-03 1752684.96 4
2026-04 2427950.13 4
2026-05 505174.73 1
2026-06 1216382.28 2
2026-07 551286.90 1
2026-08 503701.88 1
2026-09 712846.46 2
2026-10 12504636.46 14
invoice_no invoice_date net_amount order_ref created_at
8648 BI/2627/001805 2026-10-22 2290465.44 SO-26013507 2026-10-22 18:12:49
8625 BI/2627/001782 2026-10-21 1591714.80 SO-26013572 2026-10-21 13:08:11
8624 BI/2627/001781 2026-10-21 1411096.81 SO-26013640 2026-10-21 10:16:31
8604 BI/2627/001761 2026-10-20 1177645.63 SO-26013526 2026-10-20 19:56:25
8674 BI/2627/001831 2026-10-23 1163909.81 SO-26013578 2026-10-23 17:32:21
8710 BI/2627/001867 2026-10-26 590138.38 SO-26013868 2026-10-26 12:03:20
8745 BI/2627/001902 2026-10-30 498660.14 SO-26013685 2026-10-30 11:30:06
(0, 14)
customer_id name region city segment
1 2 Tessora EU South Rotterdam key
2 3 Skarfab South Aarhus key
18 19 Solvik Textil Export Hamburg mid
19 20 Haus Brenner Stoffe Export Lyon mid
20 21 Vela Moda Srl West Ahmedabad mid
21 22 Atelier Saône Export Antwerp mid
22 23 Van Rijt Stoffen West Mumbai mid
23 24 Moda Castella North Delhi mid
24 25 Kaskaro Textil Export Hamburg mid
25 26 Avonmere Cloth Co West Pune mid
26 27 Kurlan Weave North Ludhiana mid
27 28 Dravia Fabrics Export Antwerp mid
28 29 Mondelo Têxteis West Ahmedabad mid
29 30 Skerry Apparel North Gurugram mid
30 31 Kempen Linnen South Tiruppur mid
31 32 Firnhang Tuch East Bhubaneswar mid
32 33 Moselweber Export Milan mid
33 34 Tessuti Ombra Export Antwerp mid
34 35 Wattmeer Textil West Mumbai mid
35 36 Maison Vallin Export Porto mid
36 37 Castelino North Noida mid
37 38 Tatrava Cloth Export Lyon mid
38 39 Bernalp Stoff West Mumbai mid
39 40 Dalmara Moda South Coimbatore mid
40 41 Scheldra Weefsels Export Gothenburg mid
41 42 Elbtal Garn North Gurugram mid
42 43 Dordelle Tissus Export Hamburg mid
43 44 Narvia Weave East Bhubaneswar mid
```
Thinking (summary)
I'm noticing the region tags for EUR customers look off, since some seem to sit in Indian cities, though that may not matter much. The main movement is Merai Apparels in the West, up about 11.8M in October, while EUR customers like Tessora and Skarfab fell roughly 12M. Since the rate rose in October, the EUR drop in foreign currency looks even larger, so I want to check whether this is a timing shift, possibly EUR customers moving to INR invoicing.
I'm questioning whether Merai Apparels, based in Mumbai, might be acting as an intermediary, so I want to see how EUR volume in foreign currency moved month by month. I also need to check whether the South's roughly 28M baseline holds over a longer window, and whether the South's 14M drop is mostly EUR customers like Tessora and Skarfab.
**Code (bash_code_execution):**
```
cd $INPUT_DIR; cat > /tmp/c.py <<'EOF'
exec(open('/tmp/a.py').read().split("print(m.tail")[0])
i2=i.merge(cu[['customer_id','name','region','segment','city']],on='customer_id')
c2=c.merge(cu[['customer_id','name','region','segment']],on='customer_id')
def net(k, months=12):
a=i2.groupby([k,'m']).net_amount.sum().unstack(fill_value=0); b=c2.groupby([k,'m']).net_amount.sum().unstack(fill_value=0)
n=a.sub(b,fill_value=0).iloc[:, -months:]; return n
print((net('region')/1e6).round(2))
print((net('currency')/1e6).round(2))
n=net('name'); n['chg']=n[pd.Period('2026-10')]-n[pd.Period('2026-09')]
print((n.sort_values('chg').iloc[list(range(12))+list(range(-6,0))]/1e6).round(2))
e=i[i.currency=='EUR']; print((e.groupby('m').amount_fc.sum()/1e3).round(0).tail(14))
EOF
python3 /tmp/c.py
```
**Output:**
```
m 2025-11 2025-12 2026-01 2026-02 2026-03 2026-04 2026-05 2026-06 2026-07 2026-08 2026-09 2026-10
region
East 4.15 3.41 4.02 2.71 2.67 2.32 2.93 3.89 2.86 3.12 3.40 3.40
Export 3.23 5.21 5.21 5.27 4.03 4.40 8.18 4.12 3.36 7.22 5.21 5.21
North 2.78 3.24 4.61 3.27 6.29 5.05 5.56 6.97 5.37 4.37 4.21 4.21
South 26.51 27.49 23.68 25.32 30.77 28.35 23.79 28.09 28.09 24.78 28.34 14.31
West 8.80 7.96 7.44 8.88 8.66 6.60 7.19 6.03 7.97 5.24 7.03 19.22
STDERR:
Traceback (most recent call last):
File "/tmp/c.py", line 8, in
print((net('currency')/1e6).round(2))
^^^^^^^^^^^^^^^
File "/tmp/c.py", line 5, in net
a=i2.groupby([k,'m']).net_amount.sum().unstack(fill_value=0); b=c2.groupby([k,'m']).net_amount.sum().unstack(fill_value=0)
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pandas/core/frame.py", line 9190, in groupby
return DataFrameGroupBy(
^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pandas/core/groupby/groupby.py", line 1330, in __init__
grouper, exclusions, obj = get_grouper(
^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pandas/core/groupby/grouper.py", line 1043, in get_grouper
raise KeyError(gpr)
KeyError: 'currency'
```
Thinking (summary)
Regions North, East, and Export came out exactly flat from September to October, at 4.21, 3.40, and 5.21. That's a bit suspicious, as if the data were synthetic with the only real change planted in South and West. I'll go with it and switch the currency to the customer's.
**Code (bash_code_execution):**
```
cd $INPUT_DIR; sed -i "s/\['customer_id','name','region','segment','city'\]/['customer_id','name','region','segment','city','currency']/; s/print((net('currency')/i2['icur']=i2.currency_x; c2['icur']=c2.merge(i[['invoice_id','currency']],on='invoice_id').currency.values\nprint((net('icur')/; s/c2=c.merge(cu\[\['customer_id','name','region','segment'\]\]/c2=c.merge(cu[['customer_id','name','region','segment']]/" /tmp/c.py; python3 /tmp/c.py | tail -45
```
**Output:**
```
East 4.15 3.41 4.02 2.71 2.67 2.32 2.93 3.89 2.86 3.12 3.40 3.40
Export 3.23 5.21 5.21 5.27 4.03 4.40 8.18 4.12 3.36 7.22 5.21 5.21
North 2.78 3.24 4.61 3.27 6.29 5.05 5.56 6.97 5.37 4.37 4.21 4.21
South 26.51 27.49 23.68 25.32 30.77 28.35 23.79 28.09 28.09 24.78 28.34 14.31
West 8.80 7.96 7.44 8.88 8.66 6.60 7.19 6.03 7.97 5.24 7.03 19.22
m 2025-11 2025-12 2026-01 2026-02 2026-03 2026-04 2026-05 2026-06 2026-07 2026-08 2026-09 2026-10
icur
EUR 13.93 18.08 20.12 16.89 18.21 12.29 21.66 17.72 18.95 19.23 25.44 13.39
INR 31.55 29.23 24.85 28.56 34.21 34.43 25.99 31.39 28.70 25.51 22.76 32.96
m 2025-11 2025-12 2026-01 2026-02 2026-03 2026-04 2026-05 2026-06 2026-07 2026-08 2026-09 2026-10 chg
name
Tessora EU 3.07 4.62 3.26 2.85 2.24 2.02 4.40 2.75 2.63 3.10 5.87 1.13 -4.74
Skarfab 2.13 1.96 2.47 2.69 2.64 2.15 2.54 2.35 3.45 2.50 3.73 0.57 -3.16
Ravira Exports 5.61 5.58 3.89 3.91 4.94 8.33 3.51 4.09 5.98 6.26 4.30 2.12 -2.18
Wattmeer Textil 0.24 0.88 0.00 1.00 0.54 0.33 0.59 0.00 0.00 0.00 1.33 0.34 -0.99
Atelier Saône 0.25 0.24 0.00 0.00 0.00 0.00 0.51 0.35 0.39 0.00 0.90 -0.05 -0.95
Bernalp Stoff 0.57 0.75 0.50 0.29 0.56 0.32 0.30 0.59 1.01 0.00 1.35 0.55 -0.80
Ponnavra Fabrics 0.24 0.34 0.53 0.67 0.67 -0.04 0.00 0.57 1.66 0.34 0.64 -0.15 -0.79
Perivra Knitwear 0.67 0.00 0.18 0.00 0.00 0.00 0.76 -0.10 0.00 0.33 0.98 0.27 -0.70
Dravia Fabrics 0.26 0.95 0.14 0.00 0.00 0.00 0.47 0.00 0.55 0.45 0.66 -0.04 -0.70
Narvia Weave 1.00 0.86 0.17 0.61 0.00 0.00 0.33 1.33 0.86 0.41 0.76 0.13 -0.62
Kempen Linnen 0.49 0.17 1.13 0.31 0.25 0.00 0.26 0.36 0.00 0.24 1.09 0.49 -0.60
Skerry Apparel 0.41 0.00 0.92 0.84 0.46 0.38 0.22 0.73 0.47 0.28 0.73 0.14 -0.59
Dordelle Tissus 0.00 0.81 0.93 0.78 0.53 0.24 0.81 0.00 0.28 0.55 0.00 0.54 0.54
Tatrava Cloth 0.63 0.48 0.83 1.29 0.41 0.34 0.83 0.28 0.15 0.58 0.66 1.26 0.60
Sahvira Garments 0.34 0.20 0.23 0.00 0.00 0.23 0.74 0.26 0.00 0.00 0.29 1.10 0.81
Maison Vallin 0.36 0.53 0.19 0.20 0.88 0.00 1.22 0.00 0.00 1.70 0.42 1.24 0.82
Saurava Fabrics 0.00 0.00 0.25 0.34 0.62 0.31 1.13 0.47 1.20 0.00 0.15 1.24 1.09
Merai Apparels 3.57 1.68 0.89 2.21 1.75 2.40 0.48 1.22 0.55 0.50 0.71 12.37 11.66
m
2025-09 211.0
2025-10 153.0
2025-11 140.0
2025-12 178.0
2026-01 198.0
2026-02 168.0
2026-03 185.0
2026-04 124.0
2026-05 215.0
2026-06 180.0
2026-07 192.0
2026-08 195.0
2026-09 262.0
2026-10 138.0
Freq: M, Name: amount_fc, dtype: float64
```
Thinking (summary)
I'm checking the regional totals, which hold steady for North, East, and Export, and the regional table is based on each customer's current region. Export's 5.21 repeats across several months, which looks odd but is probably just how the data is set up. Merai Apparels jumps to 14 invoices in October totaling about 12.5M, far above its usual 1-2M, and I'm noting that it's a West customer.
I'm checking whether Merai's October spike is a real large order or something like rebilling, and I'm looking at whether its order refs fall out of sequence. September's EUR revenue looks pulled forward, with October dropping back for Tessora and Skarfab, and net revenue for October sits close to the twelve-month average.
I'm checking whether Merai's October invoices are duplicates or misposted, looking for reused order refs, odd timestamps, or amounts that match the EUR customers' typical invoices. I'm also breaking down the net change of about -1.85M into Merai, the EUR customers, other INR customers, and credit notes, and I want to see which customers received the two backdated credit notes.
I'm pulling up every October invoice for Merai, along with the September and October invoices for Tessora and Skarfab, to compare them directly.
**Code (bash_code_execution):**
```
cd $INPUT_DIR; cat > /tmp/d.py <<'EOF'
exec(open('/tmp/c.py').read().split("def net")[0])
cols=['invoice_no','invoice_date','name','currency_x','amount_fc','fx_rate','net_amount','order_ref','created_at']
print(i2[(i2.name=='Merai Apparels')&(i2.m>=pd.Period('2026-09'))][cols].to_string())
print(i2[(i2.name.isin(['Tessora EU','Skarfab']))&(i2.m>=pd.Period('2026-08'))][cols].to_string())
cc=c2[c2.m>=pd.Period('2026-09')].merge(i[['invoice_id','invoice_no','invoice_date','net_amount']],on='invoice_id',suffixes=('','_inv'))
print(cc[cc.m==pd.Period('2026-10')].sort_values('net_amount',ascending=False)[['cn_no','cn_date','created_at','name','reason','net_amount','invoice_no','invoice_date','net_amount_inv']].head(12).to_string())
n=i.groupby('m').net_amount.sum()-c.groupby('m').net_amount.sum()
print('12m avg prior to Oct', n.iloc[-13:-1].mean(), 'Oct25',n[pd.Period('2025-10')])
# typical invoice size by customer
print(i2[i2.mThinking (summary)
Tessora and Skarfab invoices drop off after October 6 and 8, with nothing for the rest of the month, which is unusual against their normal two or three a month. Merai invoices, meanwhile, climb from October 20 onward with large amounts. I'm also noticing Merai's order references, SO-26013366 from October 9 and SO-26013507, carry lower numbers, so they may be older orders, possibly rebilled from Tessora or Skarfab.
I'm checking whether other EUR customers also stopped invoicing after mid-October, comparing each one's last invoice date and weekly invoice counts for October versus September. I'll also check Ravira Exports, the INR South account.
**Code (bash_code_execution):**
```
cd $INPUT_DIR; cat > /tmp/e.py <<'EOF'
exec(open('/tmp/c.py').read().split("def net")[0])
x=i2[i2.invoice_date>='2026-08-01'].copy(); x['wk']=x.invoice_date.dt.to_period('W')
x['grp']=x.name.where(x.name.isin(['Merai Apparels','Tessora EU','Skarfab','Ravira Exports']), x.currency_x.map({'EUR':'other EUR','INR':'other INR'}))
print((x.pivot_table(index='wk',columns='grp',values='net_amount',aggfunc='sum',fill_value=0)/1e3).round(0))
print(x[x.name=='Ravira Exports'][['invoice_no','invoice_date','net_amount','order_ref']].tail(12))
# order ref vs invoice: how old are Merai's order refs? order seq vs invoice seq
i['so']=i.order_ref.str[3:].astype(int)
r=i[i.invoice_date>='2026-09-01'].copy(); r['so_rank_gap']=r.so - r.so.rolling(30,center=True,min_periods=1).median()
print(r.merge(cu[['customer_id','name']]).query("name=='Merai Apparels'")[['invoice_no','order_ref','so_rank_gap']])
print(r.so_rank_gap.describe())
EOF
python3 /tmp/e.py
```
**Output:**
```
grp Merai Apparels Ravira Exports Skarfab Tessora EU other EUR other INR
wk
2026-07-27/2026-08-02 0.0 0.0 0.0 0.0 1220.0 870.0
2026-08-03/2026-08-09 0.0 1131.0 572.0 1513.0 4062.0 3879.0
2026-08-10/2026-08-16 504.0 1189.0 856.0 0.0 3504.0 3440.0
2026-08-17/2026-08-23 0.0 1545.0 1068.0 1589.0 2118.0 4329.0
2026-08-24/2026-08-30 0.0 2634.0 0.0 0.0 2420.0 5366.0
2026-08-31/2026-09-06 0.0 1037.0 812.0 1433.0 1842.0 3338.0
2026-09-07/2026-09-13 0.0 1198.0 755.0 1395.0 2630.0 3926.0
2026-09-14/2026-09-20 315.0 952.0 1306.0 0.0 3799.0 4528.0
2026-09-21/2026-09-27 398.0 1364.0 0.0 3041.0 4872.0 3917.0
2026-09-28/2026-10-04 816.0 815.0 986.0 0.0 3839.0 5776.0
2026-10-05/2026-10-11 2487.0 1301.0 770.0 1127.0 3017.0 2283.0
2026-10-12/2026-10-18 479.0 0.0 0.0 0.0 1410.0 2908.0
2026-10-19/2026-10-25 7635.0 0.0 0.0 0.0 5604.0 8043.0
2026-10-26/2026-11-01 1089.0 0.0 0.0 0.0 1364.0 3931.0
invoice_no invoice_date net_amount order_ref
7982 BI/2627/001139 2026-08-08 1131123.09 SO-26012859
8014 BI/2627/001171 2026-08-14 1188783.83 SO-26013050
8082 BI/2627/001239 2026-08-22 1545061.78 SO-26013085
8135 BI/2627/001292 2026-08-29 2633541.50 SO-26013206
8186 BI/2627/001343 2026-09-04 1037155.36 SO-26013266
8228 BI/2627/001385 2026-09-11 1197887.04 SO-26013274
8264 BI/2627/001421 2026-09-16 951712.00 SO-26013417
8345 BI/2627/001502 2026-09-24 1363558.89 SO-26013365
8453 BI/2627/001610 2026-10-01 814968.31 SO-26013299
8530 BI/2627/001687 2026-10-09 1300876.09 SO-26013395
invoice_no order_ref so_rank_gap
95 BI/2627/001412 SO-26013280 -495.0
205 BI/2627/001522 SO-26013379 -497.5
307 BI/2627/001624 SO-26013587 -373.0
308 BI/2627/001625 SO-26013525 -435.0
340 BI/2627/001657 SO-26013485 -483.5
349 BI/2627/001666 SO-26013562 -430.5
371 BI/2627/001688 SO-26013620 -409.0
372 BI/2627/001689 SO-26013366 -663.0
409 BI/2627/001726 SO-26013628 -457.5
444 BI/2627/001761 SO-26013526 -601.5
464 BI/2627/001781 SO-26013640 -484.5
465 BI/2627/001782 SO-26013572 -552.5
488 BI/2627/001805 SO-26013507 -648.5
514 BI/2627/001831 SO-26013578 -585.0
550 BI/2627/001867 SO-26013868 -307.5
585 BI/2627/001902 SO-26013685 -575.5
count 612.000000
mean -46.913399
std 138.116124
min -663.500000
25% -95.250000
50% 0.500000
75% 42.000000
max 136.500000
Name: so_rank_gap, dtype: float64
```
Thinking (summary)
I'm setting aside the rolling median order_ref gap, since sales orders aren't sequential and the numbers aren't conclusive. The key finding is that three of the biggest South key accounts, Ravira Exports, Tessora EU, and Skarfab, all stopped invoicing between October 6 and 9.
I'm checking whether the three lost South accounts might have been billed through Merai, since their combined drop of about 10.08M is close to Merai's 11.66M rise but not equal. I'm also looking for other customers who went quiet after mid-October, and estimating the FX effect on October's EUR invoices, which was roughly +0.27M.
I'm working out a bridge from September's 48.20M to October's 46.35M: Tessora, Skarfab and Ravira account for -10.08M, Merai adds +11.66M, and Ponnavra's backdated credit notes take another 0.58M. Next I'll split the remainder into invoices and credit notes and count how many customers went quiet late in October.
**Code (bash_code_execution):**
```
cd $INPUT_DIR; cat > /tmp/f.py <<'EOF'
exec(open('/tmp/c.py').read().split("def net")[0])
S,O=pd.Period('2026-09'),pd.Period('2026-10')
a=i2[i2.m.isin([S,O])].groupby(['name','m']).net_amount.sum().unstack(fill_value=0)
b=c2[c2.m.isin([S,O])].groupby(['name','m']).net_amount.sum().unstack(fill_value=0)
a,b=a.align(b,fill_value=0)
d=pd.DataFrame({'inv':a[O]-a[S],'cn':-(b[O]-b[S])})
big=['Merai Apparels','Tessora EU','Skarfab','Ravira Exports']
print(d.loc[big].round(0)); r=d.drop(big); print('rest',r.sum().round(0), 'n up',(r.sum(1)>0).sum(),'n down',(r.sum(1)<0).sum())
print('total',d.sum().round(0))
# fx effect on Oct EUR invoices at Sep avg rate
e=i[(i.currency=='EUR')]; sep_rate=e[e.m==S].net_amount.sum()/e[e.m==S].amount_fc.sum(); oct_rate=e[e.m==O].net_amount.sum()/e[e.m==O].amount_fc.sum()
print('rates',sep_rate,oct_rate,'fx effect',e[e.m==O].amount_fc.sum()*(oct_rate-sep_rate),'EUR fc',e[e.m==S].amount_fc.sum(),e[e.m==O].amount_fc.sum())
# key-account history: invoices per month for 3 accounts
print(i2[i2.name.isin(big)].groupby(['name','m']).size().unstack(0).tail(8))
# customers active each of prior 6 months but last invoice before Oct 12
act=i2[(i2.m>=pd.Period('2026-04'))&(i2.m<=S)].groupby('name').m.nunique()
reg=act[act==6].index
last=i2.groupby('name').invoice_date.max()
print(last.loc[reg][last.loc[reg]<'2026-10-12'])
print(cu[cu.name.isin(big)].T)
EOF
python3 /tmp/f.py
```
**Output:**
```
inv cn
name
Merai Apparels 11791790.0 -132298.0
Tessora EU -4742789.0 -0.0
Skarfab -3088934.0 -72555.0
Ravira Exports -2434469.0 251585.0
rest inv -2748494.0
cn -671443.0
dtype: float64 n up 59 n down 60
total inv -1222896.0
cn -624711.0
dtype: float64
rates 98.12594132516337 100.26131182239568 fx effect 294789.3919022693 EUR fc 262475.72 138050.7
name Merai Apparels Ravira Exports Skarfab Tessora EU
m
2026-03 4.0 4.0 4.0 2.0
2026-04 4.0 5.0 3.0 2.0
2026-05 1.0 4.0 4.0 3.0
2026-06 2.0 4.0 3.0 2.0
2026-07 1.0 5.0 4.0 2.0
2026-08 1.0 4.0 3.0 2.0
2026-09 2.0 4.0 4.0 3.0
2026-10 14.0 2.0 1.0 1.0
name
Kabvra Clothing 2026-10-03
Kanvira Clothing 2026-09-29
Magvira Trading 2026-09-14
Noyvra Weaves 2026-10-02
Ravira Exports 2026-10-09
Skarfab 2026-10-06
Tessora EU 2026-10-08
Tessuti Ombra 2026-10-06
Name: invoice_date, dtype: datetime64[ns]
0 1 2 3
customer_id 1 2 3 4
customer_code C0001 C0002 C0003 C0004
name Ravira Exports Tessora EU Skarfab Merai Apparels
region South South South West
city Tiruppur Rotterdam Aarhus Mumbai
segment key key key key
currency INR EUR EUR INR
status active active active active
payment_terms_days 30 45 45 30
credit_limit 33600000.0 43700000.0 22800000.0 15600000.0
created_at 2023-08-05 17:08:04 2021-12-11 17:53:30 2022-05-07 16:51:47 2022-03-02 17:53:33
```
Thinking (summary)
I'm checking the Ravira credit notes, where the change in October is positive, so there were fewer of them. Next I'm comparing Merai's October invoices against its credit limit, and its invoice count is well above the usual range. For the segment table I'm working through the net figures for the mid, key and small groups, and I'm reconciling the key group's numbers once more.
I'm now asking whether the mid-segment drop of about 5.1M sits mainly with EUR mid-size customers. The remaining 3.42M across other groups is the next thing to break down, by customer currency and segment.
**Code (bash_code_execution):**
```
cd $INPUT_DIR; cat >> /tmp/f.py <<'EOF'
r=r.join(cu.set_index('name')[['segment','currency','region']]); r['net']=r.inv+r.cn
print(r.groupby(['segment','currency']).net.agg(['sum','count']).round(0))
print(r.sort_values('net').head(8).round(0))
cr=c2[c2.m.isin([S,O])].groupby(['m','reason']).net_amount.sum().unstack().round(0); print(cr)
EOF
python3 /tmp/f.py | tail -30
```
**Output:**
```
customer_id 1 2 3 4
customer_code C0001 C0002 C0003 C0004
name Ravira Exports Tessora EU Skarfab Merai Apparels
region South South South West
city Tiruppur Rotterdam Aarhus Mumbai
segment key key key key
currency INR EUR EUR INR
status active active active active
payment_terms_days 30 45 45 30
credit_limit 33600000.0 43700000.0 22800000.0 15600000.0
created_at 2023-08-05 17:08:04 2021-12-11 17:53:30 2022-05-07 16:51:47 2022-03-02 17:53:33
sum count
segment currency
mid EUR -4144751.0 25
INR -976190.0 30
small INR 1701003.0 64
inv cn segment currency region net
name
Wattmeer Textil -946361.0 -44958.0 mid EUR West -991319.0
Atelier Saône -902758.0 -45206.0 mid EUR Export -947964.0
Bernalp Stoff -800126.0 -0.0 mid EUR West -800126.0
Ponnavra Fabrics -206098.0 -580879.0 mid INR South -786976.0
Perivra Knitwear -703588.0 -0.0 mid INR South -703588.0
Dravia Fabrics -660193.0 -36193.0 mid EUR Export -696386.0
Narvia Weave -686653.0 62981.0 mid EUR East -623672.0
Kempen Linnen -599270.0 -0.0 mid EUR South -599270.0
reason Quality claim Rate difference Return
m
2026-09 419432.0 182766.0 265247.0
2026-10 55876.0 652810.0 783471.0
```
Thinking (summary)
The euro figures are driving the picture: EUR invoices are down about 12M overall despite a small FX tailwind, with EUR volume falling roughly 47% from September's high to October's low. That timing gap looks like it accounts for the INR drop, while the INR gain is almost entirely from Merai. Now I'm laying out the bridge from the September starting point of 48.20, starting with the Tessora and Skarfab movements.
I'm checking the bridge figures: the EUR customers sum to -12.05, Merai adds +11.66, Ravira -2.18, and the remaining INR accounts net +0.72, which brings the total to about -1.85. I'm also noting that credit notes add up to +0.62M, with two Ponnavra notes for 0.58M backdated to October 23 and worth flagging, and that the region tags look inconsistent with the cities on several accounts.
I'm settling on a concise answer and choosing to express amounts in ₹M throughout, without producing any file.
**Assistant:**
Net revenue fell from **₹48.20M in September to ₹46.35M in October, down ₹1.85M (3.8%)**. Invoices fell ₹1.22M and credit notes rose ₹0.62M.
The total change is small, but it nets out two much bigger swings in opposite directions: **euro sales fell by about ₹12M, and one Indian customer, Merai Apparels, grew by about ₹11.7M.**
### What moved (net revenue, September to October)
| Driver | Change |
|---|---|
| Customers billed in euros, all of them | **−₹12.05M** |
| Tessora EU (key account) | −₹4.74M |
| Skarfab (key account) | −₹3.16M |
| 25 mid-size euro customers | −₹4.14M |
| Merai Apparels (key account, Mumbai, billed in rupees) | **+₹11.66M** |
| Ravira Exports (key account, Tiruppur, billed in rupees) | −₹2.18M |
| Other rupee-billed customers | +₹0.72M |
| **Total** | **−₹1.85M** |
**1. Euro sales almost halved.** Euro-billed volume fell from about €262k to €138k. The exchange rate helped: the average rate went from about ₹98.1 to ₹100.3 per euro, which added about ₹0.3M. That only partly offset the drop in volume.
- Part of this is timing. September was an unusually strong euro month (a typical month is about €180k), including a ₹3.04M Tessora invoice on 26 Sep, which was its largest ever.
- Tessora, Skarfab and Ravira Exports normally get 2–5 invoices a month each. **None of the three was invoiced after 9 October.** If that wasn't expected, it's worth asking sales why.
**2. Merai Apparels made up most of the gap.** It had 14 invoices worth ₹12.5M in October, compared with 1–4 invoices and ₹0.5–3.6M in a normal month. Over ₹7.6M of that was billed in the week of 19 October. Before October, its largest single invoice was ₹0.81M, and this month includes one for ₹2.29M. The October total is also close to its ₹15.6M credit limit. **If this is a one-off order, November is exposed.**
**3. Credit notes rose by ₹0.62M** (to ₹1.49M from ₹0.87M). Returns and rate differences went up, while quality claims went down. Almost all of the increase is **two credit notes to Ponnavra Fabrics totalling ₹0.58M**. Both are dated 23 October but were entered on 31 October, and they are the only backdated entries in October. That's worth confirming they were meant to fall in October.
### Context
- October is not an unusually weak month. It is level with October 2025 (₹46.40M) and only 1.7% below the 12-month average (₹47.17M). It looks like a decline mostly because September was strong.
- By account size, mid-size customers fell ₹5.12M, while key accounts rose ₹1.57M and small accounts rose ₹1.70M. The key-account rise hides big moves within it: Merai up ₹11.7M, the other three down ₹10.1M.
### Be careful with the region breakdown
By region, South shows −₹14.0M and West +₹12.2M, but that is just the same few accounts. The region field also doesn't look reliable:
- Tessora (Rotterdam) and Skarfab (Aarhus) are tagged "South".
- Several euro-billed customers are listed with Indian cities.
- North, East and Export come out almost exactly flat, within ₹700 each.
- The customer file shows only each account's current region, not what it was in September.
I'd explain the decline by customer and billing currency rather than by region.
I checked the data quality before relying on it. There were no duplicate invoices or credit notes and no credit notes without a matching invoice. Euro amounts convert to the rupee amounts correctly, and net plus GST equals the gross amount on every invoice.
## Final answer (scored)
Net revenue fell from **₹48.20M in September to ₹46.35M in October, down ₹1.85M (3.8%)**. Invoices fell ₹1.22M and credit notes rose ₹0.62M.
The total change is small, but it nets out two much bigger swings in opposite directions: **euro sales fell by about ₹12M, and one Indian customer, Merai Apparels, grew by about ₹11.7M.**
### What moved (net revenue, September to October)
| Driver | Change |
|---|---|
| Customers billed in euros, all of them | **−₹12.05M** |
| Tessora EU (key account) | −₹4.74M |
| Skarfab (key account) | −₹3.16M |
| 25 mid-size euro customers | −₹4.14M |
| Merai Apparels (key account, Mumbai, billed in rupees) | **+₹11.66M** |
| Ravira Exports (key account, Tiruppur, billed in rupees) | −₹2.18M |
| Other rupee-billed customers | +₹0.72M |
| **Total** | **−₹1.85M** |
**1. Euro sales almost halved.** Euro-billed volume fell from about €262k to €138k. The exchange rate helped: the average rate went from about ₹98.1 to ₹100.3 per euro, which added about ₹0.3M. That only partly offset the drop in volume.
- Part of this is timing. September was an unusually strong euro month (a typical month is about €180k), including a ₹3.04M Tessora invoice on 26 Sep, which was its largest ever.
- Tessora, Skarfab and Ravira Exports normally get 2–5 invoices a month each. **None of the three was invoiced after 9 October.** If that wasn't expected, it's worth asking sales why.
**2. Merai Apparels made up most of the gap.** It had 14 invoices worth ₹12.5M in October, compared with 1–4 invoices and ₹0.5–3.6M in a normal month. Over ₹7.6M of that was billed in the week of 19 October. Before October, its largest single invoice was ₹0.81M, and this month includes one for ₹2.29M. The October total is also close to its ₹15.6M credit limit. **If this is a one-off order, November is exposed.**
**3. Credit notes rose by ₹0.62M** (to ₹1.49M from ₹0.87M). Returns and rate differences went up, while quality claims went down. Almost all of the increase is **two credit notes to Ponnavra Fabrics totalling ₹0.58M**. Both are dated 23 October but were entered on 31 October, and they are the only backdated entries in October. That's worth confirming they were meant to fall in October.
### Context
- October is not an unusually weak month. It is level with October 2025 (₹46.40M) and only 1.7% below the 12-month average (₹47.17M). It looks like a decline mostly because September was strong.
- By account size, mid-size customers fell ₹5.12M, while key accounts rose ₹1.57M and small accounts rose ₹1.70M. The key-account rise hides big moves within it: Merai up ₹11.7M, the other three down ₹10.1M.
### Be careful with the region breakdown
By region, South shows −₹14.0M and West +₹12.2M, but that is just the same few accounts. The region field also doesn't look reliable:
- Tessora (Rotterdam) and Skarfab (Aarhus) are tagged "South".
- Several euro-billed customers are listed with Indian cities.
- North, East and Export come out almost exactly flat, within ₹700 each.
- The customer file shows only each account's current region, not what it was in September.
I'd explain the decline by customer and billing currency rather than by region.
I checked the data quality before relying on it. There were no duplicate invoices or credit notes and no credit notes without a matching invoice. Euro amounts convert to the rupee amounts correctly, and net plus GST equals the gross amount on every invoice.