diff --git a/OLD/Analysis.ipynb b/OLD/Analysis.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..f44200afd55dbbf0a94e5788f462f7e6968dd01e --- /dev/null +++ b/OLD/Analysis.ipynb @@ -0,0 +1,8169 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "0db80b63", + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd \n", + "import numpy as np \n", + "from datetime import datetime, timedelta" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "92f0b7b1", + "metadata": {}, + "outputs": [], + "source": [ + "data2=pd.read_excel(\"sampletesting.xlsx\",sheet_name=\"Sheet1\")\n", + "data1=pd.read_excel(\"sampletesting.xlsx\",sheet_name=\"Sheet2\")" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "ae3bc2e0", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n" + ] + } + ], + "source": [ + "print(data2.describe)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "c611c80f", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "RECOMMENDED ACTIONS:\n", + " Village Taluka District Mantri Mobile Action Reason Priority Score\n", + " BORSAD MAIN DAIRY BORSAD ANAND BHARATBHAI PARMAR(CHAIRMAN) 9879726187 Call Mantri for Follow-up High untapped potential (2677.0 sabhasad not contacted) High 88.24\n", + " SAIJPUR BORSAD ANAND RAJUBHAI 8511880200 Send Marketing Team Low conversion rate (3.8%) - Only 71.0 of 1885 sabhasad contacted High 82.00\n", + " BAJIPURA KHAMBHAT ANAND MANUBHAI SOMABHAI CHAUHAN 9824643396 Send Marketing Team Low conversion rate (2.9%) - Only 31.0 of 1062 sabhasad contacted High 67.80\n", + " HATHIPURA ANKALAV ANAND JESANGBHAI CHAVDA 9427828741 Send Marketing Team Low conversion rate (1.4%) - Only 10.0 of 740 sabhasad contacted High 62.96\n", + " SANDHA PADRA VADODARA NATUKAKA 9726573829 Send Marketing Team Low conversion rate (16.1%) - Only 191.0 of 1184 sabhasad contacted High 60.48\n", + " SHILI UMRETH ANAND GOPALBHAI 8866805602 Call Mantri for Follow-up High untapped potential (1001.0 sabhasad not contacted) High 57.47\n", + " DHARKHUNIYA UMRETH ANAND JASVANTSINH PARMAR 6354405815 Send Marketing Team Low conversion rate (11.8%) - Only 92.0 of 780 sabhasad contacted High 56.96\n", + " KHEDASA BORSAD ANAND RAVINDRABHAI 9662740083 Send Marketing Team Low conversion rate (5.2%) - Only 26.0 of 502 sabhasad contacted High 56.30\n", + " RASNOL ANAND ANAND VITHTHALBHAI 9924590017 Call Mantri for Follow-up High untapped potential (915.0 sabhasad not contacted) High 55.77\n", + " KALAMASAR KHAMBHAT ANAND VANRAJBHAI 8347168185 Call Mantri for Follow-up High untapped potential (1317.0 sabhasad not contacted) High 55.76\n", + " KHIJALPUR UMRETH ANAND BHARATBHAI(DOCTOR) 7698969285 Send Marketing Team Low conversion rate (0.0%) - Only 0.0 of 289 sabhasad contacted High 55.40\n", + " UMLAV BORSAD ANAND JYANTIBHAI 9825817354 Call Mantri for Follow-up High untapped potential (857.0 sabhasad not contacted) High 53.63\n", + " RAYPURA ANAND ANAND MANUBHAI 6355974133 Send Marketing Team Low conversion rate (5.2%) - Only 18.0 of 346 sabhasad contacted High 53.53\n", + " BILPAD ANKLAV ANAND DILIPBHAI 9510341268 Send Marketing Team Low conversion rate (5.4%) - Only 19.0 of 350 sabhasad contacted High 53.47\n", + " KALAMSAR KHAMBHAT ANAND VANRAJSINH SINDHA 8347168185 Call Mantri for Follow-up High untapped potential (1204.0 sabhasad not contacted) High 52.59\n", + " VEDACH PADRA VADODARA BALVANTBHAI 9978011241 Call Mantri for Follow-up High untapped potential (670.0 sabhasad not contacted) High 50.49\n", + " SARDARPURA THASRA KHEDA SANJAYBHAI 8140766086 Send Marketing Team Low conversion rate (0.0%) - Only 0.0 of 18 sabhasad contacted High 50.34\n", + " RANCHHODPURA SAVLI VADODARA GANPATBHAI 9016698604 Send Marketing Team Low conversion rate (0.0%) - Only 0.0 of 14 sabhasad contacted High 50.26\n", + " PARVATA UMRETH ANAND HIMMATBHAI 8980848224 Send Marketing Team Low conversion rate (0.0%) - Only 0.0 of 6 sabhasad contacted High 50.11\n", + " DADPURA BORSAD ANAND CHANDUBHAI 9106700348 Send Marketing Team Low conversion rate (0.0%) - Only 0.0 of 5 sabhasad contacted High 50.09\n", + " JOGAN KHAMBHAT ANAND PINTUBHAI 9824663860 Send Marketing Team Low conversion rate (0.0%) - Only 0.0 of 4 sabhasad contacted High 50.07\n", + " DODHIYA PURA KHAMBHAT ANAND UDESINH BHAI 9824287850 Send Marketing Team Low conversion rate (0.0%) - Only 0.0 of 3 sabhasad contacted High 50.06\n", + " VEMAR SAVLI VADODARA AMBALAL GOHIL 9978081739 Send Marketing Team Low conversion rate (0.0%) - Only 0.0 of 2 sabhasad contacted High 50.04\n", + " VASVEL WAGHODIA VADODARA DHARMENDRABHAI 9327897366 Send Marketing Team Low conversion rate (0.0%) - Only 0.0 of 2 sabhasad contacted High 50.04\n", + " JAROD WAGHODIA VADODARA INDUBHAI ( JAYESHBHAI ) 9925069851 Send Marketing Team Low conversion rate (0.0%) - Only 0.0 of 0 sabhasad contacted High 50.00\n", + " JAKHLA UMRETH ANAND SURESHBHAI 9913584672 Send Marketing Team Low conversion rate (0.0%) - Only 0.0 of 0 sabhasad contacted High 50.00\n", + " NAVGAMA WAGHODIA VADODARA NARENDRABHAI 9909318997 Send Marketing Team Low conversion rate (0.0%) - Only 0.0 of 0 sabhasad contacted High 50.00\n", + " UNTKHARI UMRETH ANAND AMBALAL CHAUHAN 9313860902 Send Marketing Team Low conversion rate (0.0%) - Only 0.0 of 0 sabhasad contacted High 50.00\n", + " KAYAVAROHAN VADODARA VADODARA JAGDISHBHAI PATEL 9909719274 Send Marketing Team Low conversion rate (0.0%) - Only 0.0 of 0 sabhasad contacted High 50.00\n", + " RAJPUR SAVLI VADODARA DALPATSINH 9909550925 Send Marketing Team Low conversion rate (0.0%) - Only 0.0 of 0 sabhasad contacted High 50.00\n", + " BECHRI UMRETH ANAND GOPALBHAI 8347727273 Send Marketing Team Low conversion rate (0.0%) - Only 0.0 of 0 sabhasad contacted High 50.00\n", + " FATEPURA UMRETH ANAND VIJAYBHAI PARMAR 6351313878 Send Marketing Team Low conversion rate (0.0%) - Only 0.0 of 0 sabhasad contacted High 50.00\n", + " KANODA SAVLI VADODARA VINUBHAI SOLANKI 9998756469 Send Marketing Team Low conversion rate (0.0%) - Only 0.0 of 0 sabhasad contacted High 50.00\n", + " KATHANA STATION BORSAD ANAND RAMESHBHAI BHUTSINH PARMAR NaN Send Marketing Team Low conversion rate (0.0%) - Only 0.0 of 0 sabhasad contacted High 50.00\n", + " ASHIPURA UMRETH ANAND PARVATBHAI 9574229451 Send Marketing Team Low conversion rate (0.0%) - Only 0.0 of 0 sabhasad contacted High 50.00\n", + " ALARASHA BORSAD ANAND DR. NARENDRASINH 9510942485 Send Marketing Team Low conversion rate (0.0%) - Only 0.0 of 0 sabhasad contacted High 50.00\n", + " GOPALPURA ANAND ANAND SHAILESHBHAI SHARMA 7990024992 Send Marketing Team Low conversion rate (0.0%) - Only 0.0 of 0 sabhasad contacted High 50.00\n", + " KHAKHARIYA SAVLI VADODARA PARESHBHAI 9879665401 Send Marketing Team Low conversion rate (0.0%) - Only 0.0 of 0 sabhasad contacted High 50.00\n", + " RANOLI BORSAD ANAND NAGINBHAI 4654654555 Send Marketing Team Low conversion rate (0.0%) - Only 3.0 of 0 sabhasad contacted High 49.94\n", + " INDRAD SAVLI VADODARA VIKRAMSINH CHAUHAN 9825316980 Send Marketing Team Low conversion rate (0.0%) - Only 5.0 of 0 sabhasad contacted High 49.91\n", + " BHAREL ANAND ANAND ASHOKBHAI THAKOR 9924216299 Send Marketing Team Low conversion rate (0.0%) - Only 6.0 of 0 sabhasad contacted High 49.89\n", + " TRAMBOVAD SOJITRA ANAND BHIKHABHAI 9723885382 Send Marketing Team Low conversion rate (0.0%) - Only 6.0 of 0 sabhasad contacted High 49.89\n", + " VITOJ SAVLI VADODARA KHODSINH GOHIL 9601425263 Send Marketing Team Low conversion rate (0.0%) - Only 10.0 of 0 sabhasad contacted High 49.81\n", + " MOKSHI SAVLI VADODARA PUSHPABEN THAKORBHAI 8866515355 Send Marketing Team Low conversion rate (0.0%) - Only 11.0 of 0 sabhasad contacted High 49.79\n", + " RATAN JI NA MUVADA UMRETH ANAND GANPATSINH 9924169009 Send Marketing Team Low conversion rate (0.0%) - Only 12.0 of 0 sabhasad contacted High 49.78\n", + " BALANAPURA SAVLI VADODARA RAMTUSINH 9328409149 Send Marketing Team Low conversion rate (0.0%) - Only 13.0 of 0 sabhasad contacted High 49.76\n", + " RAVIPURA PETLAD ANAND ARVIND PARMAR 9714275164 Send Marketing Team Low conversion rate (0.0%) - Only 13.0 of 0 sabhasad contacted High 49.76\n", + " MITHAPURA KHEDA ANAND VIKRAMSINH 9712007585 Send Marketing Team Low conversion rate (0.0%) - Only 19.0 of 0 sabhasad contacted High 49.65\n", + " BHETASHI TALPAD ANKLAV ANAND KIRITBHAI 9408667583 Send Marketing Team Low conversion rate (0.0%) - Only 21.0 of 0 sabhasad contacted High 49.61\n", + " PIPLOI KHAMBHAT ANAND JAYANTIBHAI 8160204365 Send Marketing Team Low conversion rate (0.0%) - Only 23.0 of 0 sabhasad contacted High 49.57\n", + " SUNAV SOJITRA ANAND JIGARBHAI 9998147762 Send Marketing Team Low conversion rate (0.0%) - Only 38.0 of 0 sabhasad contacted High 49.29\n", + " JESAPURA THASRA KHEDA JAYDEEPSINH 9924903171 Send Marketing Team Low conversion rate (0.0%) - Only 116.0 of 0 sabhasad contacted High 47.83\n", + " KAMROL VAGHODIA VADODARA NATUBHAI CHAIRMAN 9924917292 Send Marketing Team Low conversion rate (0.0%) - Only 127.0 of 0 sabhasad contacted High 47.63\n", + " BOCHASAN ANAND ANAND MUKESHBHAI 9913633154 Call Mantri for Follow-up High untapped potential (563.0 sabhasad not contacted) High 46.06\n", + " BODIKUVA VADODARA VADODARA HANUKAKA 8140100407 Send Marketing Team Low conversion rate (11.0%) - Only 9.0 of 82 sabhasad contacted High 45.87\n", + " VIRSAD BORSAD ANAND SHAILESHBHAI 9104244408 Call Mantri for Follow-up High untapped potential (687.0 sabhasad not contacted) High 45.21\n", + " JANTRAL BORSAD ANAND ARVINDBHAI 9724670628 Call Mantri for Follow-up High untapped potential (424.0 sabhasad not contacted) High 38.47\n", + " LALPURA ANKALAV ANAND LALJIBHAI 9909212667 Call Mantri for Follow-up High untapped potential (185.0 sabhasad not contacted) High 36.61\n", + " SARSA ANAND ANAND SAMIRBHAI PATEL 9898825711 Call Mantri for Follow-up High untapped potential (402.0 sabhasad not contacted) High 35.39\n", + " AHIMA UMRETH ANAND RAJENDRASINH 9510084847 Call Mantri for Follow-up High untapped potential (294.0 sabhasad not contacted) High 33.39\n", + " DEVRAMPURA UMRETH ANAND BHALABHAI 9727198451 Call Mantri for Follow-up High untapped potential (203.0 sabhasad not contacted) High 32.96\n", + " CHAMARA ANKALAV ANAND FATABHAI PADHIYAR 8347183421 Call Mantri for Follow-up High untapped potential (135.0 sabhasad not contacted) High 32.52\n", + " DHUVARAN BORSAD ANAND JORUBHAI 8200199030 Call Mantri for Follow-up High untapped potential (540.0 sabhasad not contacted) High 32.18\n", + " POPATVAV KHANBHAT ANAND SANJAYBHAI 7283995919 Call Mantri for Follow-up High untapped potential (97.0 sabhasad not contacted) High 29.53\n", + " KUKVAD PETLAD ANAND BAKORBHAI THAKOR 7990576594 Call Mantri for Follow-up High untapped potential (193.0 sabhasad not contacted) High 29.34\n", + " RAJUPURA ANAND ANAND HARSHADBHAI 9537555788 Call Mantri for Follow-up High untapped potential (245.0 sabhasad not contacted) High 29.03\n", + " BAJIPURA UMRETH ANAND RAHULBHAI PADHIYAR 6355245589 Call Mantri for Follow-up High untapped potential (244.0 sabhasad not contacted) High 28.96\n", + " VATRA KHAMBHAT ANAND ANKITBHAI RABARI 9978541194 Call Mantri for Follow-up High untapped potential (235.0 sabhasad not contacted) High 27.89\n", + " DAHEVAN BORSAD ANAND PRAVINBHAI PATEL 9723468521 Check on Mantri No recent sales (999.0 days since last sale) Medium 27.88\n", + " RASULPUR SAVLI VADODARA GOPALBHAI 7623858581 Check on Mantri No recent sales (999.0 days since last sale) Medium 27.88\n", + " TRIKAMPURA VADODARA VADODARA SANJAYBHAI 9974294254 Check on Mantri No recent sales (999.0 days since last sale) Medium 27.87\n", + " KASOR ANAND ANAND MITULBHAI 7383094973 Check on Mantri No recent sales (999.0 days since last sale) Medium 27.50\n", + " DALI KHAMBHAT ANAND ARJUNBHAI - MANTRY 9428489479 Call Mantri for Follow-up High untapped potential (359.0 sabhasad not contacted) High 27.08\n", + " BHARTHANA KARJAN VADODARA KAMLESHBHAI 6354508694 Check on Mantri No recent sales (999.0 days since last sale) Medium 27.06\n", + " RAJUPURA ANAND ANAND HARSHADBHAI 9537555788 Call Mantri for Follow-up High untapped potential (214.0 sabhasad not contacted) High 26.76\n", + " SINHOL PETLAD ANAND DILIPBHAI 8128252762 Call Mantri for Follow-up High untapped potential (309.0 sabhasad not contacted) High 26.59\n", + " JOGAN KHAMBHAT ANAND SHANKARBHAI THAKOR 8140448296 Call Mantri for Follow-up High untapped potential (304.0 sabhasad not contacted) High 25.55\n", + " KANBHA KHAMBHAT ANAND BHAVESHBHAI 7016899971 Call Mantri for Follow-up High untapped potential (307.0 sabhasad not contacted) High 25.54\n", + " NAVAPURA ANKLAV ANAND BHAILALBHAI 9016933551 Call Mantri for Follow-up High untapped potential (183.0 sabhasad not contacted) High 25.20\n", + "AMBERAOPURA(DAHEVAN) BORSAD ANAND PRAVINBHAI PATEL 9723468521 Call Mantri for Follow-up High untapped potential (121.0 sabhasad not contacted) High 25.17\n", + " PORDA PETLAD ANAND NILESHBHAI 9898881850 Check on Mantri No recent sales (999.0 days since last sale) Medium 25.06\n", + " MUVADA WAGHODIA VADODARA KANUBHAI PARMAR 966481655 Check on Mantri No recent sales (999.0 days since last sale) Medium 25.06\n", + " VISHNOLI BORSAD ANAND VASIMKHAN 546549846 Call Mantri for Follow-up High untapped potential (70.0 sabhasad not contacted) High 24.64\n", + " BANEJDA BORSAD ANAND MUKESHBHAI 9624208283 Call Mantri for Follow-up High untapped potential (127.0 sabhasad not contacted) High 24.04\n", + " GAMBHIRA ANKALAV ANAND RAMESHBHAI 9979137503 Call Mantri for Follow-up High untapped potential (411.0 sabhasad not contacted) High 23.68\n", + " KATHANA BORSAD ANAND MEHULBHAI 9726644968 Call Mantri for Follow-up High untapped potential (197.0 sabhasad not contacted) High 23.58\n", + " AMIYAD BORSAD ANAND KABHAYBHAI 9925861038 Check on Mantri No recent sales (999.0 days since last sale) Medium 23.30\n", + " NAVAPURA UMRETH ANAND DHARMENDRABHAI 9624535957 Check on Mantri No recent sales (999.0 days since last sale) Medium 23.12\n", + " VATADARA KHAMBHAT ANAND JAYANTIBHAI 7698601662 Call Mantri for Follow-up High untapped potential (258.0 sabhasad not contacted) High 22.02\n", + " NATVARNAGAR SAVLI VADODARA KIRITBHAI RATHOD 7698792086 Call Mantri for Follow-up High untapped potential (32.0 sabhasad not contacted) High 21.93\n", + " VADOD ANAND ANAND PRADIPSINH MAHIDA 9998270536 Call Mantri for Follow-up High untapped potential (230.0 sabhasad not contacted) High 21.46\n", + " BHIMPURA PADRA VADODARA RAMESHBHAI 9265446510 Check on Mantri No recent sales (999.0 days since last sale) Medium 20.96\n", + " ADIRAN WAGHODIA WAGHODIA ARJUNBHAI SOLANKI 8980144906 Check on Mantri No recent sales (999.0 days since last sale) Medium 20.93\n", + " HARIPURA KHAMBHAT ANAND RAMESHBHAI 9978285223 Check on Mantri No recent sales (999.0 days since last sale) Medium 20.78\n", + " DUNGRIPURA UMRETH ANAND JAYDEEPBHAI 9714687264 Check on Mantri No recent sales (999.0 days since last sale) Medium 20.62\n", + " PRATAPPURA UMRETH ANAND BHUPATBHAI 8780755962 Check on Mantri No recent sales (999.0 days since last sale) Medium 20.58\n", + " VADOLA KHAMBHAT ANAND JYANTIBHAI 7567518630 Call Mantri for Follow-up High untapped potential (75.0 sabhasad not contacted) High 20.44\n", + " KOSINDRA ANKALAV ANAND KANAKSINH 7359619019 Call Mantri for Follow-up High untapped potential (115.0 sabhasad not contacted) High 20.23\n", + " KOSINDRA BORSAD ANAND KANAKSINH PATEL 7359619019 Call Mantri for Follow-up High untapped potential (115.0 sabhasad not contacted) High 20.23\n", + " AMBALI ANKLAV ANAND KIRANBHAI 7698165451 Check on Mantri No recent sales (999.0 days since last sale) Medium 19.64\n", + " KALU BORSAD ANAND DHARMENDRASINH 9023579028 Call Mantri for Follow-up High untapped potential (122.0 sabhasad not contacted) High 19.22\n", + " MARGAKUI THASRA KHEDA SHANABHAI MAHERA 9925310608 Call Mantri for Follow-up High untapped potential (108.0 sabhasad not contacted) High 18.84\n", + " JITPURA UMRETH ANAND YOGESHBHAI 7990383811 Check on Mantri No recent sales (999.0 days since last sale) Medium 18.81\n", + " ZAKHARIYA ANAND ANAND RUTVIKBHAI 9327262524 Check on Mantri No recent sales (999.0 days since last sale) Medium 18.54\n", + " BADHIPURA UMRETH ANAND MOHANBHAI 8140622110 Call Mantri for Follow-up High untapped potential (69.0 sabhasad not contacted) High 18.54\n", + " KANTHARIYA ANKLAV ANAND MAHESHBHAI THAKOR 9313397942 Call Mantri for Follow-up High untapped potential (108.0 sabhasad not contacted) High 18.33\n", + " SIMARDA PETLAD ANAND PANKAJBHAI 7383092105 Check on Mantri No recent sales (999.0 days since last sale) Medium 18.17\n", + " SHANKARPURA WAGHODIA VADODARA UDAYSINH 9737117756 Check on Mantri No recent sales (999.0 days since last sale) Medium 17.95\n", + " KOTHIYAKHAD BORSAD ANAND RAVIBHAI 7043826112 Call Mantri for Follow-up High untapped potential (113.0 sabhasad not contacted) High 17.81\n", + " MUJKUVA ANKALAV ANAND LABHUBHAI - SECRETORY 9924570056 Call Mantri for Follow-up High untapped potential (47.0 sabhasad not contacted) High 17.31\n", + " SHEKHADI PETLAD ANAND KAMLESHBHAI PATEL 9106850412 / Call Mantri for Follow-up High untapped potential (99.0 sabhasad not contacted) High 17.13\n", + " NANI SHERKHI VADODARA VADODARA LAHERBHAI 9586267241 Check on Mantri No recent sales (999.0 days since last sale) Medium 16.83\n", + " NANI SHERKHI VADODARA VADODARA LAHERBHAI 9586267241 Check on Mantri No recent sales (999.0 days since last sale) Medium 16.83\n", + " NAPAD VANTO ANAND ANAND SHABBIRBHAI RATHOD 8460326712 Check on Mantri No recent sales (999.0 days since last sale) Medium 16.83\n", + " MOTI SANKHYAD ANKLAV ANAND DALSUKHBHAI SOLANKI 9879983291 Check on Mantri No recent sales (999.0 days since last sale) Medium 16.80\n", + " AJUPURA ANAND ANAND JAGDISHBHAI 9265960608 Check on Mantri No recent sales (999.0 days since last sale) Medium 16.72\n", + " BHATPURA UMRETH ANAND YUVRAJSINH 6353209447 Check on Mantri No recent sales (999.0 days since last sale) Medium 16.70\n", + " VAKHATPURA VADODARA VADODARA Dr. NATUBHAI 997989840 Check on Mantri No recent sales (999.0 days since last sale) Medium 16.68\n", + " VAKHATPURA VADODARA VADODARA NATVARBHAI GOHIL 9979898470 Check on Mantri No recent sales (999.0 days since last sale) Medium 16.68\n", + " GOTHADA SAVLI VADODARA AJGAR KHAN 9724831903 Check on Mantri No recent sales (999.0 days since last sale) Medium 16.68\n", + " DILLICHAKLA BORSAD ANAND MEHULBHAI 9726644968 Call Mantri for Follow-up High untapped potential (104.0 sabhasad not contacted) High 16.39\n", + " RANIYA THASRA KHEDA MAHENDRABHAI 9727340474 Check on Mantri No recent sales (999.0 days since last sale) Medium 15.90\n", + " KESHAVPURA ANKLAV ANAND DILIPBHAI PADHIYAR 6351990353 Check on Mantri No recent sales (999.0 days since last sale) Medium 15.85\n", + " ODE ANAND ANAND JAYDEEPBHAI PATEL 7600913314 Check on Mantri No recent sales (999.0 days since last sale) Medium 15.84\n", + " HARKHAPURA KHAMBHAT ANAND NILESHBHAI 8780110103 Check on Mantri No recent sales (999.0 days since last sale) Medium 15.82\n", + " MORAD PETLAD ANAND ANILBHAI 9898681901 Check on Mantri No recent sales (999.0 days since last sale) Medium 15.68\n", + " KHAKHANPUR UMRETH ANAND VINUBHAI 6352399755 Check on Mantri No recent sales (999.0 days since last sale) Medium 15.53\n", + " DHOLI UMRETH ANAND RAMSINH 9904743303 Check on Mantri No recent sales (999.0 days since last sale) Medium 15.11\n", + " ASODAR ANKALAV ANAND MUKESHBHAI 9904502098 Check on Mantri No recent sales (999.0 days since last sale) Medium 14.80\n", + " KANDHROTI BORSAD ANAND RAMANBHAI 9904930269 Check on Mantri No recent sales (999.0 days since last sale) Medium 14.70\n", + " CHAMARA ANKLAV ANAND FATABHAI PADHIYAR 8347183421 Call Mantri for Follow-up High untapped potential (35.0 sabhasad not contacted) High 14.65\n", + " KANBHAIPURA UMRETH ANAND KABHAIBHAI PRAJAPATI 9978552418 Call Mantri for Follow-up High untapped potential (56.0 sabhasad not contacted) High 14.38\n", + " BORIYA PETLAD ANAND VIJAYBHAI 7046580350 Call Mantri for Follow-up High untapped potential (54.0 sabhasad not contacted) High 13.86\n", + " BHAVANIPURA PETLAD ANAND SATISHBHAI 9979472671 Call Mantri for Follow-up High untapped potential (81.0 sabhasad not contacted) High 13.71\n", + " GAJANA BORSAD ANAND NARENDRABHAI 9316344592 Check on Mantri No recent sales (999.0 days since last sale) Medium 13.59\n", + " KAYAVAROHAN DABHOI VADODARA JAGDISHBHAI PATEL 9909719274 Check on Mantri No recent sales (999.0 days since last sale) Medium 13.41\n", + " DUNDELAV WAGHODIYA VADODRA CHIMANBHAI 9925880109 Check on Mantri No recent sales (999.0 days since last sale) Medium 13.25\n", + " RATANPURA UMRETH ANAND SHAILESHBHAI RATHOD 9725093842 Check on Mantri No recent sales (999.0 days since last sale) Medium 13.25\n", + " PILODARA BORSAD ANAND DILIPBHAI JADAV 9601626216 Check on Mantri No recent sales (999.0 days since last sale) Medium 13.02\n", + " KANTHARAI THASRA KHEDA JAGDISHBHAI 9687013839 Call Mantri for Follow-up High untapped potential (69.0 sabhasad not contacted) High 12.79\n", + "NAGRA(KHODIYARNAGAR) KHAMBHAT ANAND MAHESHBHAI MAKVANA 6353875955 Call Mantri for Follow-up High untapped potential (99.0 sabhasad not contacted) High 12.70\n", + " NANI SANKHYAD ANKLAV ANAND DR.THAKORBHAI 9727121151 Check on Mantri No recent sales (999.0 days since last sale) Medium 12.61\n", + " NANI SANKHYAD ANKALAV ANAND DR. THAKORBHAI 9737482949 Check on Mantri No recent sales (999.0 days since last sale) Medium 12.61\n", + " MIYAGAM KARJAN VADODARA KIRANBHAI 8000686958 Check on Mantri No recent sales (999.0 days since last sale) Medium 12.61\n", + " SANGADOL VAGHODIA VADODARA GIRVATNBHAI RAJPUT 8347090265 Check on Mantri No recent sales (999.0 days since last sale) Medium 12.57\n", + " KATHOL BORSAD ANAND BUDHABHAI 9662837294 Check on Mantri No recent sales (999.0 days since last sale) Medium 12.46\n", + " MANJIPURA THASRA KHEDA AJAYBHAI PATEL 9737910554 Check on Mantri No recent sales (999.0 days since last sale) Medium 12.00\n", + " KHANKUVA UMRETH ANAND SURESHBHAI THAKOR 9924946614 Check on Mantri No recent sales (999.0 days since last sale) Medium 11.42\n", + " KALYANPURA UMRETH ANAND MANSINH 9924825699 Check on Mantri No recent sales (999.0 days since last sale) Medium 11.18\n", + " RAWAL VAGHODIA VADODARA JAGDISHBHAI 7359925116 Check on Mantri No recent sales (999.0 days since last sale) Medium 11.15\n", + " BHARODA UMRETH ANAND MUKESHBHAI 7572979767 Check on Mantri No recent sales (999.0 days since last sale) Medium 10.77\n", + " SAMARKHA ANAND ANAND MAHENDRABHAI THAKOR 8401608917 Check on Mantri No recent sales (999.0 days since last sale) Medium 10.71\n", + " VAHERAKHADI ANAND ANAND DR.HAMIDBHAI 9898691947 Check on Mantri No recent sales (999.0 days since last sale) Medium 10.15\n", + " NAVAPURA VADODARA VADODARA PRAVINBHAI B GOHIL 4578123654 Check on Mantri No recent sales (999.0 days since last sale) Medium 10.06\n", + " KASUMBAD BORSAD ANAND Dr. AJITBHAI CHAUHAN 9313889597 Check on Mantri No recent sales (999.0 days since last sale) Medium 10.04\n", + " MANPURA ANKLAV ANAND Dr. LALJIBHAI 9081339374 Check on Mantri No recent sales (999.0 days since last sale) Medium 10.02\n", + " CHOKARI PADRA VADODARA PRAVINBHAI 9913975412 Check on Mantri No recent sales (999.0 days since last sale) Medium 10.02\n", + " KHADANA PETLAD ANAND SHANABHAI-MANTRY 6351055831 Check on Mantri No recent sales (999.0 days since last sale) Medium 10.02\n", + " KHORWAD UMRETH ANAND MUKESHBHAI 9726858703 Check on Mantri No recent sales (999.0 days since last sale) Medium 9.60\n", + " NAGRA KHAMBHAT ANAND HEMALBHAI PATEL 8200741203 Check on Mantri No recent sales (999.0 days since last sale) Medium 9.53\n", + " KANCHORAPURA BORSAD ANAND PRAVINBHAI PATEL 9723468521 Check on Mantri No recent sales (999.0 days since last sale) Medium 9.43\n", + " FINAV KHAMBHAT ANAND DHIRAJBHAI PATEL 8849939596 Check on Mantri No recent sales (999.0 days since last sale) Medium 8.77\n", + " RASAWADI SAVLI VADODARA MAYURSINH RATHOD 6354933728 Check on Mantri No recent sales (999.0 days since last sale) Medium 8.41\n", + " BAMANGAM ANKALAV ANAND PARESHBHAI-CASHIER 9998851329 Check on Mantri No recent sales (999.0 days since last sale) Medium 8.41\n", + " RASULABAD VAGHODIA VADODARA UPENDRASINH GARADHIYA 9106644185 Check on Mantri No recent sales (999.0 days since last sale) Medium 8.39\n", + " SHERPURA SAVLI VADODARA KIRITBHAI SOLANKI 7069401622 Check on Mantri No recent sales (999.0 days since last sale) Medium 8.37\n", + " GANA ANAND ANAND JAYESHBHAI PATEL 9879977750 Check on Mantri No recent sales (999.0 days since last sale) Medium 8.35\n", + " DABHASI BORSAD ANAND RAJESHBHAI NaN Check on Mantri No recent sales (999.0 days since last sale) Medium 8.31\n", + " VALVOD BORSAD ANAND JAYRAJSINH 8347977820 Check on Mantri No recent sales (999.0 days since last sale) Medium 8.20\n", + " KHADOL (H ) PETLAD ANAND ARJUNBHAI - MANTRY 6352153213 Check on Mantri No recent sales (999.0 days since last sale) Medium 7.73\n", + " SHERKHI VADODARA VADODARA LAHERBHAI 9586267241 Check on Mantri No recent sales (999.0 days since last sale) Medium 7.56\n", + " ASODAR ANKLAV ANAND VASIM VAHORA- 9725089741 Check on Mantri No recent sales (999.0 days since last sale) Medium 7.18\n", + " DHANTEJ SAVLI VADODARA GHANSHYAMBHAI 6353745632 Check on Mantri No recent sales (999.0 days since last sale) Medium 7.18\n", + " DUDHAPURA UMRETH ANAND HIMMATSINH 8160906435 Check on Mantri No recent sales (999.0 days since last sale) Medium 7.16\n", + " TUNDAV SAVLI VADODARA RAHIM RANA 9979512832 Check on Mantri No recent sales (999.0 days since last sale) Medium 7.16\n", + " AMODAR VAGHODIYA VADODARA RAJVANTBHAI 6352134649 Check on Mantri No recent sales (999.0 days since last sale) Medium 6.88\n", + " SINGLAV BORSAD ANAND GANPATBHAI 6352187692 Check on Mantri No recent sales (999.0 days since last sale) Medium 6.74\n", + " VANADARA DABHOI VADODARA JAYRAJBHAI SOLANKI 7698346288 Check on Mantri No recent sales (999.0 days since last sale) Medium 6.29\n", + " SINDHROT ANKALAV ANAND KIRITBHAI 9870070574 Check on Mantri No recent sales (999.0 days since last sale) Medium 6.29\n", + " ASHI PETLAD ANAND MANHARBHAI 8155931534 Check on Mantri No recent sales (999.0 days since last sale) Medium 6.29\n", + " PAMOL PETLAD ANAND DR. AMITBHAI 9924230429 Check on Mantri No recent sales (999.0 days since last sale) Medium 5.59\n", + " GOPALPURA ANAND ANAND SHAILESHBHAI 7990024992 Check on Mantri No recent sales (999.0 days since last sale) Medium 5.57\n", + " NANA KALODARA KHAMBHAT ANAND RAVINDRABHAI PATEL 9426884301 Check on Mantri No recent sales (999.0 days since last sale) Medium 4.95\n", + " MOGAR ANAND ANAND MUKESHBHAI 9724777879 Check on Mantri No recent sales (999.0 days since last sale) Medium 4.58\n", + " MOGAR ANAND ANAND MUKESHBHAI 9724777879 Check on Mantri No recent sales (999.0 days since last sale) Medium 4.58\n", + " RANJITNAGAR SAVLI VADODARA VIKRAMBHAI 9586986099 Check on Mantri No recent sales (999.0 days since last sale) Medium 4.56\n", + " DAGJIPURA UMRETH ANAND RAMESHBHAI 9574627424 Check on Mantri No recent sales (999.0 days since last sale) Medium 4.56\n", + " MAHAPURA VADODARA VADODARA PRAVINBHAI CHAUHAN 9904071931 Check on Mantri No recent sales (999.0 days since last sale) Medium 4.56\n", + " VAGASHI ANAND ANAND KIRITBHAI 7284836990 Check on Mantri No recent sales (999.0 days since last sale) Medium 4.18\n", + " SURELI UMRETH ANAND FIROZKHAN PATHAN 7567641110 Check on Mantri No recent sales (999.0 days since last sale) Medium 3.59\n", + " GORVA BORSAD ANAND VIKRAMBHAI 6353733421 Check on Mantri No recent sales (999.0 days since last sale) Medium 3.35\n", + " VAHERA BORSAD ANAND ARJUNBHAI 9173706418 Check on Mantri No recent sales (999.0 days since last sale) Medium 3.32\n", + " VADU PADRA PADRA MANUBHAI PATEL 9909239416 Check on Mantri No recent sales (999.0 days since last sale) Medium 3.16\n", + " NAMISARA SAVLI VADODARA JAYESHBHAI MAKVANA 7567518630 Check on Mantri No recent sales (999.0 days since last sale) Medium 3.14\n", + " SALUN THASRA KHEDA DASARATHBHAI PARMAR 9316769790 Check on Mantri No recent sales (999.0 days since last sale) Medium 3.14\n", + " GAMANPURA UMRETH ANAND JAGDISHBHAI 9924762935 Check on Mantri No recent sales (999.0 days since last sale) Medium 2.85\n", + " RAIPURA VADODARA VADODARA GANPATBHAI 9724666711 Check on Mantri No recent sales (999.0 days since last sale) Medium 2.65\n", + " DHUNDHAKUVA BORSAD ANAND DR. VIJAYBHAI 9904053999 Check on Mantri No recent sales (999.0 days since last sale) Medium 2.29\n", + " SAMBHOI KARJAN VADODARA SHAILESHBHAI 6351912663 Check on Mantri No recent sales (999.0 days since last sale) Medium 0.00\n", + " KOTAMBI SAVLI VADODARA VISHNUBHAI 9909550170 Check on Mantri No recent sales (999.0 days since last sale) Medium 0.00\n", + " RAMPURA VADODARA VADODARA JYOTSHANABEN 9016114912 Check on Mantri No recent sales (999.0 days since last sale) Medium 0.00\n", + " NEJA KHAMBHAT ANAND VIKRAMBHAI BHARVAD 9979486637 Check on Mantri No recent sales (999.0 days since last sale) Medium 0.00\n", + " DARAPURA PADRA VADODARA JYOTIBEN 9726768402 Check on Mantri No recent sales (999.0 days since last sale) Medium 0.00\n", + " LASUNDRA SAVLI VADODARA SHAHID BHALAVAT 6355754371 Check on Mantri No recent sales (999.0 days since last sale) Medium 0.00\n", + " AMRUTPURA THASRA KHEDA RAJENDRABHAI GOHIL 7984449859 Check on Mantri No recent sales (999.0 days since last sale) Medium 0.00\n", + " BODKA KARJAN VADODARA RAJENDRASINH RATHOD 9904267230 Check on Mantri No recent sales (999.0 days since last sale) Medium 0.00\n", + " LAXMIPURA UMRETH ANAND UDESINH BAPU 9624234618 Check on Mantri No recent sales (999.0 days since last sale) Medium 0.00\n", + " MOTI SHERKHI VADODARA VADODARA HITENDRASINH MAHIDA 9726857917 Check on Mantri No recent sales (999.0 days since last sale) Medium 0.00\n", + " VAKANER SAVLI VADODARA SURPALSINH MAHIDA 9824741993 Check on Mantri No recent sales (999.0 days since last sale) Medium 0.00\n", + " BAUTHA SAVLI VADODARA HIMMATBHAI SOLANKI 9924683267 Check on Mantri No recent sales (999.0 days since last sale) Medium 0.00\n", + " CHIKHODARA ANAND ANAND RANJITBHAI 8849744704 Check on Mantri No recent sales (999.0 days since last sale) Medium 0.00\n", + " PIRODNAGAR VADODARA VADODARA SANJAYBHAI PARMAR 8239791094 Check on Mantri No recent sales (999.0 days since last sale) Medium 0.00\n", + " JILOD ANKALAV ANAND AJAYBHAI PATEL 7984136988 Check on Mantri No recent sales (999.0 days since last sale) Medium 0.00\n", + " FANGANI PETLAD ANAND JIGNESHBHAI 8128009429 Check on Mantri No recent sales (999.0 days since last sale) Medium -4.18\n", + " CHANVADA DABHAOI VADODARA RATHOD RAHEMATKHAN 9925069598 Check on Mantri No recent sales (999.0 days since last sale) Medium -10.02\n", + " TRANOL KARJAN VADODARA BHAGABHAI 9723615554 Check on Mantri No recent sales (999.0 days since last sale) Medium -10.04\n", + " KHADODHI KHAMBHAT ANAND ARVINDBHAI 9712898839 Check on Mantri No recent sales (999.0 days since last sale) Medium -12.81\n", + " ASARAMA ANKLAV ANAND RASIKBHAI R VAGHELA 9723687092 Check on Mantri No recent sales (999.0 days since last sale) Medium -275.21\n", + " KASOR PETLAD ANAND MELABHAI PARMAR 8488051333 Check on Mantri No recent sales (999.0 days since last sale) Medium -592.73\n", + " HAMIDPURA UMRETH ANAND SURESHBHAI SOLANKI 9033782505 Send Marketing Team Low conversion rate (0.0%) - Only nan of 184 sabhasad contacted High NaN\n", + "\n", + "MANTRI MESSAGES:\n", + "\n", + "To: AJAYBHAI PATEL (7984136988) - JILOD\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste AJAYBHAI PATEL Ji!\n", + "\n", + "Humne dekha ki aapke kshetra JILOD mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: AJAYBHAI PATEL (9737910554) - MANJIPURA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste AJAYBHAI PATEL Ji!\n", + "\n", + "Humne dekha ki aapke kshetra MANJIPURA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: AJGAR KHAN (9724831903) - GOTHADA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste AJGAR KHAN Ji!\n", + "\n", + "Humne dekha ki aapke kshetra GOTHADA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: AMBALAL CHAUHAN (9313860902) - UNTKHARI\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste AMBALAL CHAUHAN Ji!\n", + "\n", + "Aapke kshetra UNTKHARI mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: AMBALAL GOHIL (9978081739) - VEMAR\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste AMBALAL GOHIL Ji!\n", + "\n", + "Aapke kshetra VEMAR mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: ANILBHAI (9898681901) - MORAD\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste ANILBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra MORAD mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: ANKITBHAI RABARI (9978541194) - VATRA\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste ANKITBHAI RABARI Ji!\n", + "\n", + "Aapke kshetra VATRA mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: ARJUNBHAI (9173706418) - VAHERA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste ARJUNBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra VAHERA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: ARJUNBHAI - MANTRY (9428489479) - DALI\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste ARJUNBHAI - MANTRY Ji!\n", + "\n", + "Aapke kshetra DALI mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: ARJUNBHAI - MANTRY (6352153213) - KHADOL (H )\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste ARJUNBHAI - MANTRY Ji!\n", + "\n", + "Humne dekha ki aapke kshetra KHADOL (H ) mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: ARJUNBHAI SOLANKI (8980144906) - ADIRAN\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste ARJUNBHAI SOLANKI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra ADIRAN mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: ARVIND PARMAR (9714275164) - RAVIPURA\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste ARVIND PARMAR Ji!\n", + "\n", + "Aapke kshetra RAVIPURA mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: ARVINDBHAI (9712898839) - KHADODHI\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste ARVINDBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra KHADODHI mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: ARVINDBHAI (9724670628) - JANTRAL\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste ARVINDBHAI Ji!\n", + "\n", + "Aapke kshetra JANTRAL mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: ASHOKBHAI THAKOR (9924216299) - BHAREL\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste ASHOKBHAI THAKOR Ji!\n", + "\n", + "Aapke kshetra BHAREL mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: BAKORBHAI THAKOR (7990576594) - KUKVAD\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste BAKORBHAI THAKOR Ji!\n", + "\n", + "Aapke kshetra KUKVAD mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: BALVANTBHAI (9978011241) - VEDACH\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste BALVANTBHAI Ji!\n", + "\n", + "Aapke kshetra VEDACH mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: BHAGABHAI (9723615554) - TRANOL\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste BHAGABHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra TRANOL mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: BHAILALBHAI (9016933551) - NAVAPURA\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste BHAILALBHAI Ji!\n", + "\n", + "Aapke kshetra NAVAPURA mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: BHALABHAI (9727198451) - DEVRAMPURA\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste BHALABHAI Ji!\n", + "\n", + "Aapke kshetra DEVRAMPURA mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: BHARATBHAI PARMAR(CHAIRMAN) (9879726187) - BORSAD MAIN DAIRY\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste BHARATBHAI PARMAR(CHAIRMAN) Ji!\n", + "\n", + "Aapke kshetra BORSAD MAIN DAIRY mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: BHARATBHAI(DOCTOR) (7698969285) - KHIJALPUR\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste BHARATBHAI(DOCTOR) Ji!\n", + "\n", + "Aapke kshetra KHIJALPUR mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: BHAVESHBHAI (7016899971) - KANBHA\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste BHAVESHBHAI Ji!\n", + "\n", + "Aapke kshetra KANBHA mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: BHIKHABHAI (9723885382) - TRAMBOVAD\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste BHIKHABHAI Ji!\n", + "\n", + "Aapke kshetra TRAMBOVAD mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: BHUPATBHAI (8780755962) - PRATAPPURA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste BHUPATBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra PRATAPPURA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: BUDHABHAI (9662837294) - KATHOL\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste BUDHABHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra KATHOL mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: CHANDUBHAI (9106700348) - DADPURA\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste CHANDUBHAI Ji!\n", + "\n", + "Aapke kshetra DADPURA mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: CHIMANBHAI (9925880109) - DUNDELAV\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste CHIMANBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra DUNDELAV mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: DALPATSINH (9909550925) - RAJPUR\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste DALPATSINH Ji!\n", + "\n", + "Aapke kshetra RAJPUR mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: DALSUKHBHAI SOLANKI (9879983291) - MOTI SANKHYAD\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste DALSUKHBHAI SOLANKI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra MOTI SANKHYAD mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: DASARATHBHAI PARMAR (9316769790) - SALUN\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste DASARATHBHAI PARMAR Ji!\n", + "\n", + "Humne dekha ki aapke kshetra SALUN mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: DHARMENDRABHAI (9327897366) - VASVEL\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste DHARMENDRABHAI Ji!\n", + "\n", + "Aapke kshetra VASVEL mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: DHARMENDRABHAI (9624535957) - NAVAPURA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste DHARMENDRABHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra NAVAPURA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: DHARMENDRASINH (9023579028) - KALU\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste DHARMENDRASINH Ji!\n", + "\n", + "Aapke kshetra KALU mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: DHIRAJBHAI PATEL (8849939596) - FINAV\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste DHIRAJBHAI PATEL Ji!\n", + "\n", + "Humne dekha ki aapke kshetra FINAV mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: DILIPBHAI (9510341268) - BILPAD\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste DILIPBHAI Ji!\n", + "\n", + "Aapke kshetra BILPAD mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: DILIPBHAI (8128252762) - SINHOL\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste DILIPBHAI Ji!\n", + "\n", + "Aapke kshetra SINHOL mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: DILIPBHAI JADAV (9601626216) - PILODARA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste DILIPBHAI JADAV Ji!\n", + "\n", + "Humne dekha ki aapke kshetra PILODARA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: DILIPBHAI PADHIYAR (6351990353) - KESHAVPURA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste DILIPBHAI PADHIYAR Ji!\n", + "\n", + "Humne dekha ki aapke kshetra KESHAVPURA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: Dr. AJITBHAI CHAUHAN (9313889597) - KASUMBAD\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste Dr. AJITBHAI CHAUHAN Ji!\n", + "\n", + "Humne dekha ki aapke kshetra KASUMBAD mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: DR. AMITBHAI (9924230429) - PAMOL\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste DR. AMITBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra PAMOL mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: Dr. LALJIBHAI (9081339374) - MANPURA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste Dr. LALJIBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra MANPURA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: DR. NARENDRASINH (9510942485) - ALARASHA\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste DR. NARENDRASINH Ji!\n", + "\n", + "Aapke kshetra ALARASHA mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: Dr. NATUBHAI (997989840) - VAKHATPURA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste Dr. NATUBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra VAKHATPURA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: DR. THAKORBHAI (9737482949) - NANI SANKHYAD\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste DR. THAKORBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra NANI SANKHYAD mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: DR. VIJAYBHAI (9904053999) - DHUNDHAKUVA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste DR. VIJAYBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra DHUNDHAKUVA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: DR.HAMIDBHAI (9898691947) - VAHERAKHADI\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste DR.HAMIDBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra VAHERAKHADI mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: DR.THAKORBHAI (9727121151) - NANI SANKHYAD\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste DR.THAKORBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra NANI SANKHYAD mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: FATABHAI PADHIYAR (8347183421) - CHAMARA\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste FATABHAI PADHIYAR Ji!\n", + "\n", + "Aapke kshetra CHAMARA mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: FATABHAI PADHIYAR (8347183421) - CHAMARA\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste FATABHAI PADHIYAR Ji!\n", + "\n", + "Aapke kshetra CHAMARA mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: FIROZKHAN PATHAN (7567641110) - SURELI\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste FIROZKHAN PATHAN Ji!\n", + "\n", + "Humne dekha ki aapke kshetra SURELI mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: GANPATBHAI (6352187692) - SINGLAV\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste GANPATBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra SINGLAV mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: GANPATBHAI (9724666711) - RAIPURA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste GANPATBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra RAIPURA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: GANPATBHAI (9016698604) - RANCHHODPURA\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste GANPATBHAI Ji!\n", + "\n", + "Aapke kshetra RANCHHODPURA mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: GANPATSINH (9924169009) - RATAN JI NA MUVADA\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste GANPATSINH Ji!\n", + "\n", + "Aapke kshetra RATAN JI NA MUVADA mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: GHANSHYAMBHAI (6353745632) - DHANTEJ\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste GHANSHYAMBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra DHANTEJ mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: GIRVATNBHAI RAJPUT (8347090265) - SANGADOL\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste GIRVATNBHAI RAJPUT Ji!\n", + "\n", + "Humne dekha ki aapke kshetra SANGADOL mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: GOPALBHAI (8866805602) - SHILI\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste GOPALBHAI Ji!\n", + "\n", + "Aapke kshetra SHILI mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: GOPALBHAI (7623858581) - RASULPUR\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste GOPALBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra RASULPUR mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: GOPALBHAI (8347727273) - BECHRI\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste GOPALBHAI Ji!\n", + "\n", + "Aapke kshetra BECHRI mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: HANUKAKA (8140100407) - BODIKUVA\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste HANUKAKA Ji!\n", + "\n", + "Aapke kshetra BODIKUVA mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: HARSHADBHAI (9537555788) - RAJUPURA\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste HARSHADBHAI Ji!\n", + "\n", + "Aapke kshetra RAJUPURA mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: HARSHADBHAI (9537555788) - RAJUPURA\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste HARSHADBHAI Ji!\n", + "\n", + "Aapke kshetra RAJUPURA mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: HEMALBHAI PATEL (8200741203) - NAGRA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste HEMALBHAI PATEL Ji!\n", + "\n", + "Humne dekha ki aapke kshetra NAGRA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: HIMMATBHAI (8980848224) - PARVATA\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste HIMMATBHAI Ji!\n", + "\n", + "Aapke kshetra PARVATA mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: HIMMATBHAI SOLANKI (9924683267) - BAUTHA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste HIMMATBHAI SOLANKI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra BAUTHA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: HIMMATSINH (8160906435) - DUDHAPURA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste HIMMATSINH Ji!\n", + "\n", + "Humne dekha ki aapke kshetra DUDHAPURA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: HITENDRASINH MAHIDA (9726857917) - MOTI SHERKHI\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste HITENDRASINH MAHIDA Ji!\n", + "\n", + "Humne dekha ki aapke kshetra MOTI SHERKHI mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: INDUBHAI ( JAYESHBHAI ) (9925069851) - JAROD\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste INDUBHAI ( JAYESHBHAI ) Ji!\n", + "\n", + "Aapke kshetra JAROD mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JAGDISHBHAI (7359925116) - RAWAL\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste JAGDISHBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra RAWAL mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JAGDISHBHAI (9687013839) - KANTHARAI\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste JAGDISHBHAI Ji!\n", + "\n", + "Aapke kshetra KANTHARAI mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JAGDISHBHAI (9265960608) - AJUPURA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste JAGDISHBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra AJUPURA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JAGDISHBHAI (9924762935) - GAMANPURA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste JAGDISHBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra GAMANPURA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JAGDISHBHAI PATEL (9909719274) - KAYAVAROHAN\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste JAGDISHBHAI PATEL Ji!\n", + "\n", + "Humne dekha ki aapke kshetra KAYAVAROHAN mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JAGDISHBHAI PATEL (9909719274) - KAYAVAROHAN\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste JAGDISHBHAI PATEL Ji!\n", + "\n", + "Aapke kshetra KAYAVAROHAN mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JASVANTSINH PARMAR (6354405815) - DHARKHUNIYA\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste JASVANTSINH PARMAR Ji!\n", + "\n", + "Aapke kshetra DHARKHUNIYA mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JAYANTIBHAI (8160204365) - PIPLOI\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste JAYANTIBHAI Ji!\n", + "\n", + "Aapke kshetra PIPLOI mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JAYANTIBHAI (7698601662) - VATADARA\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste JAYANTIBHAI Ji!\n", + "\n", + "Aapke kshetra VATADARA mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JAYDEEPBHAI (9714687264) - DUNGRIPURA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste JAYDEEPBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra DUNGRIPURA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JAYDEEPBHAI PATEL (7600913314) - ODE\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste JAYDEEPBHAI PATEL Ji!\n", + "\n", + "Humne dekha ki aapke kshetra ODE mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JAYDEEPSINH (9924903171) - JESAPURA\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste JAYDEEPSINH Ji!\n", + "\n", + "Aapke kshetra JESAPURA mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JAYESHBHAI MAKVANA (7567518630) - NAMISARA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste JAYESHBHAI MAKVANA Ji!\n", + "\n", + "Humne dekha ki aapke kshetra NAMISARA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JAYESHBHAI PATEL (9879977750) - GANA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste JAYESHBHAI PATEL Ji!\n", + "\n", + "Humne dekha ki aapke kshetra GANA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JAYRAJBHAI SOLANKI (7698346288) - VANADARA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste JAYRAJBHAI SOLANKI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra VANADARA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JAYRAJSINH (8347977820) - VALVOD\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste JAYRAJSINH Ji!\n", + "\n", + "Humne dekha ki aapke kshetra VALVOD mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JESANGBHAI CHAVDA (9427828741) - HATHIPURA\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste JESANGBHAI CHAVDA Ji!\n", + "\n", + "Aapke kshetra HATHIPURA mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JIGARBHAI (9998147762) - SUNAV\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste JIGARBHAI Ji!\n", + "\n", + "Aapke kshetra SUNAV mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JIGNESHBHAI (8128009429) - FANGANI\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste JIGNESHBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra FANGANI mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JORUBHAI (8200199030) - DHUVARAN\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste JORUBHAI Ji!\n", + "\n", + "Aapke kshetra DHUVARAN mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JYANTIBHAI (7567518630) - VADOLA\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste JYANTIBHAI Ji!\n", + "\n", + "Aapke kshetra VADOLA mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JYANTIBHAI (9825817354) - UMLAV\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste JYANTIBHAI Ji!\n", + "\n", + "Aapke kshetra UMLAV mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JYOTIBEN (9726768402) - DARAPURA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste JYOTIBEN Ji!\n", + "\n", + "Humne dekha ki aapke kshetra DARAPURA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JYOTSHANABEN (9016114912) - RAMPURA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste JYOTSHANABEN Ji!\n", + "\n", + "Humne dekha ki aapke kshetra RAMPURA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: KABHAIBHAI PRAJAPATI (9978552418) - KANBHAIPURA\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste KABHAIBHAI PRAJAPATI Ji!\n", + "\n", + "Aapke kshetra KANBHAIPURA mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: KABHAYBHAI (9925861038) - AMIYAD\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste KABHAYBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra AMIYAD mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: KAMLESHBHAI (6354508694) - BHARTHANA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste KAMLESHBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra BHARTHANA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: KAMLESHBHAI PATEL (9106850412 /) - SHEKHADI\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste KAMLESHBHAI PATEL Ji!\n", + "\n", + "Aapke kshetra SHEKHADI mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: KANAKSINH (7359619019) - KOSINDRA\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste KANAKSINH Ji!\n", + "\n", + "Aapke kshetra KOSINDRA mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: KANAKSINH PATEL (7359619019) - KOSINDRA\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste KANAKSINH PATEL Ji!\n", + "\n", + "Aapke kshetra KOSINDRA mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: KANUBHAI PARMAR (966481655) - MUVADA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste KANUBHAI PARMAR Ji!\n", + "\n", + "Humne dekha ki aapke kshetra MUVADA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: KHODSINH GOHIL (9601425263) - VITOJ\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste KHODSINH GOHIL Ji!\n", + "\n", + "Aapke kshetra VITOJ mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: KIRANBHAI (7698165451) - AMBALI\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste KIRANBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra AMBALI mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: KIRANBHAI (8000686958) - MIYAGAM\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste KIRANBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra MIYAGAM mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: KIRITBHAI (9870070574) - SINDHROT\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste KIRITBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra SINDHROT mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: KIRITBHAI (9408667583) - BHETASHI TALPAD\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste KIRITBHAI Ji!\n", + "\n", + "Aapke kshetra BHETASHI TALPAD mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: KIRITBHAI (7284836990) - VAGASHI\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste KIRITBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra VAGASHI mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: KIRITBHAI RATHOD (7698792086) - NATVARNAGAR\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste KIRITBHAI RATHOD Ji!\n", + "\n", + "Aapke kshetra NATVARNAGAR mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: KIRITBHAI SOLANKI (7069401622) - SHERPURA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste KIRITBHAI SOLANKI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra SHERPURA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: LABHUBHAI - SECRETORY (9924570056) - MUJKUVA\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste LABHUBHAI - SECRETORY Ji!\n", + "\n", + "Aapke kshetra MUJKUVA mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: LAHERBHAI (9586267241) - NANI SHERKHI\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste LAHERBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra NANI SHERKHI mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: LAHERBHAI (9586267241) - SHERKHI\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste LAHERBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra SHERKHI mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: LAHERBHAI (9586267241) - NANI SHERKHI\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste LAHERBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra NANI SHERKHI mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: LALJIBHAI (9909212667) - LALPURA\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste LALJIBHAI Ji!\n", + "\n", + "Aapke kshetra LALPURA mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MAHENDRABHAI (9727340474) - RANIYA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste MAHENDRABHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra RANIYA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MAHENDRABHAI THAKOR (8401608917) - SAMARKHA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste MAHENDRABHAI THAKOR Ji!\n", + "\n", + "Humne dekha ki aapke kshetra SAMARKHA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MAHESHBHAI MAKVANA (6353875955) - NAGRA(KHODIYARNAGAR)\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste MAHESHBHAI MAKVANA Ji!\n", + "\n", + "Aapke kshetra NAGRA(KHODIYARNAGAR) mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MAHESHBHAI THAKOR (9313397942) - KANTHARIYA\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste MAHESHBHAI THAKOR Ji!\n", + "\n", + "Aapke kshetra KANTHARIYA mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MANHARBHAI (8155931534) - ASHI\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste MANHARBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra ASHI mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MANSINH (9924825699) - KALYANPURA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste MANSINH Ji!\n", + "\n", + "Humne dekha ki aapke kshetra KALYANPURA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MANUBHAI (6355974133) - RAYPURA\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste MANUBHAI Ji!\n", + "\n", + "Aapke kshetra RAYPURA mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MANUBHAI PATEL (9909239416) - VADU\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste MANUBHAI PATEL Ji!\n", + "\n", + "Humne dekha ki aapke kshetra VADU mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MANUBHAI SOMABHAI CHAUHAN (9824643396) - BAJIPURA\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste MANUBHAI SOMABHAI CHAUHAN Ji!\n", + "\n", + "Aapke kshetra BAJIPURA mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MAYURSINH RATHOD (6354933728) - RASAWADI\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste MAYURSINH RATHOD Ji!\n", + "\n", + "Humne dekha ki aapke kshetra RASAWADI mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MEHULBHAI (9726644968) - DILLICHAKLA\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste MEHULBHAI Ji!\n", + "\n", + "Aapke kshetra DILLICHAKLA mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MEHULBHAI (9726644968) - KATHANA\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste MEHULBHAI Ji!\n", + "\n", + "Aapke kshetra KATHANA mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MELABHAI PARMAR (8488051333) - KASOR\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste MELABHAI PARMAR Ji!\n", + "\n", + "Humne dekha ki aapke kshetra KASOR mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MITULBHAI (7383094973) - KASOR\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste MITULBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra KASOR mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MOHANBHAI (8140622110) - BADHIPURA\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste MOHANBHAI Ji!\n", + "\n", + "Aapke kshetra BADHIPURA mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MUKESHBHAI (9724777879) - MOGAR\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste MUKESHBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra MOGAR mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MUKESHBHAI (9904502098) - ASODAR\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste MUKESHBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra ASODAR mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MUKESHBHAI (9724777879) - MOGAR\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste MUKESHBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra MOGAR mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MUKESHBHAI (9726858703) - KHORWAD\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste MUKESHBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra KHORWAD mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MUKESHBHAI (9913633154) - BOCHASAN\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste MUKESHBHAI Ji!\n", + "\n", + "Aapke kshetra BOCHASAN mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MUKESHBHAI (9624208283) - BANEJDA\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste MUKESHBHAI Ji!\n", + "\n", + "Aapke kshetra BANEJDA mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MUKESHBHAI (7572979767) - BHARODA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste MUKESHBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra BHARODA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: NAGINBHAI (4654654555) - RANOLI\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste NAGINBHAI Ji!\n", + "\n", + "Aapke kshetra RANOLI mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: NARENDRABHAI (9316344592) - GAJANA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste NARENDRABHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra GAJANA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: NARENDRABHAI (9909318997) - NAVGAMA\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste NARENDRABHAI Ji!\n", + "\n", + "Aapke kshetra NAVGAMA mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: NATUBHAI CHAIRMAN (9924917292) - KAMROL\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste NATUBHAI CHAIRMAN Ji!\n", + "\n", + "Aapke kshetra KAMROL mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: NATUKAKA (9726573829) - SANDHA\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste NATUKAKA Ji!\n", + "\n", + "Aapke kshetra SANDHA mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: NATVARBHAI GOHIL (9979898470) - VAKHATPURA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste NATVARBHAI GOHIL Ji!\n", + "\n", + "Humne dekha ki aapke kshetra VAKHATPURA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: NILESHBHAI (8780110103) - HARKHAPURA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste NILESHBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra HARKHAPURA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: NILESHBHAI (9898881850) - PORDA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste NILESHBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra PORDA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: PANKAJBHAI (7383092105) - SIMARDA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste PANKAJBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra SIMARDA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: PARESHBHAI (9879665401) - KHAKHARIYA\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste PARESHBHAI Ji!\n", + "\n", + "Aapke kshetra KHAKHARIYA mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: PARESHBHAI-CASHIER (9998851329) - BAMANGAM\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste PARESHBHAI-CASHIER Ji!\n", + "\n", + "Humne dekha ki aapke kshetra BAMANGAM mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: PARVATBHAI (9574229451) - ASHIPURA\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste PARVATBHAI Ji!\n", + "\n", + "Aapke kshetra ASHIPURA mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: PINTUBHAI (9824663860) - JOGAN\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste PINTUBHAI Ji!\n", + "\n", + "Aapke kshetra JOGAN mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: PRADIPSINH MAHIDA (9998270536) - VADOD\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste PRADIPSINH MAHIDA Ji!\n", + "\n", + "Aapke kshetra VADOD mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: PRAVINBHAI (9913975412) - CHOKARI\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste PRAVINBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra CHOKARI mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: PRAVINBHAI B GOHIL (4578123654) - NAVAPURA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste PRAVINBHAI B GOHIL Ji!\n", + "\n", + "Humne dekha ki aapke kshetra NAVAPURA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: PRAVINBHAI CHAUHAN (9904071931) - MAHAPURA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste PRAVINBHAI CHAUHAN Ji!\n", + "\n", + "Humne dekha ki aapke kshetra MAHAPURA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: PRAVINBHAI PATEL (9723468521) - DAHEVAN\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste PRAVINBHAI PATEL Ji!\n", + "\n", + "Humne dekha ki aapke kshetra DAHEVAN mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: PRAVINBHAI PATEL (9723468521) - AMBERAOPURA(DAHEVAN)\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste PRAVINBHAI PATEL Ji!\n", + "\n", + "Aapke kshetra AMBERAOPURA(DAHEVAN) mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: PRAVINBHAI PATEL (9723468521) - KANCHORAPURA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste PRAVINBHAI PATEL Ji!\n", + "\n", + "Humne dekha ki aapke kshetra KANCHORAPURA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: PUSHPABEN THAKORBHAI (8866515355) - MOKSHI\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste PUSHPABEN THAKORBHAI Ji!\n", + "\n", + "Aapke kshetra MOKSHI mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RAHIM RANA (9979512832) - TUNDAV\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste RAHIM RANA Ji!\n", + "\n", + "Humne dekha ki aapke kshetra TUNDAV mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RAHULBHAI PADHIYAR (6355245589) - BAJIPURA\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste RAHULBHAI PADHIYAR Ji!\n", + "\n", + "Aapke kshetra BAJIPURA mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RAJENDRABHAI GOHIL (7984449859) - AMRUTPURA \n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste RAJENDRABHAI GOHIL Ji!\n", + "\n", + "Humne dekha ki aapke kshetra AMRUTPURA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RAJENDRASINH (9510084847) - AHIMA\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste RAJENDRASINH Ji!\n", + "\n", + "Aapke kshetra AHIMA mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RAJENDRASINH RATHOD (9904267230) - BODKA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste RAJENDRASINH RATHOD Ji!\n", + "\n", + "Humne dekha ki aapke kshetra BODKA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RAJESHBHAI (nan) - DABHASI \n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste RAJESHBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra DABHASI mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RAJUBHAI (8511880200) - SAIJPUR\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste RAJUBHAI Ji!\n", + "\n", + "Aapke kshetra SAIJPUR mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RAJVANTBHAI (6352134649) - AMODAR\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste RAJVANTBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra AMODAR mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RAMANBHAI (9904930269) - KANDHROTI\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste RAMANBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra KANDHROTI mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RAMESHBHAI (9978285223) - HARIPURA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste RAMESHBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra HARIPURA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RAMESHBHAI (9265446510) - BHIMPURA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste RAMESHBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra BHIMPURA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RAMESHBHAI (9979137503) - GAMBHIRA\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste RAMESHBHAI Ji!\n", + "\n", + "Aapke kshetra GAMBHIRA mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RAMESHBHAI (9574627424) - DAGJIPURA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste RAMESHBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra DAGJIPURA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RAMESHBHAI BHUTSINH PARMAR (nan) - KATHANA STATION\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste RAMESHBHAI BHUTSINH PARMAR Ji!\n", + "\n", + "Aapke kshetra KATHANA STATION mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RAMSINH (9904743303) - DHOLI\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste RAMSINH Ji!\n", + "\n", + "Humne dekha ki aapke kshetra DHOLI mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RAMTUSINH (9328409149) - BALANAPURA\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste RAMTUSINH Ji!\n", + "\n", + "Aapke kshetra BALANAPURA mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RANJITBHAI (8849744704) - CHIKHODARA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste RANJITBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra CHIKHODARA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RASIKBHAI R VAGHELA (9723687092) - ASARAMA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste RASIKBHAI R VAGHELA Ji!\n", + "\n", + "Humne dekha ki aapke kshetra ASARAMA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RATHOD RAHEMATKHAN (9925069598) - CHANVADA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste RATHOD RAHEMATKHAN Ji!\n", + "\n", + "Humne dekha ki aapke kshetra CHANVADA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RAVIBHAI (7043826112) - KOTHIYAKHAD\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste RAVIBHAI Ji!\n", + "\n", + "Aapke kshetra KOTHIYAKHAD mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RAVINDRABHAI (9662740083) - KHEDASA\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste RAVINDRABHAI Ji!\n", + "\n", + "Aapke kshetra KHEDASA mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RAVINDRABHAI PATEL (9426884301) - NANA KALODARA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste RAVINDRABHAI PATEL Ji!\n", + "\n", + "Humne dekha ki aapke kshetra NANA KALODARA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RUTVIKBHAI (9327262524) - ZAKHARIYA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste RUTVIKBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra ZAKHARIYA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SAMIRBHAI PATEL (9898825711) - SARSA\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste SAMIRBHAI PATEL Ji!\n", + "\n", + "Aapke kshetra SARSA mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SANJAYBHAI (9974294254) - TRIKAMPURA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste SANJAYBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra TRIKAMPURA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SANJAYBHAI (8140766086) - SARDARPURA\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste SANJAYBHAI Ji!\n", + "\n", + "Aapke kshetra SARDARPURA mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SANJAYBHAI (7283995919) - POPATVAV\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste SANJAYBHAI Ji!\n", + "\n", + "Aapke kshetra POPATVAV mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SANJAYBHAI PARMAR (8239791094) - PIRODNAGAR\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste SANJAYBHAI PARMAR Ji!\n", + "\n", + "Humne dekha ki aapke kshetra PIRODNAGAR mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SATISHBHAI (9979472671) - BHAVANIPURA\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste SATISHBHAI Ji!\n", + "\n", + "Aapke kshetra BHAVANIPURA mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SHABBIRBHAI RATHOD (8460326712) - NAPAD VANTO\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste SHABBIRBHAI RATHOD Ji!\n", + "\n", + "Humne dekha ki aapke kshetra NAPAD VANTO mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SHAHID BHALAVAT (6355754371) - LASUNDRA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste SHAHID BHALAVAT Ji!\n", + "\n", + "Humne dekha ki aapke kshetra LASUNDRA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SHAILESHBHAI (7990024992) - GOPALPURA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste SHAILESHBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra GOPALPURA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SHAILESHBHAI (6351912663) - SAMBHOI\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste SHAILESHBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra SAMBHOI mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SHAILESHBHAI (9104244408) - VIRSAD\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste SHAILESHBHAI Ji!\n", + "\n", + "Aapke kshetra VIRSAD mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SHAILESHBHAI RATHOD (9725093842) - RATANPURA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste SHAILESHBHAI RATHOD Ji!\n", + "\n", + "Humne dekha ki aapke kshetra RATANPURA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SHAILESHBHAI SHARMA (7990024992) - GOPALPURA\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste SHAILESHBHAI SHARMA Ji!\n", + "\n", + "Aapke kshetra GOPALPURA mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SHANABHAI MAHERA (9925310608) - MARGAKUI\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste SHANABHAI MAHERA Ji!\n", + "\n", + "Aapke kshetra MARGAKUI mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SHANABHAI-MANTRY (6351055831) - KHADANA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste SHANABHAI-MANTRY Ji!\n", + "\n", + "Humne dekha ki aapke kshetra KHADANA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SHANKARBHAI THAKOR (8140448296) - JOGAN\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste SHANKARBHAI THAKOR Ji!\n", + "\n", + "Aapke kshetra JOGAN mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SURESHBHAI (9913584672) - JAKHLA\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste SURESHBHAI Ji!\n", + "\n", + "Aapke kshetra JAKHLA mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SURESHBHAI SOLANKI (9033782505) - HAMIDPURA\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste SURESHBHAI SOLANKI Ji!\n", + "\n", + "Aapke kshetra HAMIDPURA mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SURESHBHAI THAKOR (9924946614) - KHANKUVA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste SURESHBHAI THAKOR Ji!\n", + "\n", + "Humne dekha ki aapke kshetra KHANKUVA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SURPALSINH MAHIDA (9824741993) - VAKANER\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste SURPALSINH MAHIDA Ji!\n", + "\n", + "Humne dekha ki aapke kshetra VAKANER mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: UDAYSINH (9737117756) - SHANKARPURA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste UDAYSINH Ji!\n", + "\n", + "Humne dekha ki aapke kshetra SHANKARPURA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: UDESINH BAPU (9624234618) - LAXMIPURA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste UDESINH BAPU Ji!\n", + "\n", + "Humne dekha ki aapke kshetra LAXMIPURA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: UDESINH BHAI (9824287850) - DODHIYA PURA\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste UDESINH BHAI Ji!\n", + "\n", + "Aapke kshetra DODHIYA PURA mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: UPENDRASINH GARADHIYA (9106644185) - RASULABAD\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste UPENDRASINH GARADHIYA Ji!\n", + "\n", + "Humne dekha ki aapke kshetra RASULABAD mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: VANRAJBHAI (8347168185) - KALAMASAR\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste VANRAJBHAI Ji!\n", + "\n", + "Aapke kshetra KALAMASAR mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: VANRAJSINH SINDHA (8347168185) - KALAMSAR\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste VANRAJSINH SINDHA Ji!\n", + "\n", + "Aapke kshetra KALAMSAR mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: VASIM VAHORA- (9725089741) - ASODAR\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste VASIM VAHORA- Ji!\n", + "\n", + "Humne dekha ki aapke kshetra ASODAR mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: VASIMKHAN (546549846) - VISHNOLI\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste VASIMKHAN Ji!\n", + "\n", + "Aapke kshetra VISHNOLI mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: VIJAYBHAI (7046580350) - BORIYA\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste VIJAYBHAI Ji!\n", + "\n", + "Aapke kshetra BORIYA mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: VIJAYBHAI PARMAR (6351313878) - FATEPURA\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste VIJAYBHAI PARMAR Ji!\n", + "\n", + "Aapke kshetra FATEPURA mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: VIKRAMBHAI (6353733421) - GORVA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste VIKRAMBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra GORVA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: VIKRAMBHAI (9586986099) - RANJITNAGAR\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste VIKRAMBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra RANJITNAGAR mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: VIKRAMBHAI BHARVAD (9979486637) - NEJA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste VIKRAMBHAI BHARVAD Ji!\n", + "\n", + "Humne dekha ki aapke kshetra NEJA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: VIKRAMSINH (9712007585) - MITHAPURA\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste VIKRAMSINH Ji!\n", + "\n", + "Aapke kshetra MITHAPURA mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: VIKRAMSINH CHAUHAN (9825316980) - INDRAD\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste VIKRAMSINH CHAUHAN Ji!\n", + "\n", + "Aapke kshetra INDRAD mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: VINUBHAI (6352399755) - KHAKHANPUR\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste VINUBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra KHAKHANPUR mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: VINUBHAI SOLANKI (9998756469) - KANODA\n", + "Action: Send Marketing Team\n", + "Message: \n", + "Namaste VINUBHAI SOLANKI Ji!\n", + "\n", + "Aapke kshetra KANODA mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: VISHNUBHAI (9909550170) - KOTAMBI\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste VISHNUBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra KOTAMBI mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: VITHTHALBHAI (9924590017) - RASNOL\n", + "Action: Call Mantri for Follow-up\n", + "Message: \n", + "Namaste VITHTHALBHAI Ji!\n", + "\n", + "Aapke kshetra RASNOL mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: YOGESHBHAI (7990383811) - JITPURA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste YOGESHBHAI Ji!\n", + "\n", + "Humne dekha ki aapke kshetra JITPURA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: YUVRAJSINH (6353209447) - BHATPURA\n", + "Action: Check on Mantri\n", + "Message: \n", + "Namaste YUVRAJSINH Ji!\n", + "\n", + "Humne dekha ki aapke kshetra BHATPURA mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "TOP DEMO LOCATIONS:\n", + " Village Taluka District Mantri_Name Mantri_Mobile Conversion_Rate Untapped_Potential Demo_Score\n", + " JILOD ANKALAV ANAND AJAYBHAI PATEL 7984136988 100.00 0.0 NaN\n", + "MANJIPURA THASRA KHEDA AJAYBHAI PATEL 9737910554 76.19 5.0 NaN\n", + " GOTHADA SAVLI VADODARA AJGAR KHAN 9724831903 66.67 1.0 NaN\n", + " UNTKHARI UMRETH ANAND AMBALAL CHAUHAN 9313860902 0.00 0.0 NaN\n", + " VEMAR SAVLI VADODARA AMBALAL GOHIL 9978081739 0.00 2.0 NaN\n" + ] + } + ], + "source": [ + "def analyze_sales_data(data1, data2):\n", + " \"\"\"\n", + " Analyze sales data to identify targets for mantri communication and village focus\n", + " \"\"\"\n", + " # Convert date column if needed\n", + " data1['Date'] = pd.to_datetime(data1['Date'])\n", + " data2['Date'] = pd.to_datetime(data2['Date'])\n", + " \n", + " # Calculate key metrics from Data1 (village level)\n", + " data1['Conversion_Rate'] = (data1['Contact_In_Group'] / data1['Sabhasad'] * 100).round(2)\n", + " data1['Conversion_Rate'] = data1['Conversion_Rate'].replace([np.inf, -np.inf], 0).fillna(0)\n", + " data1['Untapped_Potential'] = data1['Sabhasad'] - data1['Contact_In_Group']\n", + " data1['Sales_Per_Contact'] = (data1['Total_L'] / data1['Contact_In_Group']).round(2)\n", + " data1['Sales_Per_Contact'] = data1['Sales_Per_Contact'].replace([np.inf, -np.inf], 0).fillna(0)\n", + " \n", + " # Calculate priority score for villages\n", + " data1['Priority_Score'] = (\n", + " (data1['Untapped_Potential'] / data1['Untapped_Potential'].max() * 50) +\n", + " ((100 - data1['Conversion_Rate']) / 100 * 50)\n", + " ).round(2)\n", + " \n", + " # Analyze recent sales from Data2 (customer level)\n", + " # Since we don't have customer contact info, we'll analyze at village level\n", + " recent_sales = data2.groupby('Village').agg({\n", + " 'Total_L': ['sum', 'count'],\n", + " 'Date': 'max'\n", + " }).reset_index()\n", + " \n", + " # Flatten the column names\n", + " recent_sales.columns = ['Village', 'Recent_Sales_L', 'Recent_Customers', 'Last_Sale_Date']\n", + " \n", + " # Calculate days since last sale\n", + " recent_sales['Days_Since_Last_Sale'] = (datetime.now() - recent_sales['Last_Sale_Date']).dt.days\n", + " \n", + " # Merge with Data1\n", + " analysis_df = data1.merge(recent_sales, on='Village', how='left')\n", + " analysis_df['Recent_Sales_L'] = analysis_df['Recent_Sales_L'].fillna(0)\n", + " analysis_df['Recent_Customers'] = analysis_df['Recent_Customers'].fillna(0)\n", + " analysis_df['Days_Since_Last_Sale'] = analysis_df['Days_Since_Last_Sale'].fillna(999)\n", + " \n", + " # Generate recommendations for mantris\n", + " recommendations = []\n", + " \n", + " for _, row in analysis_df.iterrows():\n", + " village = row['Village']\n", + " mantri = row['Mantri_Name']\n", + " mobile = row['Mantri_Mobile']\n", + " taluka = row['Taluka']\n", + " district = row['District']\n", + " \n", + " # Recommendation logic\n", + " if row['Conversion_Rate'] < 20:\n", + " recommendations.append({\n", + " 'Village': village,\n", + " 'Taluka': taluka,\n", + " 'District': district,\n", + " 'Mantri': mantri,\n", + " 'Mobile': mobile,\n", + " 'Action': 'Send Marketing Team',\n", + " 'Reason': f'Low conversion rate ({row[\"Conversion_Rate\"]:.1f}%) - Only {row[\"Contact_In_Group\"]} of {row[\"Sabhasad\"]} sabhasad contacted',\n", + " 'Priority': 'High',\n", + " 'Score': row['Priority_Score']\n", + " })\n", + " elif row['Untapped_Potential'] > 30:\n", + " recommendations.append({\n", + " 'Village': village,\n", + " 'Taluka': taluka,\n", + " 'District': district,\n", + " 'Mantri': mantri,\n", + " 'Mobile': mobile,\n", + " 'Action': 'Call Mantri for Follow-up',\n", + " 'Reason': f'High untapped potential ({row[\"Untapped_Potential\"]} sabhasad not contacted)',\n", + " 'Priority': 'High',\n", + " 'Score': row['Priority_Score']\n", + " })\n", + " elif row['Days_Since_Last_Sale'] > 30:\n", + " recommendations.append({\n", + " 'Village': village,\n", + " 'Taluka': taluka,\n", + " 'District': district,\n", + " 'Mantri': mantri,\n", + " 'Mobile': mobile,\n", + " 'Action': 'Check on Mantri',\n", + " 'Reason': f'No recent sales ({row[\"Days_Since_Last_Sale\"]} days since last sale)',\n", + " 'Priority': 'Medium',\n", + " 'Score': row['Priority_Score']\n", + " })\n", + " elif row['Sales_Per_Contact'] > 10:\n", + " recommendations.append({\n", + " 'Village': village,\n", + " 'Taluka': taluka,\n", + " 'District': district,\n", + " 'Mantri': mantri,\n", + " 'Mobile': mobile,\n", + " 'Action': 'Provide More Stock',\n", + " 'Reason': f'High sales per contact ({row[\"Sales_Per_Contact\"]}L per contact)',\n", + " 'Priority': 'Medium',\n", + " 'Score': row['Priority_Score']\n", + " })\n", + " else:\n", + " recommendations.append({\n", + " 'Village': village,\n", + " 'Taluka': taluka,\n", + " 'District': district,\n", + " 'Mantri': mantri,\n", + " 'Mobile': mobile,\n", + " 'Action': 'Regular Follow-up',\n", + " 'Reason': 'Steady performance - maintain relationship',\n", + " 'Priority': 'Low',\n", + " 'Score': row['Priority_Score']\n", + " })\n", + " \n", + " return pd.DataFrame(recommendations), analysis_df\n", + "\n", + "def generate_mantri_messages(recommendations):\n", + " \"\"\"\n", + " Generate personalized WhatsApp messages for mantris based on recommendations\n", + " \"\"\"\n", + " messages = []\n", + " \n", + " for _, row in recommendations.iterrows():\n", + " if row['Action'] == 'Send Marketing Team':\n", + " message = f\"\"\"\n", + "Namaste {row['Mantri']} Ji!\n", + "\n", + "Aapke kshetra {row['Village']} mein humare calcium supplement ki conversion rate kam hai. \n", + "Humari marketing team aapke yaha demo dene aayegi. \n", + "Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\"\"\"\n", + " elif row['Action'] == 'Call Mantri for Follow-up':\n", + " message = f\"\"\"\n", + "Namaste {row['Mantri']} Ji!\n", + "\n", + "Aapke kshetra {row['Village']} mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. \n", + "Kripya unse sampark karein aur unhe product ke fayde batayein. \n", + "Aapke liye special commission offer hai agle 10 customers ke liye.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\"\"\"\n", + " elif row['Action'] == 'Check on Mantri':\n", + " message = f\"\"\"\n", + "Namaste {row['Mantri']} Ji!\n", + "\n", + "Humne dekha ki aapke kshetra {row['Village']} mein kuch samay se sales nahi hue hain.\n", + "Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain?\n", + "\n", + "Kripya hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\"\"\"\n", + " elif row['Action'] == 'Provide More Stock':\n", + " message = f\"\"\"\n", + "Namaste {row['Mantri']} Ji!\n", + "\n", + "Badhai ho! Aapke kshetra {row['Village']} mein humare product ki demand badh rahi hai.\n", + "Kya aapko aur stock ki zaroorat hai? Hum jald se jald aapko extra stock bhej denge.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\"\"\"\n", + " else:\n", + " message = f\"\"\"\n", + "Namaste {row['Mantri']} Ji!\n", + "\n", + "Aapke kshetra {row['Village']} mein humare product ki sales theek chal rahi hain.\n", + "Kripya aise hi continue rakhein aur koi bhi sujhav ho toh hame batayein.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\"\"\"\n", + " \n", + " messages.append({\n", + " 'Mantri': row['Mantri'],\n", + " 'Mobile': row['Mobile'],\n", + " 'Village': row['Village'],\n", + " 'Action': row['Action'],\n", + " 'Message': message,\n", + " 'Priority': row['Priority']\n", + " })\n", + " \n", + " return pd.DataFrame(messages)\n", + "\n", + "def identify_demo_locations(analysis_df, top_n=5):\n", + " \"\"\"\n", + " Identify the best locations for demos based on various factors\n", + " \"\"\"\n", + " # Calculate a demo score based on multiple factors\n", + " analysis_df['Demo_Score'] = (\n", + " (analysis_df['Untapped_Potential'] / analysis_df['Untapped_Potential'].max() * 40) +\n", + " ((100 - analysis_df['Conversion_Rate']) / 100 * 30) +\n", + " (analysis_df['Recent_Sales_L'] / analysis_df['Recent_Sales_L'].max() * 30)\n", + " ).round(2)\n", + " \n", + " # Get top locations for demos\n", + " demo_locations = analysis_df.nlargest(top_n, 'Demo_Score')[\n", + " ['Village', 'Taluka', 'District', 'Mantri_Name', 'Mantri_Mobile', \n", + " 'Conversion_Rate', 'Untapped_Potential', 'Demo_Score']\n", + " ]\n", + " \n", + " return demo_locations\n", + "\n", + "# Example usage with sample data structure\n", + "def main():\n", + " data2=pd.read_excel(\"sampletesting.xlsx\",sheet_name=\"Sheet1\")\n", + " data1=pd.read_excel(\"sampletesting.xlsx\",sheet_name=\"Sheet2\")\n", + " # Generate recommendations\n", + " recommendations, analysis = analyze_sales_data(data1, data2)\n", + " \n", + " print(\"RECOMMENDED ACTIONS:\")\n", + " print(recommendations.sort_values('Score', ascending=False).to_string(index=False))\n", + " \n", + " # Generate messages for mantris\n", + " mantri_messages = generate_mantri_messages(recommendations)\n", + " \n", + " print(\"\\nMANTRI MESSAGES:\")\n", + " for _, msg in mantri_messages.iterrows():\n", + " print(f\"\\nTo: {msg['Mantri']} ({msg['Mobile']}) - {msg['Village']}\")\n", + " print(f\"Action: {msg['Action']}\")\n", + " print(f\"Message: {msg['Message']}\")\n", + " \n", + " # Identify demo locations\n", + " demo_locations = identify_demo_locations(analysis)\n", + " \n", + " print(\"\\nTOP DEMO LOCATIONS:\")\n", + " print(demo_locations.to_string(index=False))\n", + " \n", + " return recommendations, mantri_messages, demo_locations\n", + "\n", + "if __name__ == \"__main__\":\n", + " recommendations, mantri_messages, demo_locations = main()" + ] + }, + { + "cell_type": "markdown", + "id": "8bc72d87", + "metadata": {}, + "source": [ + "## ML based suggestions" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "a82033e0", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ML-ENHANCED RECOMMENDATIONS:\n", + " Village Taluka District Mantri Mobile Action Reason Priority Confidence Segment Sales_Gap\n", + " JILOD ANKALAV ANAND AJAYBHAI PATEL 7984136988 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement -3.663333\n", + " VADU PADRA PADRA MANUBHAI PATEL 9909239416 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement -38.660000\n", + " RANIYA THASRA KHEDA MAHENDRABHAI 9727340474 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement 1.470000\n", + " SAMARKHA ANAND ANAND MAHENDRABHAI THAKOR 8401608917 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement -2.000000\n", + " KANTHARIYA ANKLAV ANAND MAHESHBHAI THAKOR 9313397942 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 1.00). Segment: High Potential - Low Engagement High 1.00 High Potential - Low Engagement 2.030000\n", + " ASHI PETLAD ANAND MANHARBHAI 8155931534 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement 16.250821\n", + " KALYANPURA UMRETH ANAND MANSINH 9924825699 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement 3.500667\n", + " RAYPURA ANAND ANAND MANUBHAI 6355974133 Send Marketing Team ML predicts marketing team needed (Confidence: 1.00). Segment: High Potential - Low Engagement High 1.00 High Potential - Low Engagement 8.430000\n", + " RASAWADI SAVLI VADODARA MAYURSINH RATHOD 6354933728 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement -17.105190\n", + " BAMANGAM ANKALAV ANAND PARESHBHAI-CASHIER 9998851329 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement 8.894810\n", + " MOGAR ANAND ANAND MUKESHBHAI 9724777879 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement 36.760714\n", + " ASODAR ANKALAV ANAND MUKESHBHAI 9904502098 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement 13.536667\n", + " KHORWAD UMRETH ANAND MUKESHBHAI 9726858703 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement 3.886667\n", + " BHARODA UMRETH ANAND MUKESHBHAI 7572979767 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement 5.610000\n", + " GAJANA BORSAD ANAND NARENDRABHAI 9316344592 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: Steady Performers Medium 1.00 Steady Performers -22.540357\n", + " VAKHATPURA VADODARA VADODARA NATVARBHAI GOHIL 9979898470 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: Steady Performers Medium 1.00 Steady Performers 10.848357\n", + " LALPURA ANKALAV ANAND LALJIBHAI 9909212667 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 1.00). Segment: High Potential - Low Engagement High 1.00 High Potential - Low Engagement 10.900000\n", + " MANJIPURA THASRA KHEDA AJAYBHAI PATEL 9737910554 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: Steady Performers Medium 1.00 Steady Performers -18.963333\n", + " NANI SHERKHI VADODARA VADODARA LAHERBHAI 9586267241 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: Steady Performers Medium 1.00 Steady Performers -29.850000\n", + " SHERPURA SAVLI VADODARA KIRITBHAI SOLANKI 7069401622 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement 8.642500\n", + " VAGASHI ANAND ANAND KIRITBHAI 7284836990 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement 5.841667\n", + " SINDHROT ANKALAV ANAND KIRITBHAI 9870070574 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement 19.250821\n", + " MIYAGAM KARJAN VADODARA KIRANBHAI 8000686958 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: Steady Performers Medium 1.00 Steady Performers -31.009048\n", + " AMBALI ANKLAV ANAND KIRANBHAI 7698165451 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement -7.310000\n", + " KOSINDRA BORSAD ANAND KANAKSINH PATEL 7359619019 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 1.00). Segment: High Potential - Low Engagement High 1.00 High Potential - Low Engagement 8.430000\n", + " SHEKHADI PETLAD ANAND KAMLESHBHAI PATEL 9106850412 / Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 1.00). Segment: High Potential - Low Engagement High 1.00 High Potential - Low Engagement -3.210000\n", + " DARAPURA PADRA VADODARA JYOTIBEN 9726768402 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement 20.342762\n", + " VADOLA KHAMBHAT ANAND JYANTIBHAI 7567518630 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 1.00). Segment: High Potential - Low Engagement High 1.00 High Potential - Low Engagement 8.000000\n", + " DHUVARAN BORSAD ANAND JORUBHAI 8200199030 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 1.00). Segment: High Potential - Low Engagement High 1.00 High Potential - Low Engagement -1.990000\n", + " VALVOD BORSAD ANAND JAYRAJSINH 8347977820 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement -2.390000\n", + " VANADARA DABHOI VADODARA JAYRAJBHAI SOLANKI 7698346288 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: Steady Performers Medium 1.00 Steady Performers -26.749179\n", + " NAMISARA SAVLI VADODARA JAYESHBHAI MAKVANA 7567518630 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement -4.841000\n", + " KAYAVAROHAN DABHOI VADODARA JAGDISHBHAI PATEL 9909719274 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: Steady Performers Medium 1.00 Steady Performers -22.820000\n", + " HARKHAPURA KHAMBHAT ANAND NILESHBHAI 8780110103 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement 18.020000\n", + " CHOKARI PADRA VADODARA PRAVINBHAI 9913975412 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement -3.332500\n", + " RAWAL VAGHODIA VADODARA JAGDISHBHAI 7359925116 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: Steady Performers Medium 1.00 Steady Performers -17.390000\n", + " VAKANER SAVLI VADODARA SURPALSINH MAHIDA 9824741993 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: Steady Performers Medium 1.00 Steady Performers -20.195643\n", + " GOPALPURA ANAND ANAND SHAILESHBHAI 7990024992 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement 11.066667\n", + " VIRSAD BORSAD ANAND SHAILESHBHAI 9104244408 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 1.00). Segment: New/Developing High 1.00 New/Developing -137.570000\n", + " RATANPURA UMRETH ANAND SHAILESHBHAI RATHOD 9725093842 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement -9.622000\n", + " GOPALPURA ANAND ANAND SHAILESHBHAI SHARMA 7990024992 Send Marketing Team ML predicts marketing team needed (Confidence: 1.00). Segment: High Potential - Low Engagement High 1.00 High Potential - Low Engagement 39.959914\n", + " KHADANA PETLAD ANAND SHANABHAI-MANTRY 6351055831 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: Steady Performers Medium 1.00 Steady Performers -10.332500\n", + " HAMIDPURA UMRETH ANAND SURESHBHAI SOLANKI 9033782505 Send Marketing Team ML predicts marketing team needed (Confidence: 1.00). Segment: High Potential - Low Engagement High 1.00 High Potential - Low Engagement 35.285268\n", + " SHANKARPURA WAGHODIA VADODARA UDAYSINH 9737117756 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: Steady Performers Medium 1.00 Steady Performers -23.892500\n", + " NAVAPURA VADODARA VADODARA PRAVINBHAI B GOHIL 4578123654 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement 5.030000\n", + " RASULABAD VAGHODIA VADODARA UPENDRASINH GARADHIYA 9106644185 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement 3.122167\n", + " FATEPURA UMRETH ANAND VIJAYBHAI PARMAR 6351313878 Send Marketing Team ML predicts marketing team needed (Confidence: 1.00). Segment: High Potential - Low Engagement High 1.00 High Potential - Low Engagement 32.959914\n", + " GORVA BORSAD ANAND VIKRAMBHAI 6353733421 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement -11.866143\n", + " RANJITNAGAR SAVLI VADODARA VIKRAMBHAI 9586986099 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement 27.788500\n", + " KHAKHANPUR UMRETH ANAND VINUBHAI 6352399755 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement -0.646667\n", + " JITPURA UMRETH ANAND YOGESHBHAI 7990383811 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement 30.175000\n", + " LASUNDRA SAVLI VADODARA SHAHID BHALAVAT 6355754371 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: Steady Performers Medium 1.00 Steady Performers -25.657238\n", + " NAPAD VANTO ANAND ANAND SHABBIRBHAI RATHOD 8460326712 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement -2.850000\n", + " PIRODNAGAR VADODARA VADODARA SANJAYBHAI PARMAR 8239791094 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement 8.972000\n", + " SARSA ANAND ANAND SAMIRBHAI PATEL 9898825711 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 1.00). Segment: High Potential - Low Engagement High 1.00 High Potential - Low Engagement 13.230000\n", + " ZAKHARIYA ANAND ANAND RUTVIKBHAI 9327262524 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement -9.780000\n", + " NANA KALODARA KHAMBHAT ANAND RAVINDRABHAI PATEL 9426884301 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement -27.150000\n", + " CHANVADA DABHAOI VADODARA RATHOD RAHEMATKHAN 9925069598 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: Steady Performers Medium 1.00 Steady Performers -10.740238\n", + " CHIKHODARA ANAND ANAND RANJITBHAI 8849744704 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement 26.641048\n", + " DHOLI UMRETH ANAND RAMSINH 9904743303 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: Steady Performers Medium 1.00 Steady Performers -18.410000\n", + " DAGJIPURA UMRETH ANAND RAMESHBHAI 9574627424 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: Steady Performers Medium 1.00 Steady Performers -33.211500\n", + " AMODAR VAGHODIYA VADODARA RAJVANTBHAI 6352134649 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement -4.211667\n", + " DABHASI BORSAD ANAND RAJESHBHAI NaN Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement -18.690000\n", + " AMRUTPURA THASRA KHEDA RAJENDRABHAI GOHIL 7984449859 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement 12.423333\n", + " BAJIPURA UMRETH ANAND RAHULBHAI PADHIYAR 6355245589 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 1.00). Segment: High Potential - Low Engagement High 1.00 High Potential - Low Engagement -42.760000\n", + " TUNDAV SAVLI VADODARA RAHIM RANA 9979512832 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: Steady Performers Medium 1.00 Steady Performers -4.663333\n", + " KANCHORAPURA BORSAD ANAND PRAVINBHAI PATEL 9723468521 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement -16.672833\n", + " MAHAPURA VADODARA VADODARA PRAVINBHAI CHAUHAN 9904071931 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement 25.788500\n", + " AJUPURA ANAND ANAND JAGDISHBHAI 9265960608 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: Steady Performers Medium 1.00 Steady Performers -8.080000\n", + " SHERKHI VADODARA VADODARA LAHERBHAI 9586267241 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: Steady Performers Medium 1.00 Steady Performers -12.325000\n", + " BILPAD ANKLAV ANAND DILIPBHAI 9510341268 Send Marketing Team ML predicts marketing team needed (Confidence: 1.00). Segment: High Potential - Low Engagement High 1.00 High Potential - Low Engagement 11.325000\n", + " TRANOL KARJAN VADODARA BHAGABHAI 9723615554 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement -2.323000\n", + " KANBHA KHAMBHAT ANAND BHAVESHBHAI 7016899971 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 1.00). Segment: High Potential - Low Engagement High 1.00 High Potential - Low Engagement -10.520000\n", + " PRATAPPURA UMRETH ANAND BHUPATBHAI 8780755962 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: Steady Performers Medium 1.00 Steady Performers -9.840000\n", + " MANPURA ANKLAV ANAND Dr. LALJIBHAI 9081339374 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement 5.667500\n", + " KATHOL BORSAD ANAND BUDHABHAI 9662837294 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement -33.360000\n", + " SANGADOL VAGHODIA VADODARA GIRVATNBHAI RAJPUT 8347090265 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: Steady Performers Medium 1.00 Steady Performers -11.493333\n", + " DADPURA BORSAD ANAND CHANDUBHAI 9106700348 Send Marketing Team ML predicts marketing team needed (Confidence: 1.00). Segment: High Potential - Low Engagement High 1.00 High Potential - Low Engagement 1.990000\n", + " DUNDELAV WAGHODIYA VADODRA CHIMANBHAI 9925880109 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement 5.378000\n", + " RAJPUR SAVLI VADODARA DALPATSINH 9909550925 Send Marketing Team ML predicts marketing team needed (Confidence: 1.00). Segment: High Potential - Low Engagement High 1.00 High Potential - Low Engagement 29.959914\n", + " RAIPURA VADODARA VADODARA GANPATBHAI 9724666711 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement 5.823333\n", + " SINGLAV BORSAD ANAND GANPATBHAI 6352187692 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement 16.668667\n", + " KALU BORSAD ANAND DHARMENDRASINH 9023579028 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 1.00). Segment: High Potential - Low Engagement High 1.00 High Potential - Low Engagement 9.080000\n", + " FINAV KHAMBHAT ANAND DHIRAJBHAI PATEL 8849939596 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement 12.915476\n", + " JAROD WAGHODIA VADODARA INDUBHAI ( JAYESHBHAI ) 9925069851 Send Marketing Team ML predicts marketing team needed (Confidence: 1.00). Segment: High Potential - Low Engagement High 1.00 High Potential - Low Engagement 38.959914\n", + " VAHERAKHADI ANAND ANAND DR.HAMIDBHAI 9898691947 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement 11.895000\n", + " VAKHATPURA VADODARA VADODARA Dr. NATUBHAI 997989840 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: Steady Performers Medium 1.00 Steady Performers -33.151643\n", + " PILODARA BORSAD ANAND DILIPBHAI JADAV 9601626216 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement -12.699286\n", + " KASUMBAD BORSAD ANAND Dr. AJITBHAI CHAUHAN 9313889597 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement 1.049167\n", + " DEVRAMPURA UMRETH ANAND BHALABHAI 9727198451 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 1.00). Segment: High Potential - Low Engagement High 1.00 High Potential - Low Engagement -16.215000\n", + " PAMOL PETLAD ANAND DR. AMITBHAI 9924230429 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement 8.562250\n", + " KHADOL (H ) PETLAD ANAND ARJUNBHAI - MANTRY 6352153213 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement -9.741000\n", + " BAUTHA SAVLI VADODARA HIMMATBHAI SOLANKI 9924683267 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement 18.240333\n", + " VAHERA BORSAD ANAND ARJUNBHAI 9173706418 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement 23.450000\n", + " GOTHADA SAVLI VADODARA AJGAR KHAN 9724831903 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: Steady Performers Medium 1.00 Steady Performers 21.848357\n", + " DUDHAPURA UMRETH ANAND HIMMATSINH 8160906435 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: Steady Performers Medium 1.00 Steady Performers -7.663333\n", + " NAGRA KHAMBHAT ANAND HEMALBHAI PATEL 8200741203 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: High Potential - Low Engagement Medium 1.00 High Potential - Low Engagement -39.940000\n", + " VATRA KHAMBHAT ANAND ANKITBHAI RABARI 9978541194 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 1.00). Segment: High Potential - Low Engagement High 1.00 High Potential - Low Engagement -13.180000\n", + " MOTI SHERKHI VADODARA VADODARA HITENDRASINH MAHIDA 9726857917 Check on Mantri ML suggests checking on mantri (Confidence: 1.00). Segment: Steady Performers Medium 1.00 Steady Performers -25.664667\n", + " JANTRAL BORSAD ANAND ARVINDBHAI 9724670628 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 1.00). Segment: High Potential - Low Engagement High 1.00 High Potential - Low Engagement -55.180000\n", + " UNTKHARI UMRETH ANAND AMBALAL CHAUHAN 9313860902 Send Marketing Team ML predicts marketing team needed (Confidence: 1.00). Segment: High Potential - Low Engagement High 1.00 High Potential - Low Engagement -42.040086\n", + " VADOD ANAND ANAND PRADIPSINH MAHIDA 9998270536 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 0.99). Segment: High Potential - Low Engagement High 0.99 High Potential - Low Engagement -29.390000\n", + " NEJA KHAMBHAT ANAND VIKRAMBHAI BHARVAD 9979486637 Check on Mantri ML suggests checking on mantri (Confidence: 0.99). Segment: Steady Performers Medium 0.99 Steady Performers -39.358952\n", + " SINHOL PETLAD ANAND DILIPBHAI 8128252762 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 0.99). Segment: High Potential - Low Engagement High 0.99 High Potential - Low Engagement 20.410000\n", + " KHAKHARIYA SAVLI VADODARA PARESHBHAI 9879665401 Send Marketing Team ML predicts marketing team needed (Confidence: 0.99). Segment: High Potential - Low Engagement High 0.99 High Potential - Low Engagement -1.040086\n", + " PORDA PETLAD ANAND NILESHBHAI 9898881850 Check on Mantri ML suggests checking on mantri (Confidence: 0.99). Segment: Steady Performers Medium 0.99 Steady Performers 29.990000\n", + " DALI KHAMBHAT ANAND ARJUNBHAI - MANTRY 9428489479 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 0.99). Segment: High Potential - Low Engagement High 0.99 High Potential - Low Engagement -28.220000\n", + " KOTAMBI SAVLI VADODARA VISHNUBHAI 9909550170 Check on Mantri ML suggests checking on mantri (Confidence: 0.99). Segment: High Potential - Low Engagement Medium 0.99 High Potential - Low Engagement 6.804357\n", + " NAVGAMA WAGHODIA VADODARA NARENDRABHAI 9909318997 Send Marketing Team ML predicts marketing team needed (Confidence: 0.99). Segment: High Potential - Low Engagement High 0.99 High Potential - Low Engagement -37.040086\n", + " KESHAVPURA ANKLAV ANAND DILIPBHAI PADHIYAR 6351990353 Check on Mantri ML suggests checking on mantri (Confidence: 0.99). Segment: High Potential - Low Engagement Medium 0.99 High Potential - Low Engagement -3.820000\n", + " BANEJDA BORSAD ANAND MUKESHBHAI 9624208283 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 0.99). Segment: High Potential - Low Engagement High 0.99 High Potential - Low Engagement -37.490000\n", + "AMBERAOPURA(DAHEVAN) BORSAD ANAND PRAVINBHAI PATEL 9723468521 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 0.99). Segment: High Potential - Low Engagement High 0.99 High Potential - Low Engagement 0.380000\n", + " NAVAPURA ANKLAV ANAND BHAILALBHAI 9016933551 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 0.99). Segment: High Potential - Low Engagement High 0.99 High Potential - Low Engagement 56.150000\n", + " MOKSHI SAVLI VADODARA PUSHPABEN THAKORBHAI 8866515355 Send Marketing Team ML predicts marketing team needed (Confidence: 0.99). Segment: High Potential - Low Engagement High 0.99 High Potential - Low Engagement 6.629333\n", + " POPATVAV KHANBHAT ANAND SANJAYBHAI 7283995919 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 0.99). Segment: High Potential - Low Engagement High 0.99 High Potential - Low Engagement 7.160000\n", + " AHIMA UMRETH ANAND RAJENDRASINH 9510084847 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 0.99). Segment: High Potential - Low Engagement High 0.99 High Potential - Low Engagement 10.460000\n", + " BODKA KARJAN VADODARA RAJENDRASINH RATHOD 9904267230 Check on Mantri ML suggests checking on mantri (Confidence: 0.99). Segment: Steady Performers Medium 0.99 Steady Performers -0.310000\n", + " ADIRAN WAGHODIA WAGHODIA ARJUNBHAI SOLANKI 8980144906 Check on Mantri ML suggests checking on mantri (Confidence: 0.99). Segment: Steady Performers Medium 0.99 Steady Performers 6.810000\n", + " SAIJPUR BORSAD ANAND RAJUBHAI 8511880200 Send Marketing Team ML predicts marketing team needed (Confidence: 0.99). Segment: New/Developing High 0.99 New/Developing 19.655000\n", + " JOGAN KHAMBHAT ANAND SHANKARBHAI THAKOR 8140448296 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 0.99). Segment: High Potential - Low Engagement High 0.99 High Potential - Low Engagement 11.700000\n", + " KANDHROTI BORSAD ANAND RAMANBHAI 9904930269 Check on Mantri ML suggests checking on mantri (Confidence: 0.99). Segment: High Potential - Low Engagement Medium 0.99 High Potential - Low Engagement 24.730000\n", + " HARIPURA KHAMBHAT ANAND RAMESHBHAI 9978285223 Check on Mantri ML suggests checking on mantri (Confidence: 0.99). Segment: High Potential - Low Engagement Medium 0.99 High Potential - Low Engagement 3.460000\n", + " MARGAKUI THASRA KHEDA SHANABHAI MAHERA 9925310608 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 0.99). Segment: High Potential - Low Engagement High 0.99 High Potential - Low Engagement 10.440000\n", + " SAMBHOI KARJAN VADODARA SHAILESHBHAI 6351912663 Check on Mantri ML suggests checking on mantri (Confidence: 0.99). Segment: High Potential - Low Engagement Medium 0.99 High Potential - Low Engagement 29.641048\n", + " BALANAPURA SAVLI VADODARA RAMTUSINH 9328409149 Send Marketing Team ML predicts marketing team needed (Confidence: 0.99). Segment: Steady Performers High 0.99 Steady Performers 8.514333\n", + " KOTHIYAKHAD BORSAD ANAND RAVIBHAI 7043826112 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 0.99). Segment: High Potential - Low Engagement High 0.99 High Potential - Low Engagement -45.400000\n", + " KUKVAD PETLAD ANAND BAKORBHAI THAKOR 7990576594 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 0.99). Segment: High Potential - Low Engagement High 0.99 High Potential - Low Engagement 59.550000\n", + " SARDARPURA THASRA KHEDA SANJAYBHAI 8140766086 Send Marketing Team ML predicts marketing team needed (Confidence: 0.99). Segment: High Potential - Low Engagement High 0.99 High Potential - Low Engagement -3.755000\n", + " KATHANA STATION BORSAD ANAND RAMESHBHAI BHUTSINH PARMAR NaN Send Marketing Team ML predicts marketing team needed (Confidence: 0.99). Segment: High Potential - Low Engagement High 0.99 High Potential - Low Engagement 23.959914\n", + " BHATPURA UMRETH ANAND YUVRAJSINH 6353209447 Check on Mantri ML suggests checking on mantri (Confidence: 0.99). Segment: High Potential - Low Engagement Medium 0.99 High Potential - Low Engagement 10.925000\n", + " BHARTHANA KARJAN VADODARA KAMLESHBHAI 6354508694 Check on Mantri ML suggests checking on mantri (Confidence: 0.99). Segment: Steady Performers Medium 0.99 Steady Performers 17.650000\n", + " MUVADA WAGHODIA VADODARA KANUBHAI PARMAR 966481655 Check on Mantri ML suggests checking on mantri (Confidence: 0.99). Segment: Steady Performers Medium 0.99 Steady Performers -23.010000\n", + " SUNAV SOJITRA ANAND JIGARBHAI 9998147762 Send Marketing Team ML predicts marketing team needed (Confidence: 0.99). Segment: High Potential - Low Engagement High 0.99 High Potential - Low Engagement -14.880000\n", + " BAJIPURA KHAMBHAT ANAND MANUBHAI SOMABHAI CHAUHAN 9824643396 Send Marketing Team ML predicts marketing team needed (Confidence: 0.99). Segment: New/Developing High 0.99 New/Developing 16.140000\n", + " DILLICHAKLA BORSAD ANAND MEHULBHAI 9726644968 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 0.99). Segment: High Potential - Low Engagement High 0.99 High Potential - Low Engagement -28.510000\n", + " KATHANA BORSAD ANAND MEHULBHAI 9726644968 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 0.99). Segment: High Potential - Low Engagement High 0.99 High Potential - Low Engagement -26.700000\n", + " BECHRI UMRETH ANAND GOPALBHAI 8347727273 Send Marketing Team ML predicts marketing team needed (Confidence: 0.99). Segment: High Potential - Low Engagement High 0.99 High Potential - Low Engagement 9.959914\n", + " BHETASHI TALPAD ANKLAV ANAND KIRITBHAI 9408667583 Send Marketing Team ML predicts marketing team needed (Confidence: 0.99). Segment: Steady Performers High 0.99 Steady Performers -1.640000\n", + " RATAN JI NA MUVADA UMRETH ANAND GANPATSINH 9924169009 Send Marketing Team ML predicts marketing team needed (Confidence: 0.99). Segment: Steady Performers High 0.99 Steady Performers 3.488500\n", + " KAYAVAROHAN VADODARA VADODARA JAGDISHBHAI PATEL 9909719274 Send Marketing Team ML predicts marketing team needed (Confidence: 0.99). Segment: High Potential - Low Engagement High 0.99 High Potential - Low Engagement 6.959914\n", + " RAJUPURA ANAND ANAND HARSHADBHAI 9537555788 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 0.99). Segment: High Potential - Low Engagement High 0.99 High Potential - Low Engagement 19.110000\n", + " RASULPUR SAVLI VADODARA GOPALBHAI 7623858581 Check on Mantri ML suggests checking on mantri (Confidence: 0.98). Segment: Steady Performers Medium 0.98 Steady Performers -19.890000\n", + " BHAVANIPURA PETLAD ANAND SATISHBHAI 9979472671 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 0.98). Segment: High Potential - Low Engagement High 0.98 High Potential - Low Engagement 12.350000\n", + " KOSINDRA ANKALAV ANAND KANAKSINH 7359619019 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 0.98). Segment: High Potential - Low Engagement High 0.98 High Potential - Low Engagement -31.570000\n", + " ALARASHA BORSAD ANAND DR. NARENDRASINH 9510942485 Send Marketing Team ML predicts marketing team needed (Confidence: 0.98). Segment: High Potential - Low Engagement High 0.98 High Potential - Low Engagement 12.959914\n", + " KHEDASA BORSAD ANAND RAVINDRABHAI 9662740083 Send Marketing Team ML predicts marketing team needed (Confidence: 0.98). Segment: High Potential - Low Engagement High 0.98 High Potential - Low Engagement 5.440000\n", + " RAJUPURA ANAND ANAND HARSHADBHAI 9537555788 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 0.98). Segment: High Potential - Low Engagement High 0.98 High Potential - Low Engagement 28.610000\n", + " RAVIPURA PETLAD ANAND ARVIND PARMAR 9714275164 Send Marketing Team ML predicts marketing team needed (Confidence: 0.98). Segment: Steady Performers High 0.98 Steady Performers -22.485667\n", + " RANCHHODPURA SAVLI VADODARA GANPATBHAI 9016698604 Send Marketing Team ML predicts marketing team needed (Confidence: 0.98). Segment: High Potential - Low Engagement High 0.98 High Potential - Low Engagement -6.490000\n", + " PARVATA UMRETH ANAND HIMMATBHAI 8980848224 Send Marketing Team ML predicts marketing team needed (Confidence: 0.98). Segment: High Potential - Low Engagement High 0.98 High Potential - Low Engagement 12.770000\n", + " JAKHLA UMRETH ANAND SURESHBHAI 9913584672 Send Marketing Team ML predicts marketing team needed (Confidence: 0.98). Segment: High Potential - Low Engagement High 0.98 High Potential - Low Engagement -45.040086\n", + " KHANKUVA UMRETH ANAND SURESHBHAI THAKOR 9924946614 Check on Mantri ML suggests checking on mantri (Confidence: 0.98). Segment: High Potential - Low Engagement Medium 0.98 High Potential - Low Engagement -15.315000\n", + " LAXMIPURA UMRETH ANAND UDESINH BAPU 9624234618 Check on Mantri ML suggests checking on mantri (Confidence: 0.98). Segment: Steady Performers Medium 0.98 Steady Performers -15.759667\n", + " DUNGRIPURA UMRETH ANAND JAYDEEPBHAI 9714687264 Check on Mantri ML suggests checking on mantri (Confidence: 0.98). Segment: Steady Performers Medium 0.98 Steady Performers -15.380000\n", + " KALAMASAR KHAMBHAT ANAND VANRAJBHAI 8347168185 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 0.98). Segment: New/Developing High 0.98 New/Developing -11.560000\n", + " VISHNOLI BORSAD ANAND VASIMKHAN 546549846 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 0.98). Segment: High Potential - Low Engagement High 0.98 High Potential - Low Engagement 15.100000\n", + " KANODA SAVLI VADODARA VINUBHAI SOLANKI 9998756469 Send Marketing Team ML predicts marketing team needed (Confidence: 0.98). Segment: High Potential - Low Engagement High 0.98 High Potential - Low Engagement -15.040086\n", + " MUJKUVA ANKALAV ANAND LABHUBHAI - SECRETORY 9924570056 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 0.98). Segment: High Potential - Low Engagement High 0.98 High Potential - Low Engagement -18.960000\n", + " KANTHARAI THASRA KHEDA JAGDISHBHAI 9687013839 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 0.98). Segment: High Potential - Low Engagement High 0.98 High Potential - Low Engagement -19.170000\n", + " NAVAPURA UMRETH ANAND DHARMENDRABHAI 9624535957 Check on Mantri ML suggests checking on mantri (Confidence: 0.98). Segment: High Potential - Low Engagement Medium 0.98 High Potential - Low Engagement 14.740000\n", + " SURELI UMRETH ANAND FIROZKHAN PATHAN 7567641110 Check on Mantri ML suggests checking on mantri (Confidence: 0.98). Segment: High Potential - Low Engagement Medium 0.98 High Potential - Low Engagement 9.155000\n", + " ASHIPURA UMRETH ANAND PARVATBHAI 9574229451 Send Marketing Team ML predicts marketing team needed (Confidence: 0.98). Segment: High Potential - Low Engagement High 0.98 High Potential - Low Engagement -45.040086\n", + " JOGAN KHAMBHAT ANAND PINTUBHAI 9824663860 Send Marketing Team ML predicts marketing team needed (Confidence: 0.98). Segment: High Potential - Low Engagement High 0.98 High Potential - Low Engagement 12.158000\n", + " DAHEVAN BORSAD ANAND PRAVINBHAI PATEL 9723468521 Check on Mantri ML suggests checking on mantri (Confidence: 0.98). Segment: Steady Performers Medium 0.98 Steady Performers 4.110000\n", + " CHAMARA ANKALAV ANAND FATABHAI PADHIYAR 8347183421 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 0.98). Segment: High Potential - Low Engagement High 0.98 High Potential - Low Engagement -9.570000\n", + " VEMAR SAVLI VADODARA AMBALAL GOHIL 9978081739 Send Marketing Team ML predicts marketing team needed (Confidence: 0.97). Segment: High Potential - Low Engagement High 0.97 High Potential - Low Engagement -8.018383\n", + " GANA ANAND ANAND JAYESHBHAI PATEL 9879977750 Check on Mantri ML suggests checking on mantri (Confidence: 0.97). Segment: High Potential - Low Engagement Medium 0.97 High Potential - Low Engagement 7.259167\n", + " BOCHASAN ANAND ANAND MUKESHBHAI 9913633154 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 0.97). Segment: High Potential - Low Engagement High 0.97 High Potential - Low Engagement 18.590000\n", + " GAMANPURA UMRETH ANAND JAGDISHBHAI 9924762935 Check on Mantri ML suggests checking on mantri (Confidence: 0.97). Segment: High Potential - Low Engagement Medium 0.97 High Potential - Low Engagement 13.720000\n", + " FANGANI PETLAD ANAND JIGNESHBHAI 8128009429 Check on Mantri ML suggests checking on mantri (Confidence: 0.97). Segment: High Potential - Low Engagement Medium 0.97 High Potential - Low Engagement 6.777000\n", + " SALUN THASRA KHEDA DASARATHBHAI PARMAR 9316769790 Check on Mantri ML suggests checking on mantri (Confidence: 0.97). Segment: High Potential - Low Engagement Medium 0.97 High Potential - Low Engagement -13.841000\n", + " AMIYAD BORSAD ANAND KABHAYBHAI 9925861038 Check on Mantri ML suggests checking on mantri (Confidence: 0.97). Segment: Steady Performers Medium 0.97 Steady Performers -8.474000\n", + " MITHAPURA KHEDA ANAND VIKRAMSINH 9712007585 Send Marketing Team ML predicts marketing team needed (Confidence: 0.97). Segment: Steady Performers High 0.97 Steady Performers -40.008333\n", + " SIMARDA PETLAD ANAND PANKAJBHAI 7383092105 Check on Mantri ML suggests checking on mantri (Confidence: 0.97). Segment: High Potential - Low Engagement Medium 0.97 High Potential - Low Engagement 7.620000\n", + " VASVEL WAGHODIA VADODARA DHARMENDRABHAI 9327897366 Send Marketing Team ML predicts marketing team needed (Confidence: 0.96). Segment: High Potential - Low Engagement High 0.96 High Potential - Low Engagement 15.981617\n", + " HATHIPURA ANKALAV ANAND JESANGBHAI CHAVDA 9427828741 Send Marketing Team ML predicts marketing team needed (Confidence: 0.96). Segment: New/Developing High 0.96 New/Developing 20.670000\n", + " BODIKUVA VADODARA VADODARA HANUKAKA 8140100407 Send Marketing Team ML predicts marketing team needed (Confidence: 0.96). Segment: Steady Performers High 0.96 Steady Performers 7.728000\n", + " TRAMBOVAD SOJITRA ANAND BHIKHABHAI 9723885382 Send Marketing Team ML predicts marketing team needed (Confidence: 0.96). Segment: High Potential - Low Engagement High 0.96 High Potential - Low Engagement 6.814500\n", + " DODHIYA PURA KHAMBHAT ANAND UDESINH BHAI 9824287850 Send Marketing Team ML predicts marketing team needed (Confidence: 0.96). Segment: High Potential - Low Engagement High 0.96 High Potential - Low Engagement 18.535071\n", + " BHAREL ANAND ANAND ASHOKBHAI THAKOR 9924216299 Send Marketing Team ML predicts marketing team needed (Confidence: 0.96). Segment: Steady Performers High 0.96 Steady Performers -4.185500\n", + " DHUNDHAKUVA BORSAD ANAND DR. VIJAYBHAI 9904053999 Check on Mantri ML suggests checking on mantri (Confidence: 0.95). Segment: High Potential - Low Engagement Medium 0.95 High Potential - Low Engagement 73.535000\n", + " VATADARA KHAMBHAT ANAND JAYANTIBHAI 7698601662 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 0.95). Segment: High Potential - Low Engagement High 0.95 High Potential - Low Engagement 31.420000\n", + " NANI SANKHYAD ANKALAV ANAND DR. THAKORBHAI 9737482949 Check on Mantri ML suggests checking on mantri (Confidence: 0.95). Segment: Steady Performers Medium 0.95 Steady Performers -41.009048\n", + " BORIYA PETLAD ANAND VIJAYBHAI 7046580350 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 0.95). Segment: High Potential - Low Engagement High 0.95 High Potential - Low Engagement 22.200000\n", + " KANBHAIPURA UMRETH ANAND KABHAIBHAI PRAJAPATI 9978552418 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 0.95). Segment: High Potential - Low Engagement High 0.95 High Potential - Low Engagement -94.075000\n", + " BADHIPURA UMRETH ANAND MOHANBHAI 8140622110 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 0.95). Segment: High Potential - Low Engagement High 0.95 High Potential - Low Engagement NaN\n", + " ASARAMA ANKLAV ANAND RASIKBHAI R VAGHELA 9723687092 Check on Mantri ML suggests checking on mantri (Confidence: 0.95). Segment: Underperforming Medium 0.95 Underperforming 15.640000\n", + " RAMPURA VADODARA VADODARA JYOTSHANABEN 9016114912 Check on Mantri ML suggests checking on mantri (Confidence: 0.95). Segment: High Potential - Low Engagement Medium 0.95 High Potential - Low Engagement 13.309159\n", + " KALAMSAR KHAMBHAT ANAND VANRAJSINH SINDHA 8347168185 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 0.95). Segment: New/Developing High 0.95 New/Developing 30.680000\n", + " TRIKAMPURA VADODARA VADODARA SANJAYBHAI 9974294254 Check on Mantri ML suggests checking on mantri (Confidence: 0.95). Segment: High Potential - Low Engagement Medium 0.95 High Potential - Low Engagement 39.620000\n", + " BORSAD MAIN DAIRY BORSAD ANAND BHARATBHAI PARMAR(CHAIRMAN) 9879726187 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 0.95). Segment: New/Developing High 0.95 New/Developing -13.880000\n", + " BHIMPURA PADRA VADODARA RAMESHBHAI 9265446510 Check on Mantri ML suggests checking on mantri (Confidence: 0.95). Segment: High Potential - Low Engagement Medium 0.95 High Potential - Low Engagement 12.870000\n", + " DHANTEJ SAVLI VADODARA GHANSHYAMBHAI 6353745632 Check on Mantri ML suggests checking on mantri (Confidence: 0.94). Segment: Steady Performers Medium 0.94 Steady Performers -92.881000\n", + " JESAPURA THASRA KHEDA JAYDEEPSINH 9924903171 Send Marketing Team ML predicts marketing team needed (Confidence: 0.94). Segment: High Potential - Low Engagement High 0.94 High Potential - Low Engagement 16.065000\n", + " VITOJ SAVLI VADODARA KHODSINH GOHIL 9601425263 Send Marketing Team ML predicts marketing team needed (Confidence: 0.94). Segment: Steady Performers High 0.94 Steady Performers -87.270667\n", + " UMLAV BORSAD ANAND JYANTIBHAI 9825817354 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 0.94). Segment: New/Developing High 0.94 New/Developing -14.220000\n", + " INDRAD SAVLI VADODARA VIKRAMSINH CHAUHAN 9825316980 Send Marketing Team ML predicts marketing team needed (Confidence: 0.93). Segment: Steady Performers High 0.93 Steady Performers -5.958167\n", + " NANI SHERKHI VADODARA VADODARA LAHERBHAI 9586267241 Check on Mantri ML suggests checking on mantri (Confidence: 0.93). Segment: High Potential - Low Engagement Medium 0.93 High Potential - Low Engagement 71.150000\n", + " PIPLOI KHAMBHAT ANAND JAYANTIBHAI 8160204365 Send Marketing Team ML predicts marketing team needed (Confidence: 0.93). Segment: High Potential - Low Engagement High 0.93 High Potential - Low Engagement 14.855000\n", + " GAMBHIRA ANKALAV ANAND RAMESHBHAI 9979137503 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 0.92). Segment: High Potential - Low Engagement High 0.92 High Potential - Low Engagement 65.650000\n", + " ODE ANAND ANAND JAYDEEPBHAI PATEL 7600913314 Check on Mantri ML suggests checking on mantri (Confidence: 0.92). Segment: High Potential - Low Engagement Medium 0.92 High Potential - Low Engagement -26.940000\n", + " KHIJALPUR UMRETH ANAND BHARATBHAI(DOCTOR) 7698969285 Send Marketing Team ML predicts marketing team needed (Confidence: 0.92). Segment: High Potential - Low Engagement High 0.92 High Potential - Low Engagement -5.083000\n", + " DHARKHUNIYA UMRETH ANAND JASVANTSINH PARMAR 6354405815 Send Marketing Team ML predicts marketing team needed (Confidence: 0.91). Segment: New/Developing High 0.91 New/Developing 51.485000\n", + " KASOR ANAND ANAND MITULBHAI 7383094973 Check on Mantri ML suggests checking on mantri (Confidence: 0.91). Segment: High Potential - Low Engagement Medium 0.91 High Potential - Low Engagement 8.914000\n", + " MOTI SANKHYAD ANKLAV ANAND DALSUKHBHAI SOLANKI 9879983291 Check on Mantri ML suggests checking on mantri (Confidence: 0.91). Segment: High Potential - Low Engagement Medium 0.91 High Potential - Low Engagement 30.550000\n", + " KAMROL VAGHODIA VADODARA NATUBHAI CHAIRMAN 9924917292 Send Marketing Team ML predicts marketing team needed (Confidence: 0.91). Segment: High Potential - Low Engagement High 0.91 High Potential - Low Engagement -42.690000\n", + " NANI SANKHYAD ANKLAV ANAND DR.THAKORBHAI 9727121151 Check on Mantri ML suggests checking on mantri (Confidence: 0.91). Segment: High Potential - Low Engagement Medium 0.91 High Potential - Low Engagement 63.990952\n", + " VEDACH PADRA VADODARA BALVANTBHAI 9978011241 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 0.91). Segment: New/Developing High 0.91 New/Developing 56.080000\n", + " ASODAR ANKLAV ANAND VASIM VAHORA- 9725089741 Check on Mantri ML suggests checking on mantri (Confidence: 0.90). Segment: High Potential - Low Engagement Medium 0.90 High Potential - Low Engagement 10.119000\n", + " MORAD PETLAD ANAND ANILBHAI 9898681901 Check on Mantri ML suggests checking on mantri (Confidence: 0.90). Segment: High Potential - Low Engagement Medium 0.90 High Potential - Low Engagement 37.200000\n", + " KASOR PETLAD ANAND MELABHAI PARMAR 8488051333 Check on Mantri ML suggests checking on mantri (Confidence: 0.89). Segment: Underperforming Medium 0.89 Underperforming -22.610000\n", + " SHILI UMRETH ANAND GOPALBHAI 8866805602 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 0.89). Segment: New/Developing High 0.89 New/Developing -107.580000\n", + " SANDHA PADRA VADODARA NATUKAKA 9726573829 Send Marketing Team ML predicts marketing team needed (Confidence: 0.88). Segment: New/Developing High 0.88 New/Developing 45.720000\n", + " CHAMARA ANKLAV ANAND FATABHAI PADHIYAR 8347183421 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 0.88). Segment: High Potential - Low Engagement High 0.88 High Potential - Low Engagement 14.420000\n", + " MOGAR ANAND ANAND MUKESHBHAI 9724777879 Check on Mantri ML suggests checking on mantri (Confidence: 0.88). Segment: Steady Performers Medium 0.88 Steady Performers -48.239286\n", + "NAGRA(KHODIYARNAGAR) KHAMBHAT ANAND MAHESHBHAI MAKVANA 6353875955 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 0.87). Segment: High Potential - Low Engagement High 0.87 High Potential - Low Engagement 50.110000\n", + " RANOLI BORSAD ANAND NAGINBHAI 4654654555 Send Marketing Team ML predicts marketing team needed (Confidence: 0.86). Segment: High Potential - Low Engagement High 0.86 High Potential - Low Engagement 7.477790\n", + " KHADODHI KHAMBHAT ANAND ARVINDBHAI 9712898839 Check on Mantri ML suggests checking on mantri (Confidence: 0.86). Segment: High Potential - Low Engagement Medium 0.86 High Potential - Low Engagement 21.580000\n", + " RASNOL ANAND ANAND VITHTHALBHAI 9924590017 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 0.82). Segment: New/Developing High 0.82 New/Developing 42.530000\n", + " NATVARNAGAR SAVLI VADODARA KIRITBHAI RATHOD 7698792086 Call Mantri for Follow-up ML predicts mantri follow-up needed (Confidence: 0.75). Segment: High Potential - Low Engagement High 0.75 High Potential - Low Engagement -14.630000\n", + "\n", + "ML-BASED MANTRI MESSAGES:\n", + "\n", + "To: AJAYBHAI PATEL (7984136988) - JILOD\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste AJAYBHAI PATEL Ji!\n", + "\n", + "Our system shows reduced activity in JILOD. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: AJAYBHAI PATEL (9737910554) - MANJIPURA\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste AJAYBHAI PATEL Ji!\n", + "\n", + "Our system shows reduced activity in MANJIPURA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Steady Performers\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: AJGAR KHAN (9724831903) - GOTHADA\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste AJGAR KHAN Ji!\n", + "\n", + "Our system shows reduced activity in GOTHADA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Steady Performers\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: AMBALAL CHAUHAN (9313860902) - UNTKHARI\n", + "Action: Send Marketing Team (Confidence: 1.00)\n", + "Message: \n", + "Namaste AMBALAL CHAUHAN Ji!\n", + "\n", + "Our AI system has identified that your village UNTKHARI has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: AMBALAL GOHIL (9978081739) - VEMAR\n", + "Action: Send Marketing Team (Confidence: 0.97)\n", + "Message: \n", + "Namaste AMBALAL GOHIL Ji!\n", + "\n", + "Our AI system has identified that your village VEMAR has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 97.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: ANILBHAI (9898681901) - MORAD\n", + "Action: Check on Mantri (Confidence: 0.90)\n", + "Message: \n", + "Namaste ANILBHAI Ji!\n", + "\n", + "Our system shows reduced activity in MORAD. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 90.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: ANKITBHAI RABARI (9978541194) - VATRA\n", + "Action: Call Mantri for Follow-up (Confidence: 1.00)\n", + "Message: \n", + "Namaste ANKITBHAI RABARI Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in VATRA. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: ARJUNBHAI (9173706418) - VAHERA\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste ARJUNBHAI Ji!\n", + "\n", + "Our system shows reduced activity in VAHERA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: ARJUNBHAI - MANTRY (9428489479) - DALI\n", + "Action: Call Mantri for Follow-up (Confidence: 0.99)\n", + "Message: \n", + "Namaste ARJUNBHAI - MANTRY Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in DALI. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 99.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: ARJUNBHAI - MANTRY (6352153213) - KHADOL (H )\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste ARJUNBHAI - MANTRY Ji!\n", + "\n", + "Our system shows reduced activity in KHADOL (H ). \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: ARJUNBHAI SOLANKI (8980144906) - ADIRAN\n", + "Action: Check on Mantri (Confidence: 0.99)\n", + "Message: \n", + "Namaste ARJUNBHAI SOLANKI Ji!\n", + "\n", + "Our system shows reduced activity in ADIRAN. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Steady Performers\n", + "- Confidence: 99.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: ARVIND PARMAR (9714275164) - RAVIPURA\n", + "Action: Send Marketing Team (Confidence: 0.98)\n", + "Message: \n", + "Namaste ARVIND PARMAR Ji!\n", + "\n", + "Our AI system has identified that your village RAVIPURA has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: Steady Performers\n", + "- Confidence: 98.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: ARVINDBHAI (9712898839) - KHADODHI\n", + "Action: Check on Mantri (Confidence: 0.86)\n", + "Message: \n", + "Namaste ARVINDBHAI Ji!\n", + "\n", + "Our system shows reduced activity in KHADODHI. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 86.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: ARVINDBHAI (9724670628) - JANTRAL\n", + "Action: Call Mantri for Follow-up (Confidence: 1.00)\n", + "Message: \n", + "Namaste ARVINDBHAI Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in JANTRAL. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: ASHOKBHAI THAKOR (9924216299) - BHAREL\n", + "Action: Send Marketing Team (Confidence: 0.96)\n", + "Message: \n", + "Namaste ASHOKBHAI THAKOR Ji!\n", + "\n", + "Our AI system has identified that your village BHAREL has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: Steady Performers\n", + "- Confidence: 96.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: BAKORBHAI THAKOR (7990576594) - KUKVAD\n", + "Action: Call Mantri for Follow-up (Confidence: 0.99)\n", + "Message: \n", + "Namaste BAKORBHAI THAKOR Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in KUKVAD. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 99.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: BALVANTBHAI (9978011241) - VEDACH\n", + "Action: Call Mantri for Follow-up (Confidence: 0.91)\n", + "Message: \n", + "Namaste BALVANTBHAI Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in VEDACH. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: New/Developing\n", + "- Confidence: 91.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: BHAGABHAI (9723615554) - TRANOL\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste BHAGABHAI Ji!\n", + "\n", + "Our system shows reduced activity in TRANOL. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: BHAILALBHAI (9016933551) - NAVAPURA\n", + "Action: Call Mantri for Follow-up (Confidence: 0.99)\n", + "Message: \n", + "Namaste BHAILALBHAI Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in NAVAPURA. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 99.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: BHALABHAI (9727198451) - DEVRAMPURA\n", + "Action: Call Mantri for Follow-up (Confidence: 1.00)\n", + "Message: \n", + "Namaste BHALABHAI Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in DEVRAMPURA. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: BHARATBHAI PARMAR(CHAIRMAN) (9879726187) - BORSAD MAIN DAIRY\n", + "Action: Call Mantri for Follow-up (Confidence: 0.95)\n", + "Message: \n", + "Namaste BHARATBHAI PARMAR(CHAIRMAN) Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in BORSAD MAIN DAIRY. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: New/Developing\n", + "- Confidence: 95.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: BHARATBHAI(DOCTOR) (7698969285) - KHIJALPUR\n", + "Action: Send Marketing Team (Confidence: 0.92)\n", + "Message: \n", + "Namaste BHARATBHAI(DOCTOR) Ji!\n", + "\n", + "Our AI system has identified that your village KHIJALPUR has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 92.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: BHAVESHBHAI (7016899971) - KANBHA\n", + "Action: Call Mantri for Follow-up (Confidence: 1.00)\n", + "Message: \n", + "Namaste BHAVESHBHAI Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in KANBHA. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: BHIKHABHAI (9723885382) - TRAMBOVAD\n", + "Action: Send Marketing Team (Confidence: 0.96)\n", + "Message: \n", + "Namaste BHIKHABHAI Ji!\n", + "\n", + "Our AI system has identified that your village TRAMBOVAD has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 96.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: BHUPATBHAI (8780755962) - PRATAPPURA\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste BHUPATBHAI Ji!\n", + "\n", + "Our system shows reduced activity in PRATAPPURA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Steady Performers\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: BUDHABHAI (9662837294) - KATHOL\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste BUDHABHAI Ji!\n", + "\n", + "Our system shows reduced activity in KATHOL. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: CHANDUBHAI (9106700348) - DADPURA\n", + "Action: Send Marketing Team (Confidence: 1.00)\n", + "Message: \n", + "Namaste CHANDUBHAI Ji!\n", + "\n", + "Our AI system has identified that your village DADPURA has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: CHIMANBHAI (9925880109) - DUNDELAV\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste CHIMANBHAI Ji!\n", + "\n", + "Our system shows reduced activity in DUNDELAV. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: DALPATSINH (9909550925) - RAJPUR\n", + "Action: Send Marketing Team (Confidence: 1.00)\n", + "Message: \n", + "Namaste DALPATSINH Ji!\n", + "\n", + "Our AI system has identified that your village RAJPUR has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: DALSUKHBHAI SOLANKI (9879983291) - MOTI SANKHYAD\n", + "Action: Check on Mantri (Confidence: 0.91)\n", + "Message: \n", + "Namaste DALSUKHBHAI SOLANKI Ji!\n", + "\n", + "Our system shows reduced activity in MOTI SANKHYAD. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 91.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: DASARATHBHAI PARMAR (9316769790) - SALUN\n", + "Action: Check on Mantri (Confidence: 0.97)\n", + "Message: \n", + "Namaste DASARATHBHAI PARMAR Ji!\n", + "\n", + "Our system shows reduced activity in SALUN. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 97.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: DHARMENDRABHAI (9327897366) - VASVEL\n", + "Action: Send Marketing Team (Confidence: 0.96)\n", + "Message: \n", + "Namaste DHARMENDRABHAI Ji!\n", + "\n", + "Our AI system has identified that your village VASVEL has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 96.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: DHARMENDRABHAI (9624535957) - NAVAPURA\n", + "Action: Check on Mantri (Confidence: 0.98)\n", + "Message: \n", + "Namaste DHARMENDRABHAI Ji!\n", + "\n", + "Our system shows reduced activity in NAVAPURA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 98.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: DHARMENDRASINH (9023579028) - KALU\n", + "Action: Call Mantri for Follow-up (Confidence: 1.00)\n", + "Message: \n", + "Namaste DHARMENDRASINH Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in KALU. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: DHIRAJBHAI PATEL (8849939596) - FINAV\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste DHIRAJBHAI PATEL Ji!\n", + "\n", + "Our system shows reduced activity in FINAV. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: DILIPBHAI (9510341268) - BILPAD\n", + "Action: Send Marketing Team (Confidence: 1.00)\n", + "Message: \n", + "Namaste DILIPBHAI Ji!\n", + "\n", + "Our AI system has identified that your village BILPAD has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: DILIPBHAI (8128252762) - SINHOL\n", + "Action: Call Mantri for Follow-up (Confidence: 0.99)\n", + "Message: \n", + "Namaste DILIPBHAI Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in SINHOL. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 99.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: DILIPBHAI JADAV (9601626216) - PILODARA\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste DILIPBHAI JADAV Ji!\n", + "\n", + "Our system shows reduced activity in PILODARA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: DILIPBHAI PADHIYAR (6351990353) - KESHAVPURA\n", + "Action: Check on Mantri (Confidence: 0.99)\n", + "Message: \n", + "Namaste DILIPBHAI PADHIYAR Ji!\n", + "\n", + "Our system shows reduced activity in KESHAVPURA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 99.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: Dr. AJITBHAI CHAUHAN (9313889597) - KASUMBAD\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste Dr. AJITBHAI CHAUHAN Ji!\n", + "\n", + "Our system shows reduced activity in KASUMBAD. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: DR. AMITBHAI (9924230429) - PAMOL\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste DR. AMITBHAI Ji!\n", + "\n", + "Our system shows reduced activity in PAMOL. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: Dr. LALJIBHAI (9081339374) - MANPURA\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste Dr. LALJIBHAI Ji!\n", + "\n", + "Our system shows reduced activity in MANPURA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: DR. NARENDRASINH (9510942485) - ALARASHA\n", + "Action: Send Marketing Team (Confidence: 0.98)\n", + "Message: \n", + "Namaste DR. NARENDRASINH Ji!\n", + "\n", + "Our AI system has identified that your village ALARASHA has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 98.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: Dr. NATUBHAI (997989840) - VAKHATPURA\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste Dr. NATUBHAI Ji!\n", + "\n", + "Our system shows reduced activity in VAKHATPURA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Steady Performers\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: DR. THAKORBHAI (9737482949) - NANI SANKHYAD\n", + "Action: Check on Mantri (Confidence: 0.95)\n", + "Message: \n", + "Namaste DR. THAKORBHAI Ji!\n", + "\n", + "Our system shows reduced activity in NANI SANKHYAD. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Steady Performers\n", + "- Confidence: 95.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: DR. VIJAYBHAI (9904053999) - DHUNDHAKUVA\n", + "Action: Check on Mantri (Confidence: 0.95)\n", + "Message: \n", + "Namaste DR. VIJAYBHAI Ji!\n", + "\n", + "Our system shows reduced activity in DHUNDHAKUVA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 95.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: DR.HAMIDBHAI (9898691947) - VAHERAKHADI\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste DR.HAMIDBHAI Ji!\n", + "\n", + "Our system shows reduced activity in VAHERAKHADI. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: DR.THAKORBHAI (9727121151) - NANI SANKHYAD\n", + "Action: Check on Mantri (Confidence: 0.91)\n", + "Message: \n", + "Namaste DR.THAKORBHAI Ji!\n", + "\n", + "Our system shows reduced activity in NANI SANKHYAD. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 91.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: FATABHAI PADHIYAR (8347183421) - CHAMARA\n", + "Action: Call Mantri for Follow-up (Confidence: 0.98)\n", + "Message: \n", + "Namaste FATABHAI PADHIYAR Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in CHAMARA. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 98.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: FATABHAI PADHIYAR (8347183421) - CHAMARA\n", + "Action: Call Mantri for Follow-up (Confidence: 0.88)\n", + "Message: \n", + "Namaste FATABHAI PADHIYAR Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in CHAMARA. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 88.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: FIROZKHAN PATHAN (7567641110) - SURELI\n", + "Action: Check on Mantri (Confidence: 0.98)\n", + "Message: \n", + "Namaste FIROZKHAN PATHAN Ji!\n", + "\n", + "Our system shows reduced activity in SURELI. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 98.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: GANPATBHAI (6352187692) - SINGLAV\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste GANPATBHAI Ji!\n", + "\n", + "Our system shows reduced activity in SINGLAV. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: GANPATBHAI (9724666711) - RAIPURA\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste GANPATBHAI Ji!\n", + "\n", + "Our system shows reduced activity in RAIPURA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: GANPATBHAI (9016698604) - RANCHHODPURA\n", + "Action: Send Marketing Team (Confidence: 0.98)\n", + "Message: \n", + "Namaste GANPATBHAI Ji!\n", + "\n", + "Our AI system has identified that your village RANCHHODPURA has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 98.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: GANPATSINH (9924169009) - RATAN JI NA MUVADA\n", + "Action: Send Marketing Team (Confidence: 0.99)\n", + "Message: \n", + "Namaste GANPATSINH Ji!\n", + "\n", + "Our AI system has identified that your village RATAN JI NA MUVADA has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: Steady Performers\n", + "- Confidence: 99.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: GHANSHYAMBHAI (6353745632) - DHANTEJ\n", + "Action: Check on Mantri (Confidence: 0.94)\n", + "Message: \n", + "Namaste GHANSHYAMBHAI Ji!\n", + "\n", + "Our system shows reduced activity in DHANTEJ. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Steady Performers\n", + "- Confidence: 94.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: GIRVATNBHAI RAJPUT (8347090265) - SANGADOL\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste GIRVATNBHAI RAJPUT Ji!\n", + "\n", + "Our system shows reduced activity in SANGADOL. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Steady Performers\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: GOPALBHAI (8866805602) - SHILI\n", + "Action: Call Mantri for Follow-up (Confidence: 0.89)\n", + "Message: \n", + "Namaste GOPALBHAI Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in SHILI. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: New/Developing\n", + "- Confidence: 89.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: GOPALBHAI (7623858581) - RASULPUR\n", + "Action: Check on Mantri (Confidence: 0.98)\n", + "Message: \n", + "Namaste GOPALBHAI Ji!\n", + "\n", + "Our system shows reduced activity in RASULPUR. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Steady Performers\n", + "- Confidence: 98.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: GOPALBHAI (8347727273) - BECHRI\n", + "Action: Send Marketing Team (Confidence: 0.99)\n", + "Message: \n", + "Namaste GOPALBHAI Ji!\n", + "\n", + "Our AI system has identified that your village BECHRI has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 99.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: HANUKAKA (8140100407) - BODIKUVA\n", + "Action: Send Marketing Team (Confidence: 0.96)\n", + "Message: \n", + "Namaste HANUKAKA Ji!\n", + "\n", + "Our AI system has identified that your village BODIKUVA has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: Steady Performers\n", + "- Confidence: 96.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: HARSHADBHAI (9537555788) - RAJUPURA\n", + "Action: Call Mantri for Follow-up (Confidence: 0.98)\n", + "Message: \n", + "Namaste HARSHADBHAI Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in RAJUPURA. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 98.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: HARSHADBHAI (9537555788) - RAJUPURA\n", + "Action: Call Mantri for Follow-up (Confidence: 0.99)\n", + "Message: \n", + "Namaste HARSHADBHAI Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in RAJUPURA. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 99.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: HEMALBHAI PATEL (8200741203) - NAGRA\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste HEMALBHAI PATEL Ji!\n", + "\n", + "Our system shows reduced activity in NAGRA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: HIMMATBHAI (8980848224) - PARVATA\n", + "Action: Send Marketing Team (Confidence: 0.98)\n", + "Message: \n", + "Namaste HIMMATBHAI Ji!\n", + "\n", + "Our AI system has identified that your village PARVATA has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 98.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: HIMMATBHAI SOLANKI (9924683267) - BAUTHA\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste HIMMATBHAI SOLANKI Ji!\n", + "\n", + "Our system shows reduced activity in BAUTHA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: HIMMATSINH (8160906435) - DUDHAPURA\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste HIMMATSINH Ji!\n", + "\n", + "Our system shows reduced activity in DUDHAPURA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Steady Performers\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: HITENDRASINH MAHIDA (9726857917) - MOTI SHERKHI\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste HITENDRASINH MAHIDA Ji!\n", + "\n", + "Our system shows reduced activity in MOTI SHERKHI. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Steady Performers\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: INDUBHAI ( JAYESHBHAI ) (9925069851) - JAROD\n", + "Action: Send Marketing Team (Confidence: 1.00)\n", + "Message: \n", + "Namaste INDUBHAI ( JAYESHBHAI ) Ji!\n", + "\n", + "Our AI system has identified that your village JAROD has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JAGDISHBHAI (7359925116) - RAWAL\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste JAGDISHBHAI Ji!\n", + "\n", + "Our system shows reduced activity in RAWAL. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Steady Performers\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JAGDISHBHAI (9687013839) - KANTHARAI\n", + "Action: Call Mantri for Follow-up (Confidence: 0.98)\n", + "Message: \n", + "Namaste JAGDISHBHAI Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in KANTHARAI. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 98.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JAGDISHBHAI (9265960608) - AJUPURA\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste JAGDISHBHAI Ji!\n", + "\n", + "Our system shows reduced activity in AJUPURA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Steady Performers\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JAGDISHBHAI (9924762935) - GAMANPURA\n", + "Action: Check on Mantri (Confidence: 0.97)\n", + "Message: \n", + "Namaste JAGDISHBHAI Ji!\n", + "\n", + "Our system shows reduced activity in GAMANPURA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 97.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JAGDISHBHAI PATEL (9909719274) - KAYAVAROHAN\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste JAGDISHBHAI PATEL Ji!\n", + "\n", + "Our system shows reduced activity in KAYAVAROHAN. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Steady Performers\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JAGDISHBHAI PATEL (9909719274) - KAYAVAROHAN\n", + "Action: Send Marketing Team (Confidence: 0.99)\n", + "Message: \n", + "Namaste JAGDISHBHAI PATEL Ji!\n", + "\n", + "Our AI system has identified that your village KAYAVAROHAN has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 99.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JASVANTSINH PARMAR (6354405815) - DHARKHUNIYA\n", + "Action: Send Marketing Team (Confidence: 0.91)\n", + "Message: \n", + "Namaste JASVANTSINH PARMAR Ji!\n", + "\n", + "Our AI system has identified that your village DHARKHUNIYA has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: New/Developing\n", + "- Confidence: 91.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JAYANTIBHAI (8160204365) - PIPLOI\n", + "Action: Send Marketing Team (Confidence: 0.93)\n", + "Message: \n", + "Namaste JAYANTIBHAI Ji!\n", + "\n", + "Our AI system has identified that your village PIPLOI has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 93.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JAYANTIBHAI (7698601662) - VATADARA\n", + "Action: Call Mantri for Follow-up (Confidence: 0.95)\n", + "Message: \n", + "Namaste JAYANTIBHAI Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in VATADARA. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 95.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JAYDEEPBHAI (9714687264) - DUNGRIPURA\n", + "Action: Check on Mantri (Confidence: 0.98)\n", + "Message: \n", + "Namaste JAYDEEPBHAI Ji!\n", + "\n", + "Our system shows reduced activity in DUNGRIPURA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Steady Performers\n", + "- Confidence: 98.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JAYDEEPBHAI PATEL (7600913314) - ODE\n", + "Action: Check on Mantri (Confidence: 0.92)\n", + "Message: \n", + "Namaste JAYDEEPBHAI PATEL Ji!\n", + "\n", + "Our system shows reduced activity in ODE. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 92.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JAYDEEPSINH (9924903171) - JESAPURA\n", + "Action: Send Marketing Team (Confidence: 0.94)\n", + "Message: \n", + "Namaste JAYDEEPSINH Ji!\n", + "\n", + "Our AI system has identified that your village JESAPURA has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 94.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JAYESHBHAI MAKVANA (7567518630) - NAMISARA\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste JAYESHBHAI MAKVANA Ji!\n", + "\n", + "Our system shows reduced activity in NAMISARA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JAYESHBHAI PATEL (9879977750) - GANA\n", + "Action: Check on Mantri (Confidence: 0.97)\n", + "Message: \n", + "Namaste JAYESHBHAI PATEL Ji!\n", + "\n", + "Our system shows reduced activity in GANA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 97.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JAYRAJBHAI SOLANKI (7698346288) - VANADARA\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste JAYRAJBHAI SOLANKI Ji!\n", + "\n", + "Our system shows reduced activity in VANADARA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Steady Performers\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JAYRAJSINH (8347977820) - VALVOD\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste JAYRAJSINH Ji!\n", + "\n", + "Our system shows reduced activity in VALVOD. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JESANGBHAI CHAVDA (9427828741) - HATHIPURA\n", + "Action: Send Marketing Team (Confidence: 0.96)\n", + "Message: \n", + "Namaste JESANGBHAI CHAVDA Ji!\n", + "\n", + "Our AI system has identified that your village HATHIPURA has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: New/Developing\n", + "- Confidence: 96.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JIGARBHAI (9998147762) - SUNAV\n", + "Action: Send Marketing Team (Confidence: 0.99)\n", + "Message: \n", + "Namaste JIGARBHAI Ji!\n", + "\n", + "Our AI system has identified that your village SUNAV has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 99.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JIGNESHBHAI (8128009429) - FANGANI\n", + "Action: Check on Mantri (Confidence: 0.97)\n", + "Message: \n", + "Namaste JIGNESHBHAI Ji!\n", + "\n", + "Our system shows reduced activity in FANGANI. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 97.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JORUBHAI (8200199030) - DHUVARAN\n", + "Action: Call Mantri for Follow-up (Confidence: 1.00)\n", + "Message: \n", + "Namaste JORUBHAI Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in DHUVARAN. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JYANTIBHAI (7567518630) - VADOLA\n", + "Action: Call Mantri for Follow-up (Confidence: 1.00)\n", + "Message: \n", + "Namaste JYANTIBHAI Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in VADOLA. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JYANTIBHAI (9825817354) - UMLAV\n", + "Action: Call Mantri for Follow-up (Confidence: 0.94)\n", + "Message: \n", + "Namaste JYANTIBHAI Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in UMLAV. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: New/Developing\n", + "- Confidence: 94.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JYOTIBEN (9726768402) - DARAPURA\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste JYOTIBEN Ji!\n", + "\n", + "Our system shows reduced activity in DARAPURA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: JYOTSHANABEN (9016114912) - RAMPURA\n", + "Action: Check on Mantri (Confidence: 0.95)\n", + "Message: \n", + "Namaste JYOTSHANABEN Ji!\n", + "\n", + "Our system shows reduced activity in RAMPURA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 95.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: KABHAIBHAI PRAJAPATI (9978552418) - KANBHAIPURA\n", + "Action: Call Mantri for Follow-up (Confidence: 0.95)\n", + "Message: \n", + "Namaste KABHAIBHAI PRAJAPATI Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in KANBHAIPURA. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 95.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: KABHAYBHAI (9925861038) - AMIYAD\n", + "Action: Check on Mantri (Confidence: 0.97)\n", + "Message: \n", + "Namaste KABHAYBHAI Ji!\n", + "\n", + "Our system shows reduced activity in AMIYAD. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Steady Performers\n", + "- Confidence: 97.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: KAMLESHBHAI (6354508694) - BHARTHANA\n", + "Action: Check on Mantri (Confidence: 0.99)\n", + "Message: \n", + "Namaste KAMLESHBHAI Ji!\n", + "\n", + "Our system shows reduced activity in BHARTHANA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Steady Performers\n", + "- Confidence: 99.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: KAMLESHBHAI PATEL (9106850412 /) - SHEKHADI\n", + "Action: Call Mantri for Follow-up (Confidence: 1.00)\n", + "Message: \n", + "Namaste KAMLESHBHAI PATEL Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in SHEKHADI. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: KANAKSINH (7359619019) - KOSINDRA\n", + "Action: Call Mantri for Follow-up (Confidence: 0.98)\n", + "Message: \n", + "Namaste KANAKSINH Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in KOSINDRA. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 98.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: KANAKSINH PATEL (7359619019) - KOSINDRA\n", + "Action: Call Mantri for Follow-up (Confidence: 1.00)\n", + "Message: \n", + "Namaste KANAKSINH PATEL Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in KOSINDRA. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: KANUBHAI PARMAR (966481655) - MUVADA\n", + "Action: Check on Mantri (Confidence: 0.99)\n", + "Message: \n", + "Namaste KANUBHAI PARMAR Ji!\n", + "\n", + "Our system shows reduced activity in MUVADA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Steady Performers\n", + "- Confidence: 99.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: KHODSINH GOHIL (9601425263) - VITOJ\n", + "Action: Send Marketing Team (Confidence: 0.94)\n", + "Message: \n", + "Namaste KHODSINH GOHIL Ji!\n", + "\n", + "Our AI system has identified that your village VITOJ has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: Steady Performers\n", + "- Confidence: 94.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: KIRANBHAI (7698165451) - AMBALI\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste KIRANBHAI Ji!\n", + "\n", + "Our system shows reduced activity in AMBALI. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: KIRANBHAI (8000686958) - MIYAGAM\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste KIRANBHAI Ji!\n", + "\n", + "Our system shows reduced activity in MIYAGAM. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Steady Performers\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: KIRITBHAI (9870070574) - SINDHROT\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste KIRITBHAI Ji!\n", + "\n", + "Our system shows reduced activity in SINDHROT. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: KIRITBHAI (9408667583) - BHETASHI TALPAD\n", + "Action: Send Marketing Team (Confidence: 0.99)\n", + "Message: \n", + "Namaste KIRITBHAI Ji!\n", + "\n", + "Our AI system has identified that your village BHETASHI TALPAD has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: Steady Performers\n", + "- Confidence: 99.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: KIRITBHAI (7284836990) - VAGASHI\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste KIRITBHAI Ji!\n", + "\n", + "Our system shows reduced activity in VAGASHI. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: KIRITBHAI RATHOD (7698792086) - NATVARNAGAR\n", + "Action: Call Mantri for Follow-up (Confidence: 0.75)\n", + "Message: \n", + "Namaste KIRITBHAI RATHOD Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in NATVARNAGAR. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 75.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: KIRITBHAI SOLANKI (7069401622) - SHERPURA\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste KIRITBHAI SOLANKI Ji!\n", + "\n", + "Our system shows reduced activity in SHERPURA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: LABHUBHAI - SECRETORY (9924570056) - MUJKUVA\n", + "Action: Call Mantri for Follow-up (Confidence: 0.98)\n", + "Message: \n", + "Namaste LABHUBHAI - SECRETORY Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in MUJKUVA. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 98.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: LAHERBHAI (9586267241) - NANI SHERKHI\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste LAHERBHAI Ji!\n", + "\n", + "Our system shows reduced activity in NANI SHERKHI. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Steady Performers\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: LAHERBHAI (9586267241) - SHERKHI\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste LAHERBHAI Ji!\n", + "\n", + "Our system shows reduced activity in SHERKHI. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Steady Performers\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: LAHERBHAI (9586267241) - NANI SHERKHI\n", + "Action: Check on Mantri (Confidence: 0.93)\n", + "Message: \n", + "Namaste LAHERBHAI Ji!\n", + "\n", + "Our system shows reduced activity in NANI SHERKHI. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 93.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: LALJIBHAI (9909212667) - LALPURA\n", + "Action: Call Mantri for Follow-up (Confidence: 1.00)\n", + "Message: \n", + "Namaste LALJIBHAI Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in LALPURA. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MAHENDRABHAI (9727340474) - RANIYA\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste MAHENDRABHAI Ji!\n", + "\n", + "Our system shows reduced activity in RANIYA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MAHENDRABHAI THAKOR (8401608917) - SAMARKHA\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste MAHENDRABHAI THAKOR Ji!\n", + "\n", + "Our system shows reduced activity in SAMARKHA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MAHESHBHAI MAKVANA (6353875955) - NAGRA(KHODIYARNAGAR)\n", + "Action: Call Mantri for Follow-up (Confidence: 0.87)\n", + "Message: \n", + "Namaste MAHESHBHAI MAKVANA Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in NAGRA(KHODIYARNAGAR). \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 87.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MAHESHBHAI THAKOR (9313397942) - KANTHARIYA\n", + "Action: Call Mantri for Follow-up (Confidence: 1.00)\n", + "Message: \n", + "Namaste MAHESHBHAI THAKOR Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in KANTHARIYA. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MANHARBHAI (8155931534) - ASHI\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste MANHARBHAI Ji!\n", + "\n", + "Our system shows reduced activity in ASHI. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MANSINH (9924825699) - KALYANPURA\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste MANSINH Ji!\n", + "\n", + "Our system shows reduced activity in KALYANPURA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MANUBHAI (6355974133) - RAYPURA\n", + "Action: Send Marketing Team (Confidence: 1.00)\n", + "Message: \n", + "Namaste MANUBHAI Ji!\n", + "\n", + "Our AI system has identified that your village RAYPURA has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MANUBHAI PATEL (9909239416) - VADU\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste MANUBHAI PATEL Ji!\n", + "\n", + "Our system shows reduced activity in VADU. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MANUBHAI SOMABHAI CHAUHAN (9824643396) - BAJIPURA\n", + "Action: Send Marketing Team (Confidence: 0.99)\n", + "Message: \n", + "Namaste MANUBHAI SOMABHAI CHAUHAN Ji!\n", + "\n", + "Our AI system has identified that your village BAJIPURA has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: New/Developing\n", + "- Confidence: 99.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MAYURSINH RATHOD (6354933728) - RASAWADI\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste MAYURSINH RATHOD Ji!\n", + "\n", + "Our system shows reduced activity in RASAWADI. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MEHULBHAI (9726644968) - DILLICHAKLA\n", + "Action: Call Mantri for Follow-up (Confidence: 0.99)\n", + "Message: \n", + "Namaste MEHULBHAI Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in DILLICHAKLA. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 99.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MEHULBHAI (9726644968) - KATHANA\n", + "Action: Call Mantri for Follow-up (Confidence: 0.99)\n", + "Message: \n", + "Namaste MEHULBHAI Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in KATHANA. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 99.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MELABHAI PARMAR (8488051333) - KASOR\n", + "Action: Check on Mantri (Confidence: 0.89)\n", + "Message: \n", + "Namaste MELABHAI PARMAR Ji!\n", + "\n", + "Our system shows reduced activity in KASOR. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Underperforming\n", + "- Confidence: 89.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MITULBHAI (7383094973) - KASOR\n", + "Action: Check on Mantri (Confidence: 0.91)\n", + "Message: \n", + "Namaste MITULBHAI Ji!\n", + "\n", + "Our system shows reduced activity in KASOR. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 91.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MOHANBHAI (8140622110) - BADHIPURA\n", + "Action: Call Mantri for Follow-up (Confidence: 0.95)\n", + "Message: \n", + "Namaste MOHANBHAI Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in BADHIPURA. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 95.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MUKESHBHAI (9724777879) - MOGAR\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste MUKESHBHAI Ji!\n", + "\n", + "Our system shows reduced activity in MOGAR. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MUKESHBHAI (9904502098) - ASODAR\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste MUKESHBHAI Ji!\n", + "\n", + "Our system shows reduced activity in ASODAR. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MUKESHBHAI (9724777879) - MOGAR\n", + "Action: Check on Mantri (Confidence: 0.88)\n", + "Message: \n", + "Namaste MUKESHBHAI Ji!\n", + "\n", + "Our system shows reduced activity in MOGAR. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Steady Performers\n", + "- Confidence: 88.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MUKESHBHAI (9726858703) - KHORWAD\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste MUKESHBHAI Ji!\n", + "\n", + "Our system shows reduced activity in KHORWAD. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MUKESHBHAI (9913633154) - BOCHASAN\n", + "Action: Call Mantri for Follow-up (Confidence: 0.97)\n", + "Message: \n", + "Namaste MUKESHBHAI Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in BOCHASAN. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 97.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MUKESHBHAI (9624208283) - BANEJDA\n", + "Action: Call Mantri for Follow-up (Confidence: 0.99)\n", + "Message: \n", + "Namaste MUKESHBHAI Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in BANEJDA. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 99.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: MUKESHBHAI (7572979767) - BHARODA\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste MUKESHBHAI Ji!\n", + "\n", + "Our system shows reduced activity in BHARODA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: NAGINBHAI (4654654555) - RANOLI\n", + "Action: Send Marketing Team (Confidence: 0.86)\n", + "Message: \n", + "Namaste NAGINBHAI Ji!\n", + "\n", + "Our AI system has identified that your village RANOLI has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 86.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: NARENDRABHAI (9316344592) - GAJANA\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste NARENDRABHAI Ji!\n", + "\n", + "Our system shows reduced activity in GAJANA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Steady Performers\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: NARENDRABHAI (9909318997) - NAVGAMA\n", + "Action: Send Marketing Team (Confidence: 0.99)\n", + "Message: \n", + "Namaste NARENDRABHAI Ji!\n", + "\n", + "Our AI system has identified that your village NAVGAMA has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 99.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: NATUBHAI CHAIRMAN (9924917292) - KAMROL\n", + "Action: Send Marketing Team (Confidence: 0.91)\n", + "Message: \n", + "Namaste NATUBHAI CHAIRMAN Ji!\n", + "\n", + "Our AI system has identified that your village KAMROL has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 91.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: NATUKAKA (9726573829) - SANDHA\n", + "Action: Send Marketing Team (Confidence: 0.88)\n", + "Message: \n", + "Namaste NATUKAKA Ji!\n", + "\n", + "Our AI system has identified that your village SANDHA has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: New/Developing\n", + "- Confidence: 88.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: NATVARBHAI GOHIL (9979898470) - VAKHATPURA\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste NATVARBHAI GOHIL Ji!\n", + "\n", + "Our system shows reduced activity in VAKHATPURA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Steady Performers\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: NILESHBHAI (8780110103) - HARKHAPURA\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste NILESHBHAI Ji!\n", + "\n", + "Our system shows reduced activity in HARKHAPURA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: NILESHBHAI (9898881850) - PORDA\n", + "Action: Check on Mantri (Confidence: 0.99)\n", + "Message: \n", + "Namaste NILESHBHAI Ji!\n", + "\n", + "Our system shows reduced activity in PORDA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Steady Performers\n", + "- Confidence: 99.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: PANKAJBHAI (7383092105) - SIMARDA\n", + "Action: Check on Mantri (Confidence: 0.97)\n", + "Message: \n", + "Namaste PANKAJBHAI Ji!\n", + "\n", + "Our system shows reduced activity in SIMARDA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 97.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: PARESHBHAI (9879665401) - KHAKHARIYA\n", + "Action: Send Marketing Team (Confidence: 0.99)\n", + "Message: \n", + "Namaste PARESHBHAI Ji!\n", + "\n", + "Our AI system has identified that your village KHAKHARIYA has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 99.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: PARESHBHAI-CASHIER (9998851329) - BAMANGAM\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste PARESHBHAI-CASHIER Ji!\n", + "\n", + "Our system shows reduced activity in BAMANGAM. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: PARVATBHAI (9574229451) - ASHIPURA\n", + "Action: Send Marketing Team (Confidence: 0.98)\n", + "Message: \n", + "Namaste PARVATBHAI Ji!\n", + "\n", + "Our AI system has identified that your village ASHIPURA has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 98.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: PINTUBHAI (9824663860) - JOGAN\n", + "Action: Send Marketing Team (Confidence: 0.98)\n", + "Message: \n", + "Namaste PINTUBHAI Ji!\n", + "\n", + "Our AI system has identified that your village JOGAN has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 98.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: PRADIPSINH MAHIDA (9998270536) - VADOD\n", + "Action: Call Mantri for Follow-up (Confidence: 0.99)\n", + "Message: \n", + "Namaste PRADIPSINH MAHIDA Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in VADOD. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 99.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: PRAVINBHAI (9913975412) - CHOKARI\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste PRAVINBHAI Ji!\n", + "\n", + "Our system shows reduced activity in CHOKARI. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: PRAVINBHAI B GOHIL (4578123654) - NAVAPURA\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste PRAVINBHAI B GOHIL Ji!\n", + "\n", + "Our system shows reduced activity in NAVAPURA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: PRAVINBHAI CHAUHAN (9904071931) - MAHAPURA\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste PRAVINBHAI CHAUHAN Ji!\n", + "\n", + "Our system shows reduced activity in MAHAPURA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: PRAVINBHAI PATEL (9723468521) - DAHEVAN\n", + "Action: Check on Mantri (Confidence: 0.98)\n", + "Message: \n", + "Namaste PRAVINBHAI PATEL Ji!\n", + "\n", + "Our system shows reduced activity in DAHEVAN. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Steady Performers\n", + "- Confidence: 98.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: PRAVINBHAI PATEL (9723468521) - AMBERAOPURA(DAHEVAN)\n", + "Action: Call Mantri for Follow-up (Confidence: 0.99)\n", + "Message: \n", + "Namaste PRAVINBHAI PATEL Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in AMBERAOPURA(DAHEVAN). \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 99.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: PRAVINBHAI PATEL (9723468521) - KANCHORAPURA\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste PRAVINBHAI PATEL Ji!\n", + "\n", + "Our system shows reduced activity in KANCHORAPURA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: PUSHPABEN THAKORBHAI (8866515355) - MOKSHI\n", + "Action: Send Marketing Team (Confidence: 0.99)\n", + "Message: \n", + "Namaste PUSHPABEN THAKORBHAI Ji!\n", + "\n", + "Our AI system has identified that your village MOKSHI has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 99.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RAHIM RANA (9979512832) - TUNDAV\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste RAHIM RANA Ji!\n", + "\n", + "Our system shows reduced activity in TUNDAV. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Steady Performers\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RAHULBHAI PADHIYAR (6355245589) - BAJIPURA\n", + "Action: Call Mantri for Follow-up (Confidence: 1.00)\n", + "Message: \n", + "Namaste RAHULBHAI PADHIYAR Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in BAJIPURA. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RAJENDRABHAI GOHIL (7984449859) - AMRUTPURA \n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste RAJENDRABHAI GOHIL Ji!\n", + "\n", + "Our system shows reduced activity in AMRUTPURA . \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RAJENDRASINH (9510084847) - AHIMA\n", + "Action: Call Mantri for Follow-up (Confidence: 0.99)\n", + "Message: \n", + "Namaste RAJENDRASINH Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in AHIMA. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 99.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RAJENDRASINH RATHOD (9904267230) - BODKA\n", + "Action: Check on Mantri (Confidence: 0.99)\n", + "Message: \n", + "Namaste RAJENDRASINH RATHOD Ji!\n", + "\n", + "Our system shows reduced activity in BODKA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Steady Performers\n", + "- Confidence: 99.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RAJESHBHAI (nan) - DABHASI \n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste RAJESHBHAI Ji!\n", + "\n", + "Our system shows reduced activity in DABHASI . \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RAJUBHAI (8511880200) - SAIJPUR\n", + "Action: Send Marketing Team (Confidence: 0.99)\n", + "Message: \n", + "Namaste RAJUBHAI Ji!\n", + "\n", + "Our AI system has identified that your village SAIJPUR has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: New/Developing\n", + "- Confidence: 99.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RAJVANTBHAI (6352134649) - AMODAR\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste RAJVANTBHAI Ji!\n", + "\n", + "Our system shows reduced activity in AMODAR. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RAMANBHAI (9904930269) - KANDHROTI\n", + "Action: Check on Mantri (Confidence: 0.99)\n", + "Message: \n", + "Namaste RAMANBHAI Ji!\n", + "\n", + "Our system shows reduced activity in KANDHROTI. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 99.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RAMESHBHAI (9978285223) - HARIPURA\n", + "Action: Check on Mantri (Confidence: 0.99)\n", + "Message: \n", + "Namaste RAMESHBHAI Ji!\n", + "\n", + "Our system shows reduced activity in HARIPURA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 99.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RAMESHBHAI (9265446510) - BHIMPURA\n", + "Action: Check on Mantri (Confidence: 0.95)\n", + "Message: \n", + "Namaste RAMESHBHAI Ji!\n", + "\n", + "Our system shows reduced activity in BHIMPURA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 95.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RAMESHBHAI (9979137503) - GAMBHIRA\n", + "Action: Call Mantri for Follow-up (Confidence: 0.92)\n", + "Message: \n", + "Namaste RAMESHBHAI Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in GAMBHIRA. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 92.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RAMESHBHAI (9574627424) - DAGJIPURA\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste RAMESHBHAI Ji!\n", + "\n", + "Our system shows reduced activity in DAGJIPURA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Steady Performers\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RAMESHBHAI BHUTSINH PARMAR (nan) - KATHANA STATION\n", + "Action: Send Marketing Team (Confidence: 0.99)\n", + "Message: \n", + "Namaste RAMESHBHAI BHUTSINH PARMAR Ji!\n", + "\n", + "Our AI system has identified that your village KATHANA STATION has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 99.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RAMSINH (9904743303) - DHOLI\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste RAMSINH Ji!\n", + "\n", + "Our system shows reduced activity in DHOLI. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Steady Performers\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RAMTUSINH (9328409149) - BALANAPURA\n", + "Action: Send Marketing Team (Confidence: 0.99)\n", + "Message: \n", + "Namaste RAMTUSINH Ji!\n", + "\n", + "Our AI system has identified that your village BALANAPURA has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: Steady Performers\n", + "- Confidence: 99.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RANJITBHAI (8849744704) - CHIKHODARA\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste RANJITBHAI Ji!\n", + "\n", + "Our system shows reduced activity in CHIKHODARA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RASIKBHAI R VAGHELA (9723687092) - ASARAMA\n", + "Action: Check on Mantri (Confidence: 0.95)\n", + "Message: \n", + "Namaste RASIKBHAI R VAGHELA Ji!\n", + "\n", + "Our system shows reduced activity in ASARAMA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Underperforming\n", + "- Confidence: 95.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RATHOD RAHEMATKHAN (9925069598) - CHANVADA\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste RATHOD RAHEMATKHAN Ji!\n", + "\n", + "Our system shows reduced activity in CHANVADA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Steady Performers\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RAVIBHAI (7043826112) - KOTHIYAKHAD\n", + "Action: Call Mantri for Follow-up (Confidence: 0.99)\n", + "Message: \n", + "Namaste RAVIBHAI Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in KOTHIYAKHAD. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 99.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RAVINDRABHAI (9662740083) - KHEDASA\n", + "Action: Send Marketing Team (Confidence: 0.98)\n", + "Message: \n", + "Namaste RAVINDRABHAI Ji!\n", + "\n", + "Our AI system has identified that your village KHEDASA has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 98.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RAVINDRABHAI PATEL (9426884301) - NANA KALODARA\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste RAVINDRABHAI PATEL Ji!\n", + "\n", + "Our system shows reduced activity in NANA KALODARA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: RUTVIKBHAI (9327262524) - ZAKHARIYA\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste RUTVIKBHAI Ji!\n", + "\n", + "Our system shows reduced activity in ZAKHARIYA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SAMIRBHAI PATEL (9898825711) - SARSA\n", + "Action: Call Mantri for Follow-up (Confidence: 1.00)\n", + "Message: \n", + "Namaste SAMIRBHAI PATEL Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in SARSA. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SANJAYBHAI (9974294254) - TRIKAMPURA\n", + "Action: Check on Mantri (Confidence: 0.95)\n", + "Message: \n", + "Namaste SANJAYBHAI Ji!\n", + "\n", + "Our system shows reduced activity in TRIKAMPURA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 95.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SANJAYBHAI (8140766086) - SARDARPURA\n", + "Action: Send Marketing Team (Confidence: 0.99)\n", + "Message: \n", + "Namaste SANJAYBHAI Ji!\n", + "\n", + "Our AI system has identified that your village SARDARPURA has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 99.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SANJAYBHAI (7283995919) - POPATVAV\n", + "Action: Call Mantri for Follow-up (Confidence: 0.99)\n", + "Message: \n", + "Namaste SANJAYBHAI Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in POPATVAV. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 99.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SANJAYBHAI PARMAR (8239791094) - PIRODNAGAR\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste SANJAYBHAI PARMAR Ji!\n", + "\n", + "Our system shows reduced activity in PIRODNAGAR. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SATISHBHAI (9979472671) - BHAVANIPURA\n", + "Action: Call Mantri for Follow-up (Confidence: 0.98)\n", + "Message: \n", + "Namaste SATISHBHAI Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in BHAVANIPURA. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 98.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SHABBIRBHAI RATHOD (8460326712) - NAPAD VANTO\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste SHABBIRBHAI RATHOD Ji!\n", + "\n", + "Our system shows reduced activity in NAPAD VANTO. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SHAHID BHALAVAT (6355754371) - LASUNDRA\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste SHAHID BHALAVAT Ji!\n", + "\n", + "Our system shows reduced activity in LASUNDRA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Steady Performers\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SHAILESHBHAI (7990024992) - GOPALPURA\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste SHAILESHBHAI Ji!\n", + "\n", + "Our system shows reduced activity in GOPALPURA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SHAILESHBHAI (6351912663) - SAMBHOI\n", + "Action: Check on Mantri (Confidence: 0.99)\n", + "Message: \n", + "Namaste SHAILESHBHAI Ji!\n", + "\n", + "Our system shows reduced activity in SAMBHOI. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 99.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SHAILESHBHAI (9104244408) - VIRSAD\n", + "Action: Call Mantri for Follow-up (Confidence: 1.00)\n", + "Message: \n", + "Namaste SHAILESHBHAI Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in VIRSAD. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: New/Developing\n", + "- Confidence: 100.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SHAILESHBHAI RATHOD (9725093842) - RATANPURA\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste SHAILESHBHAI RATHOD Ji!\n", + "\n", + "Our system shows reduced activity in RATANPURA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SHAILESHBHAI SHARMA (7990024992) - GOPALPURA\n", + "Action: Send Marketing Team (Confidence: 1.00)\n", + "Message: \n", + "Namaste SHAILESHBHAI SHARMA Ji!\n", + "\n", + "Our AI system has identified that your village GOPALPURA has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SHANABHAI MAHERA (9925310608) - MARGAKUI\n", + "Action: Call Mantri for Follow-up (Confidence: 0.99)\n", + "Message: \n", + "Namaste SHANABHAI MAHERA Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in MARGAKUI. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 99.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SHANABHAI-MANTRY (6351055831) - KHADANA\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste SHANABHAI-MANTRY Ji!\n", + "\n", + "Our system shows reduced activity in KHADANA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Steady Performers\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SHANKARBHAI THAKOR (8140448296) - JOGAN\n", + "Action: Call Mantri for Follow-up (Confidence: 0.99)\n", + "Message: \n", + "Namaste SHANKARBHAI THAKOR Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in JOGAN. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 99.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SURESHBHAI (9913584672) - JAKHLA\n", + "Action: Send Marketing Team (Confidence: 0.98)\n", + "Message: \n", + "Namaste SURESHBHAI Ji!\n", + "\n", + "Our AI system has identified that your village JAKHLA has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 98.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SURESHBHAI SOLANKI (9033782505) - HAMIDPURA\n", + "Action: Send Marketing Team (Confidence: 1.00)\n", + "Message: \n", + "Namaste SURESHBHAI SOLANKI Ji!\n", + "\n", + "Our AI system has identified that your village HAMIDPURA has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SURESHBHAI THAKOR (9924946614) - KHANKUVA\n", + "Action: Check on Mantri (Confidence: 0.98)\n", + "Message: \n", + "Namaste SURESHBHAI THAKOR Ji!\n", + "\n", + "Our system shows reduced activity in KHANKUVA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 98.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: SURPALSINH MAHIDA (9824741993) - VAKANER\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste SURPALSINH MAHIDA Ji!\n", + "\n", + "Our system shows reduced activity in VAKANER. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Steady Performers\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: UDAYSINH (9737117756) - SHANKARPURA\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste UDAYSINH Ji!\n", + "\n", + "Our system shows reduced activity in SHANKARPURA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Steady Performers\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: UDESINH BAPU (9624234618) - LAXMIPURA\n", + "Action: Check on Mantri (Confidence: 0.98)\n", + "Message: \n", + "Namaste UDESINH BAPU Ji!\n", + "\n", + "Our system shows reduced activity in LAXMIPURA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Steady Performers\n", + "- Confidence: 98.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: UDESINH BHAI (9824287850) - DODHIYA PURA\n", + "Action: Send Marketing Team (Confidence: 0.96)\n", + "Message: \n", + "Namaste UDESINH BHAI Ji!\n", + "\n", + "Our AI system has identified that your village DODHIYA PURA has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 96.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: UPENDRASINH GARADHIYA (9106644185) - RASULABAD\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste UPENDRASINH GARADHIYA Ji!\n", + "\n", + "Our system shows reduced activity in RASULABAD. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: VANRAJBHAI (8347168185) - KALAMASAR\n", + "Action: Call Mantri for Follow-up (Confidence: 0.98)\n", + "Message: \n", + "Namaste VANRAJBHAI Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in KALAMASAR. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: New/Developing\n", + "- Confidence: 98.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: VANRAJSINH SINDHA (8347168185) - KALAMSAR\n", + "Action: Call Mantri for Follow-up (Confidence: 0.95)\n", + "Message: \n", + "Namaste VANRAJSINH SINDHA Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in KALAMSAR. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: New/Developing\n", + "- Confidence: 95.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: VASIM VAHORA- (9725089741) - ASODAR\n", + "Action: Check on Mantri (Confidence: 0.90)\n", + "Message: \n", + "Namaste VASIM VAHORA- Ji!\n", + "\n", + "Our system shows reduced activity in ASODAR. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 90.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: VASIMKHAN (546549846) - VISHNOLI\n", + "Action: Call Mantri for Follow-up (Confidence: 0.98)\n", + "Message: \n", + "Namaste VASIMKHAN Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in VISHNOLI. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 98.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: VIJAYBHAI (7046580350) - BORIYA\n", + "Action: Call Mantri for Follow-up (Confidence: 0.95)\n", + "Message: \n", + "Namaste VIJAYBHAI Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in BORIYA. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 95.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: VIJAYBHAI PARMAR (6351313878) - FATEPURA\n", + "Action: Send Marketing Team (Confidence: 1.00)\n", + "Message: \n", + "Namaste VIJAYBHAI PARMAR Ji!\n", + "\n", + "Our AI system has identified that your village FATEPURA has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: VIKRAMBHAI (6353733421) - GORVA\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste VIKRAMBHAI Ji!\n", + "\n", + "Our system shows reduced activity in GORVA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: VIKRAMBHAI (9586986099) - RANJITNAGAR\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste VIKRAMBHAI Ji!\n", + "\n", + "Our system shows reduced activity in RANJITNAGAR. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: VIKRAMBHAI BHARVAD (9979486637) - NEJA\n", + "Action: Check on Mantri (Confidence: 0.99)\n", + "Message: \n", + "Namaste VIKRAMBHAI BHARVAD Ji!\n", + "\n", + "Our system shows reduced activity in NEJA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: Steady Performers\n", + "- Confidence: 99.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: VIKRAMSINH (9712007585) - MITHAPURA\n", + "Action: Send Marketing Team (Confidence: 0.97)\n", + "Message: \n", + "Namaste VIKRAMSINH Ji!\n", + "\n", + "Our AI system has identified that your village MITHAPURA has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: Steady Performers\n", + "- Confidence: 97.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: VIKRAMSINH CHAUHAN (9825316980) - INDRAD\n", + "Action: Send Marketing Team (Confidence: 0.93)\n", + "Message: \n", + "Namaste VIKRAMSINH CHAUHAN Ji!\n", + "\n", + "Our AI system has identified that your village INDRAD has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: Steady Performers\n", + "- Confidence: 93.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: VINUBHAI (6352399755) - KHAKHANPUR\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste VINUBHAI Ji!\n", + "\n", + "Our system shows reduced activity in KHAKHANPUR. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: VINUBHAI SOLANKI (9998756469) - KANODA\n", + "Action: Send Marketing Team (Confidence: 0.98)\n", + "Message: \n", + "Namaste VINUBHAI SOLANKI Ji!\n", + "\n", + "Our AI system has identified that your village KANODA has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 98.0%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: VISHNUBHAI (9909550170) - KOTAMBI\n", + "Action: Check on Mantri (Confidence: 0.99)\n", + "Message: \n", + "Namaste VISHNUBHAI Ji!\n", + "\n", + "Our system shows reduced activity in KOTAMBI. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 99.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: VITHTHALBHAI (9924590017) - RASNOL\n", + "Action: Call Mantri for Follow-up (Confidence: 0.82)\n", + "Message: \n", + "Namaste VITHTHALBHAI Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in RASNOL. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: New/Developing\n", + "- Confidence: 82.0%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: YOGESHBHAI (7990383811) - JITPURA\n", + "Action: Check on Mantri (Confidence: 1.00)\n", + "Message: \n", + "Namaste YOGESHBHAI Ji!\n", + "\n", + "Our system shows reduced activity in JITPURA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 100.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "To: YUVRAJSINH (6353209447) - BHATPURA\n", + "Action: Check on Mantri (Confidence: 0.99)\n", + "Message: \n", + "Namaste YUVRAJSINH Ji!\n", + "\n", + "Our system shows reduced activity in BHATPURA. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: High Potential - Low Engagement\n", + "- Confidence: 99.0%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\n", + "\n", + "VILLAGE SEGMENTS:\n", + " Village Segment Conversion_Rate Untapped_Potential ML_Recommended_Action\n", + " JILOD High Potential - Low Engagement 100.00 0.0 Check on Mantri\n", + " MANJIPURA Steady Performers 76.19 5.0 Check on Mantri\n", + " GOTHADA Steady Performers 66.67 1.0 Check on Mantri\n", + " UNTKHARI High Potential - Low Engagement 0.00 0.0 Send Marketing Team\n", + " VEMAR High Potential - Low Engagement 0.00 2.0 Send Marketing Team\n", + " MORAD High Potential - Low Engagement 68.97 9.0 Check on Mantri\n", + " VATRA High Potential - Low Engagement 53.00 235.0 Call Mantri for Follow-up\n", + " VAHERA High Potential - Low Engagement 93.48 3.0 Check on Mantri\n", + " DALI High Potential - Low Engagement 59.25 359.0 Call Mantri for Follow-up\n", + " KHADOL (H ) High Potential - Low Engagement 84.62 2.0 Check on Mantri\n", + " ADIRAN Steady Performers 58.33 5.0 Check on Mantri\n", + " RAVIPURA Steady Performers 0.00 -13.0 Send Marketing Team\n", + " KHADODHI High Potential - Low Engagement 123.16 -66.0 Check on Mantri\n", + " JANTRAL High Potential - Low Engagement 38.90 424.0 Call Mantri for Follow-up\n", + " BHAREL Steady Performers 0.00 -6.0 Send Marketing Team\n", + " KUKVAD High Potential - Low Engagement 48.53 193.0 Call Mantri for Follow-up\n", + " VEDACH New/Developing 24.04 670.0 Call Mantri for Follow-up\n", + " TRANOL High Potential - Low Engagement 120.00 -2.0 Check on Mantri\n", + " NAVAPURA High Potential - Low Engagement 56.43 183.0 Call Mantri for Follow-up\n", + " DEVRAMPURA High Potential - Low Engagement 41.67 203.0 Call Mantri for Follow-up\n", + " BORSAD MAIN DAIRY New/Developing 23.51 2677.0 Call Mantri for Follow-up\n", + " KHIJALPUR High Potential - Low Engagement 0.00 289.0 Send Marketing Team\n", + " KANBHA High Potential - Low Engagement 60.39 307.0 Call Mantri for Follow-up\n", + " TRAMBOVAD High Potential - Low Engagement 0.00 -6.0 Send Marketing Team\n", + " PRATAPPURA Steady Performers 59.26 11.0 Check on Mantri\n", + " KATHOL High Potential - Low Engagement 75.71 17.0 Check on Mantri\n", + " DADPURA High Potential - Low Engagement 0.00 5.0 Send Marketing Team\n", + " DUNDELAV High Potential - Low Engagement 73.68 5.0 Check on Mantri\n", + " RAJPUR High Potential - Low Engagement 0.00 0.0 Send Marketing Team\n", + " MOTI SANKHYAD High Potential - Low Engagement 66.67 7.0 Check on Mantri\n", + " SALUN High Potential - Low Engagement 93.75 1.0 Check on Mantri\n", + " VASVEL High Potential - Low Engagement 0.00 2.0 Send Marketing Team\n", + " NAVAPURA High Potential - Low Engagement 54.17 11.0 Check on Mantri\n", + " KALU High Potential - Low Engagement 66.11 122.0 Call Mantri for Follow-up\n", + " FINAV High Potential - Low Engagement 82.61 4.0 Check on Mantri\n", + " BILPAD High Potential - Low Engagement 5.43 331.0 Send Marketing Team\n", + " SINHOL High Potential - Low Engagement 58.36 309.0 Call Mantri for Follow-up\n", + " PILODARA High Potential - Low Engagement 74.29 9.0 Check on Mantri\n", + " KESHAVPURA High Potential - Low Engagement 68.97 18.0 Check on Mantri\n", + " KASUMBAD High Potential - Low Engagement 80.00 2.0 Check on Mantri\n", + " PAMOL High Potential - Low Engagement 88.89 2.0 Check on Mantri\n", + " MANPURA High Potential - Low Engagement 80.00 1.0 Check on Mantri\n", + " ALARASHA High Potential - Low Engagement 0.00 0.0 Send Marketing Team\n", + " VAKHATPURA Steady Performers 66.67 1.0 Check on Mantri\n", + " NANI SANKHYAD Steady Performers 75.00 6.0 Check on Mantri\n", + " DHUNDHAKUVA High Potential - Low Engagement 95.45 1.0 Check on Mantri\n", + " VAHERAKHADI High Potential - Low Engagement 80.00 8.0 Check on Mantri\n", + " NANI SANKHYAD High Potential - Low Engagement 75.00 6.0 Check on Mantri\n", + " CHAMARA High Potential - Low Engagement 40.00 135.0 Call Mantri for Follow-up\n", + " CHAMARA High Potential - Low Engagement 72.00 35.0 Call Mantri for Follow-up\n", + " SURELI High Potential - Low Engagement 92.86 1.0 Check on Mantri\n", + " SINGLAV High Potential - Low Engagement 86.67 4.0 Check on Mantri\n", + " RAIPURA High Potential - Low Engagement 94.74 1.0 Check on Mantri\n", + " RANCHHODPURA High Potential - Low Engagement 0.00 14.0 Send Marketing Team\n", + " RATAN JI NA MUVADA Steady Performers 0.00 -12.0 Send Marketing Team\n", + " DHANTEJ Steady Performers 85.71 2.0 Check on Mantri\n", + " SANGADOL Steady Performers 75.00 4.0 Check on Mantri\n", + " SHILI New/Developing 22.46 1001.0 Call Mantri for Follow-up\n", + " RASULPUR Steady Performers 44.83 16.0 Check on Mantri\n", + " BECHRI High Potential - Low Engagement 0.00 0.0 Send Marketing Team\n", + " BODIKUVA Steady Performers 10.98 73.0 Send Marketing Team\n", + " RAJUPURA High Potential - Low Engagement 51.10 245.0 Call Mantri for Follow-up\n", + " RAJUPURA High Potential - Low Engagement 54.47 214.0 Call Mantri for Follow-up\n", + " NAGRA High Potential - Low Engagement 81.43 13.0 Check on Mantri\n", + " PARVATA High Potential - Low Engagement 0.00 6.0 Send Marketing Team\n", + " BAUTHA High Potential - Low Engagement 100.00 0.0 Check on Mantri\n", + " DUDHAPURA Steady Performers 85.71 1.0 Check on Mantri\n", + " MOTI SHERKHI Steady Performers 100.00 0.0 Check on Mantri\n", + " JAROD High Potential - Low Engagement 0.00 0.0 Send Marketing Team\n", + " RAWAL Steady Performers 77.78 2.0 Check on Mantri\n", + " KANTHARAI High Potential - Low Engagement 77.00 69.0 Call Mantri for Follow-up\n", + " AJUPURA Steady Performers 66.67 3.0 Check on Mantri\n", + " GAMANPURA High Potential - Low Engagement 94.59 8.0 Check on Mantri\n", + " KAYAVAROHAN Steady Performers 73.33 4.0 Check on Mantri\n", + " KAYAVAROHAN High Potential - Low Engagement 0.00 0.0 Send Marketing Team\n", + " DHARKHUNIYA New/Developing 11.79 688.0 Send Marketing Team\n", + " PIPLOI High Potential - Low Engagement 0.00 -23.0 Send Marketing Team\n", + " VATADARA High Potential - Low Engagement 65.60 258.0 Call Mantri for Follow-up\n", + " DUNGRIPURA Steady Performers 59.09 9.0 Check on Mantri\n", + " ODE High Potential - Low Engagement 69.32 27.0 Check on Mantri\n", + " JESAPURA High Potential - Low Engagement 0.00 -116.0 Send Marketing Team\n", + " NAMISARA High Potential - Low Engagement 93.75 1.0 Check on Mantri\n", + " GANA High Potential - Low Engagement 83.33 1.0 Check on Mantri\n", + " VANADARA Steady Performers 87.50 2.0 Check on Mantri\n", + " VALVOD High Potential - Low Engagement 83.93 9.0 Check on Mantri\n", + " HATHIPURA New/Developing 1.35 730.0 Send Marketing Team\n", + " SUNAV High Potential - Low Engagement 0.00 -38.0 Send Marketing Team\n", + " FANGANI High Potential - Low Engagement 108.33 -1.0 Check on Mantri\n", + " DHUVARAN High Potential - Low Engagement 55.81 540.0 Call Mantri for Follow-up\n", + " VADOLA High Potential - Low Engagement 61.93 75.0 Call Mantri for Follow-up\n", + " UMLAV New/Developing 24.76 857.0 Call Mantri for Follow-up\n", + " DARAPURA High Potential - Low Engagement 100.00 0.0 Check on Mantri\n", + " RAMPURA High Potential - Low Engagement 100.00 0.0 Check on Mantri\n", + " KANBHAIPURA High Potential - Low Engagement 73.33 56.0 Call Mantri for Follow-up\n", + " AMIYAD Steady Performers 53.85 12.0 Check on Mantri\n", + " BHARTHANA Steady Performers 46.15 7.0 Check on Mantri\n", + " SHEKHADI High Potential - Low Engagement 69.44 99.0 Call Mantri for Follow-up\n", + " KOSINDRA High Potential - Low Engagement 63.84 115.0 Call Mantri for Follow-up\n", + " KOSINDRA High Potential - Low Engagement 63.84 115.0 Call Mantri for Follow-up\n", + " MUVADA Steady Performers 50.00 3.0 Check on Mantri\n", + " VITOJ Steady Performers 0.00 -10.0 Send Marketing Team\n", + " AMBALI High Potential - Low Engagement 61.36 17.0 Check on Mantri\n", + " MIYAGAM Steady Performers 75.00 6.0 Check on Mantri\n", + " SINDHROT High Potential - Low Engagement 87.50 2.0 Check on Mantri\n", + " BHETASHI TALPAD Steady Performers 0.00 -21.0 Send Marketing Team\n", + " VAGASHI High Potential - Low Engagement 91.67 1.0 Check on Mantri\n", + " NATVARNAGAR High Potential - Low Engagement 57.33 32.0 Call Mantri for Follow-up\n", + " SHERPURA High Potential - Low Engagement 83.33 2.0 Check on Mantri\n", + " MUJKUVA High Potential - Low Engagement 67.13 47.0 Call Mantri for Follow-up\n", + " NANI SHERKHI Steady Performers 66.67 9.0 Check on Mantri\n", + " SHERKHI Steady Performers 85.00 3.0 Check on Mantri\n", + " NANI SHERKHI High Potential - Low Engagement 66.67 9.0 Check on Mantri\n", + " LALPURA High Potential - Low Engagement 33.69 185.0 Call Mantri for Follow-up\n", + " RANIYA High Potential - Low Engagement 68.42 6.0 Check on Mantri\n", + " SAMARKHA High Potential - Low Engagement 79.10 14.0 Check on Mantri\n", + "NAGRA(KHODIYARNAGAR) High Potential - Low Engagement 78.29 99.0 Call Mantri for Follow-up\n", + " KANTHARIYA High Potential - Low Engagement 67.37 108.0 Call Mantri for Follow-up\n", + " ASHI High Potential - Low Engagement 87.50 2.0 Check on Mantri\n", + " KALYANPURA High Potential - Low Engagement 77.78 4.0 Check on Mantri\n", + " RAYPURA High Potential - Low Engagement 5.20 328.0 Send Marketing Team\n", + " VADU High Potential - Low Engagement 93.75 2.0 Check on Mantri\n", + " BAJIPURA New/Developing 2.92 1031.0 Send Marketing Team\n", + " RASAWADI High Potential - Low Engagement 83.33 4.0 Check on Mantri\n", + " DILLICHAKLA High Potential - Low Engagement 71.11 104.0 Call Mantri for Follow-up\n", + " KATHANA High Potential - Low Engagement 60.20 197.0 Call Mantri for Follow-up\n", + " KASOR Underperforming 1270.59 -398.0 Check on Mantri\n", + " KASOR High Potential - Low Engagement 46.00 27.0 Check on Mantri\n", + " BADHIPURA High Potential - Low Engagement 65.50 69.0 Call Mantri for Follow-up\n", + " MOGAR High Potential - Low Engagement 90.91 2.0 Check on Mantri\n", + " ASODAR High Potential - Low Engagement 70.59 5.0 Check on Mantri\n", + " MOGAR Steady Performers 90.91 2.0 Check on Mantri\n", + " KHORWAD High Potential - Low Engagement 80.95 4.0 Check on Mantri\n", + " BOCHASAN High Potential - Low Engagement 28.91 563.0 Call Mantri for Follow-up\n", + " BANEJDA High Potential - Low Engagement 56.66 127.0 Call Mantri for Follow-up\n", + " BHARODA High Potential - Low Engagement 78.57 3.0 Check on Mantri\n", + " RANOLI High Potential - Low Engagement 0.00 -3.0 Send Marketing Team\n", + " GAJANA Steady Performers 73.08 7.0 Check on Mantri\n", + " NAVGAMA High Potential - Low Engagement 0.00 0.0 Send Marketing Team\n", + " KAMROL High Potential - Low Engagement 0.00 -127.0 Send Marketing Team\n", + " SANDHA New/Developing 16.13 993.0 Send Marketing Team\n", + " VAKHATPURA Steady Performers 66.67 1.0 Check on Mantri\n", + " HARKHAPURA High Potential - Low Engagement 68.89 14.0 Check on Mantri\n", + " PORDA Steady Performers 50.00 3.0 Check on Mantri\n", + " SIMARDA High Potential - Low Engagement 64.00 9.0 Check on Mantri\n", + " KHAKHARIYA High Potential - Low Engagement 0.00 0.0 Send Marketing Team\n", + " BAMANGAM High Potential - Low Engagement 83.33 4.0 Check on Mantri\n", + " ASHIPURA High Potential - Low Engagement 0.00 0.0 Send Marketing Team\n", + " JOGAN High Potential - Low Engagement 0.00 4.0 Send Marketing Team\n", + " VADOD High Potential - Low Engagement 65.67 230.0 Call Mantri for Follow-up\n", + " CHOKARI High Potential - Low Engagement 80.00 1.0 Check on Mantri\n", + " NAVAPURA High Potential - Low Engagement 80.00 3.0 Check on Mantri\n", + " MAHAPURA High Potential - Low Engagement 90.91 1.0 Check on Mantri\n", + " DAHEVAN Steady Performers 44.83 16.0 Check on Mantri\n", + "AMBERAOPURA(DAHEVAN) High Potential - Low Engagement 54.17 121.0 Call Mantri for Follow-up\n", + " KANCHORAPURA High Potential - Low Engagement 81.25 3.0 Check on Mantri\n", + " MOKSHI High Potential - Low Engagement 0.00 -11.0 Send Marketing Team\n", + " TUNDAV Steady Performers 85.71 1.0 Check on Mantri\n", + " BAJIPURA High Potential - Low Engagement 51.20 244.0 Call Mantri for Follow-up\n", + " AMRUTPURA High Potential - Low Engagement 100.00 0.0 Check on Mantri\n", + " AHIMA High Potential - Low Engagement 44.21 294.0 Call Mantri for Follow-up\n", + " BODKA Steady Performers 100.00 0.0 Check on Mantri\n", + " DABHASI High Potential - Low Engagement 83.67 8.0 Check on Mantri\n", + " SAIJPUR New/Developing 3.77 1814.0 Send Marketing Team\n", + " AMODAR High Potential - Low Engagement 86.36 3.0 Check on Mantri\n", + " KANDHROTI High Potential - Low Engagement 71.43 22.0 Check on Mantri\n", + " HARIPURA High Potential - Low Engagement 59.18 20.0 Check on Mantri\n", + " BHIMPURA High Potential - Low Engagement 59.02 25.0 Check on Mantri\n", + " GAMBHIRA High Potential - Low Engagement 67.99 411.0 Call Mantri for Follow-up\n", + " DAGJIPURA Steady Performers 90.91 1.0 Check on Mantri\n", + " KATHANA STATION High Potential - Low Engagement 0.00 0.0 Send Marketing Team\n", + " DHOLI Steady Performers 70.00 6.0 Check on Mantri\n", + " BALANAPURA Steady Performers 0.00 -13.0 Send Marketing Team\n", + " CHIKHODARA High Potential - Low Engagement 100.00 0.0 Check on Mantri\n", + " ASARAMA Underperforming 650.00 -11.0 Check on Mantri\n", + " CHANVADA Steady Performers 120.00 -1.0 Check on Mantri\n", + " KOTHIYAKHAD High Potential - Low Engagement 68.61 113.0 Call Mantri for Follow-up\n", + " KHEDASA High Potential - Low Engagement 5.18 476.0 Send Marketing Team\n", + " NANA KALODARA High Potential - Low Engagement 90.24 4.0 Check on Mantri\n", + " ZAKHARIYA High Potential - Low Engagement 63.33 11.0 Check on Mantri\n", + " SARSA High Potential - Low Engagement 44.24 402.0 Call Mantri for Follow-up\n", + " TRIKAMPURA High Potential - Low Engagement 44.44 5.0 Check on Mantri\n", + " SARDARPURA High Potential - Low Engagement 0.00 18.0 Send Marketing Team\n", + " POPATVAV High Potential - Low Engagement 44.57 97.0 Call Mantri for Follow-up\n", + " PIRODNAGAR High Potential - Low Engagement 100.00 0.0 Check on Mantri\n", + " BHAVANIPURA High Potential - Low Engagement 75.60 81.0 Call Mantri for Follow-up\n", + " NAPAD VANTO High Potential - Low Engagement 66.67 9.0 Check on Mantri\n", + " LASUNDRA Steady Performers 100.00 0.0 Check on Mantri\n", + " GOPALPURA High Potential - Low Engagement 88.89 1.0 Check on Mantri\n", + " SAMBHOI High Potential - Low Engagement 100.00 0.0 Check on Mantri\n", + " VIRSAD New/Developing 35.25 687.0 Call Mantri for Follow-up\n", + " RATANPURA High Potential - Low Engagement 73.68 5.0 Check on Mantri\n", + " GOPALPURA High Potential - Low Engagement 0.00 0.0 Send Marketing Team\n", + " MARGAKUI High Potential - Low Engagement 66.36 108.0 Call Mantri for Follow-up\n", + " KHADANA Steady Performers 80.00 1.0 Check on Mantri\n", + " JOGAN High Potential - Low Engagement 60.26 304.0 Call Mantri for Follow-up\n", + " JAKHLA High Potential - Low Engagement 0.00 0.0 Send Marketing Team\n", + " HAMIDPURA High Potential - Low Engagement 0.00 NaN Send Marketing Team\n", + " KHANKUVA High Potential - Low Engagement 77.50 9.0 Check on Mantri\n", + " VAKANER Steady Performers 100.00 0.0 Check on Mantri\n", + " SHANKARPURA Steady Performers 64.29 5.0 Check on Mantri\n", + " LAXMIPURA Steady Performers 100.00 0.0 Check on Mantri\n", + " DODHIYA PURA High Potential - Low Engagement 0.00 3.0 Send Marketing Team\n", + " RASULABAD High Potential - Low Engagement 83.33 3.0 Check on Mantri\n", + " KALAMASAR New/Developing 37.67 1317.0 Call Mantri for Follow-up\n", + " KALAMSAR New/Developing 39.80 1204.0 Call Mantri for Follow-up\n", + " ASODAR High Potential - Low Engagement 85.71 2.0 Check on Mantri\n", + " VISHNOLI High Potential - Low Engagement 53.33 70.0 Call Mantri for Follow-up\n", + " BORIYA High Potential - Low Engagement 74.29 54.0 Call Mantri for Follow-up\n", + " FATEPURA High Potential - Low Engagement 0.00 0.0 Send Marketing Team\n", + " GORVA High Potential - Low Engagement 93.33 1.0 Check on Mantri\n", + " RANJITNAGAR High Potential - Low Engagement 90.91 1.0 Check on Mantri\n", + " NEJA Steady Performers 100.00 0.0 Check on Mantri\n", + " MITHAPURA Steady Performers 0.00 -19.0 Send Marketing Team\n", + " INDRAD Steady Performers 0.00 -5.0 Send Marketing Team\n", + " KHAKHANPUR High Potential - Low Engagement 69.23 8.0 Check on Mantri\n", + " KANODA High Potential - Low Engagement 0.00 0.0 Send Marketing Team\n", + " KOTAMBI High Potential - Low Engagement 100.00 0.0 Check on Mantri\n", + " RASNOL New/Developing 22.65 915.0 Call Mantri for Follow-up\n", + " JITPURA High Potential - Low Engagement 62.50 3.0 Check on Mantri\n", + " BHATPURA High Potential - Low Engagement 66.67 2.0 Check on Mantri\n" + ] + } + ], + "source": [ + "import pandas as pd\n", + "import numpy as np\n", + "from datetime import datetime, timedelta\n", + "from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor\n", + "from sklearn.model_selection import train_test_split\n", + "from sklearn.preprocessing import StandardScaler\n", + "from sklearn.cluster import KMeans\n", + "from sklearn.metrics import classification_report, mean_squared_error\n", + "import warnings\n", + "warnings.filterwarnings('ignore')\n", + "\n", + "def enhanced_analyze_sales_data(data1, data2):\n", + " \"\"\"\n", + " Enhanced analysis with ML components for better predictions\n", + " \"\"\"\n", + " \n", + " data1['Date'] = pd.to_datetime(data1['Date'])\n", + " data2['Date'] = pd.to_datetime(data2['Date'])\n", + " \n", + " # Calculate basic metrics\n", + " data1['Conversion_Rate'] = (data1['Contact_In_Group'] / data1['Sabhasad'] * 100).round(2)\n", + " data1['Conversion_Rate'] = data1['Conversion_Rate'].replace([np.inf, -np.inf], 0).fillna(0)\n", + " data1['Untapped_Potential'] = data1['Sabhasad'] - data1['Contact_In_Group']\n", + " data1['Sales_Per_Contact'] = (data1['Total_L'] / data1['Contact_In_Group']).round(2)\n", + " data1['Sales_Per_Contact'] = data1['Sales_Per_Contact'].replace([np.inf, -np.inf], 0).fillna(0)\n", + " \n", + " # Analyze recent sales\n", + " recent_sales = data2.groupby('Village').agg({\n", + " 'Total_L': ['sum', 'count'],\n", + " 'Date': 'max'\n", + " }).reset_index()\n", + " \n", + " recent_sales.columns = ['Village', 'Recent_Sales_L', 'Recent_Customers', 'Last_Sale_Date']\n", + " recent_sales['Days_Since_Last_Sale'] = (datetime.now() - recent_sales['Last_Sale_Date']).dt.days\n", + " \n", + " # Merge data\n", + " analysis_df = data1.merge(recent_sales, on='Village', how='left')\n", + " analysis_df['Recent_Sales_L'] = analysis_df['Recent_Sales_L'].fillna(0)\n", + " analysis_df['Recent_Customers'] = analysis_df['Recent_Customers'].fillna(0)\n", + " analysis_df['Days_Since_Last_Sale'] = analysis_df['Days_Since_Last_Sale'].fillna(999)\n", + " \n", + " # ML Component 1: Village Clustering for Segmentation\n", + " analysis_df = apply_village_clustering(analysis_df)\n", + " \n", + " # ML Component 2: Predict Sales Potential\n", + " analysis_df = predict_sales_potential(analysis_df)\n", + " \n", + " # ML Component 3: Action Recommendation Classifier\n", + " analysis_df = predict_recommended_actions(analysis_df)\n", + " \n", + " # Generate recommendations based on ML predictions\n", + " recommendations = generate_ml_recommendations(analysis_df)\n", + " \n", + " return recommendations, analysis_df\n", + "\n", + "def apply_village_clustering(analysis_df):\n", + " \"\"\"\n", + " Use K-Means clustering to segment villages into groups\n", + " \"\"\"\n", + " # Prepare features for clustering\n", + " cluster_features = analysis_df[[\n", + " 'Conversion_Rate', 'Untapped_Potential', 'Sales_Per_Contact', \n", + " 'Recent_Sales_L', 'Days_Since_Last_Sale'\n", + " ]].fillna(0)\n", + " \n", + " # Standardize features\n", + " scaler = StandardScaler()\n", + " scaled_features = scaler.fit_transform(cluster_features)\n", + " \n", + " # Apply K-Means clustering\n", + " kmeans = KMeans(n_clusters=4, random_state=42, n_init=10)\n", + " clusters = kmeans.fit_predict(scaled_features)\n", + " \n", + " # Add clusters to dataframe\n", + " analysis_df['Cluster'] = clusters\n", + " \n", + " # Name the clusters based on characteristics\n", + " cluster_names = {\n", + " 0: 'High Potential - Low Engagement',\n", + " 1: 'Steady Performers', \n", + " 2: 'Underperforming',\n", + " 3: 'New/Developing'\n", + " }\n", + " \n", + " analysis_df['Segment'] = analysis_df['Cluster'].map(cluster_names)\n", + " \n", + " return analysis_df\n", + "\n", + "def predict_sales_potential(analysis_df):\n", + " \"\"\"\n", + " Predict sales potential for each village using Random Forest\n", + " \"\"\"\n", + " # Prepare features for prediction\n", + " prediction_features = analysis_df[[\n", + " 'Sabhasad', 'Contact_In_Group', 'Conversion_Rate', \n", + " 'Untapped_Potential', 'Recent_Sales_L', 'Days_Since_Last_Sale'\n", + " ]].fillna(0)\n", + " \n", + " # Target variable: Total_L (current sales)\n", + " target = analysis_df['Total_L'].fillna(0)\n", + " \n", + " # Only train if we have enough data\n", + " if len(prediction_features) > 10:\n", + " # Split data\n", + " X_train, X_test, y_train, y_test = train_test_split(\n", + " prediction_features, target, test_size=0.2, random_state=42\n", + " )\n", + " \n", + " # Train model\n", + " model = RandomForestRegressor(n_estimators=100, random_state=42)\n", + " model.fit(X_train, y_train)\n", + " \n", + " # Make predictions\n", + " predictions = model.predict(prediction_features)\n", + " \n", + " # Calculate feature importance\n", + " feature_importance = pd.DataFrame({\n", + " 'feature': prediction_features.columns,\n", + " 'importance': model.feature_importances_\n", + " }).sort_values('importance', ascending=False)\n", + " \n", + " # Add predictions to dataframe\n", + " analysis_df['Predicted_Sales'] = predictions\n", + " analysis_df['Sales_Gap'] = analysis_df['Predicted_Sales'] - analysis_df['Total_L']\n", + " else:\n", + " # Fallback if not enough data\n", + " analysis_df['Predicted_Sales'] = analysis_df['Total_L']\n", + " analysis_df['Sales_Gap'] = 0\n", + " \n", + " return analysis_df\n", + "\n", + "def predict_recommended_actions(analysis_df):\n", + " \"\"\"\n", + " Use ML to predict the best action for each village\n", + " \"\"\"\n", + " # Define actions based on rules (for training data)\n", + " analysis_df['Action_Label'] = np.where(\n", + " analysis_df['Conversion_Rate'] < 20, 'Send Marketing Team',\n", + " np.where(\n", + " analysis_df['Untapped_Potential'] > 30, 'Call Mantri for Follow-up',\n", + " np.where(\n", + " analysis_df['Days_Since_Last_Sale'] > 30, 'Check on Mantri',\n", + " np.where(\n", + " analysis_df['Sales_Per_Contact'] > 10, 'Provide More Stock',\n", + " 'Regular Follow-up'\n", + " )\n", + " )\n", + " )\n", + " )\n", + " \n", + " # Prepare features for classification\n", + " classification_features = analysis_df[[\n", + " 'Conversion_Rate', 'Untapped_Potential', 'Sales_Per_Contact',\n", + " 'Recent_Sales_L', 'Days_Since_Last_Sale', 'Sales_Gap'\n", + " ]].fillna(0)\n", + " \n", + " # Target variable: Action_Label\n", + " target = analysis_df['Action_Label']\n", + " \n", + " # Only train if we have enough data\n", + " if len(classification_features) > 10 and len(target.unique()) > 1:\n", + " # Split data\n", + " X_train, X_test, y_train, y_test = train_test_split(\n", + " classification_features, target, test_size=0.2, random_state=42, stratify=target\n", + " )\n", + " \n", + " # Train classifier\n", + " clf = RandomForestClassifier(n_estimators=100, random_state=42)\n", + " clf.fit(X_train, y_train)\n", + " \n", + " # Make predictions\n", + " predictions = clf.predict(classification_features)\n", + " prediction_proba = clf.predict_proba(classification_features)\n", + " \n", + " # Add predictions to dataframe\n", + " analysis_df['ML_Recommended_Action'] = predictions\n", + " analysis_df['Action_Confidence'] = np.max(prediction_proba, axis=1)\n", + " else:\n", + " # Fallback to rule-based if not enough data\n", + " analysis_df['ML_Recommended_Action'] = analysis_df['Action_Label']\n", + " analysis_df['Action_Confidence'] = 1.0\n", + " \n", + " return analysis_df\n", + "\n", + "def generate_ml_recommendations(analysis_df):\n", + " \"\"\"\n", + " Generate recommendations based on ML predictions\n", + " \"\"\"\n", + " recommendations = []\n", + " \n", + " for _, row in analysis_df.iterrows():\n", + " village = row['Village']\n", + " mantri = row['Mantri_Name']\n", + " mobile = row['Mantri_Mobile']\n", + " taluka = row['Taluka']\n", + " district = row['District']\n", + " segment = row['Segment']\n", + " action = row['ML_Recommended_Action']\n", + " confidence = row['Action_Confidence']\n", + " \n", + " # Generate reason based on ML prediction\n", + " if action == 'Send Marketing Team':\n", + " reason = f\"ML predicts marketing team needed (Confidence: {confidence:.2f}). Segment: {segment}\"\n", + " priority = 'High'\n", + " elif action == 'Call Mantri for Follow-up':\n", + " reason = f\"ML predicts mantri follow-up needed (Confidence: {confidence:.2f}). Segment: {segment}\"\n", + " priority = 'High'\n", + " elif action == 'Check on Mantri':\n", + " reason = f\"ML suggests checking on mantri (Confidence: {confidence:.2f}). Segment: {segment}\"\n", + " priority = 'Medium'\n", + " elif action == 'Provide More Stock':\n", + " reason = f\"ML predicts stock increase needed (Confidence: {confidence:.2f}). Segment: {segment}\"\n", + " priority = 'Medium'\n", + " else:\n", + " reason = f\"ML recommends regular follow-up (Confidence: {confidence:.2f}). Segment: {segment}\"\n", + " priority = 'Low'\n", + " \n", + " recommendations.append({\n", + " 'Village': village,\n", + " 'Taluka': taluka,\n", + " 'District': district,\n", + " 'Mantri': mantri,\n", + " 'Mobile': mobile,\n", + " 'Action': action,\n", + " 'Reason': reason,\n", + " 'Priority': priority,\n", + " 'Confidence': confidence,\n", + " 'Segment': segment,\n", + " 'Sales_Gap': row.get('Sales_Gap', 0)\n", + " })\n", + " \n", + " return pd.DataFrame(recommendations)\n", + "\n", + "def generate_ml_mantri_messages(recommendations):\n", + " \"\"\"\n", + " Generate personalized messages based on ML recommendations\n", + " \"\"\"\n", + " messages = []\n", + " \n", + " for _, row in recommendations.iterrows():\n", + " if row['Action'] == 'Send Marketing Team':\n", + " message = f\"\"\"\n", + "Namaste {row['Mantri']} Ji!\n", + "\n", + "Our AI system has identified that your village {row['Village']} has high potential for growth. \n", + "We're sending our marketing team to conduct demo sessions and help you reach more customers.\n", + "\n", + "Based on our analysis:\n", + "- Segment: {row['Segment']}\n", + "- Confidence: {row['Confidence']*100:.1f}%\n", + "\n", + "Please prepare for their visit and notify potential customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\"\"\"\n", + " elif row['Action'] == 'Call Mantri for Follow-up':\n", + " message = f\"\"\"\n", + "Namaste {row['Mantri']} Ji!\n", + "\n", + "Our AI analysis shows significant untapped potential in {row['Village']}. \n", + "We recommend focusing on follow-up with these customers:\n", + "\n", + "- Segment: {row['Segment']}\n", + "- Confidence: {row['Confidence']*100:.1f}%\n", + "\n", + "A special commission offer is available for your next 10 customers.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\"\"\"\n", + " elif row['Action'] == 'Check on Mantri':\n", + " message = f\"\"\"\n", + "Namaste {row['Mantri']} Ji!\n", + "\n", + "Our system shows reduced activity in {row['Village']}. \n", + "Is everything alright? Do you need any support from our team?\n", + "\n", + "- Segment: {row['Segment']}\n", + "- Confidence: {row['Confidence']*100:.1f}%\n", + "\n", + "Please let us know how we can help.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\"\"\"\n", + " elif row['Action'] == 'Provide More Stock':\n", + " message = f\"\"\"\n", + "Namaste {row['Mantri']} Ji!\n", + "\n", + "Great news! Our AI predicts increased demand in {row['Village']}. \n", + "Would you like us to send additional stock?\n", + "\n", + "- Segment: {row['Segment']}\n", + "- Confidence: {row['Confidence']*100:.1f}%\n", + "- Predicted Sales Gap: {row['Sales_Gap']:.1f}L\n", + "\n", + "Please confirm your additional requirements.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\"\"\"\n", + " else:\n", + " message = f\"\"\"\n", + "Namaste {row['Mantri']} Ji!\n", + "\n", + "Our system shows steady performance in {row['Village']}. \n", + "Keep up the good work!\n", + "\n", + "- Segment: {row['Segment']}\n", + "- Confidence: {row['Confidence']*100:.1f}%\n", + "\n", + "As always, let us know if you need any support.\n", + "\n", + "Dhanyavaad,\n", + "Calcium Supplement Team\n", + "\"\"\"\n", + " \n", + " messages.append({\n", + " 'Mantri': row['Mantri'],\n", + " 'Mobile': row['Mobile'],\n", + " 'Village': row['Village'],\n", + " 'Action': row['Action'],\n", + " 'Message': message,\n", + " 'Priority': row['Priority'],\n", + " 'Confidence': row['Confidence']\n", + " })\n", + " \n", + " return pd.DataFrame(messages)\n", + "\n", + "# Example usage\n", + "def main():\n", + " # Sample data\n", + " data2=pd.read_excel(\"sampletesting.xlsx\",sheet_name=\"Sheet1\")\n", + " data1=pd.read_excel(\"sampletesting.xlsx\",sheet_name=\"Sheet2\")\n", + " \n", + " # Generate ML-enhanced recommendations\n", + " recommendations, analysis = enhanced_analyze_sales_data(data1, data2)\n", + " \n", + " print(\"ML-ENHANCED RECOMMENDATIONS:\")\n", + " print(recommendations.sort_values('Confidence', ascending=False).to_string(index=False))\n", + " \n", + " # Generate ML-based messages\n", + " ml_messages = generate_ml_mantri_messages(recommendations)\n", + " \n", + " print(\"\\nML-BASED MANTRI MESSAGES:\")\n", + " for _, msg in ml_messages.iterrows():\n", + " print(f\"\\nTo: {msg['Mantri']} ({msg['Mobile']}) - {msg['Village']}\")\n", + " print(f\"Action: {msg['Action']} (Confidence: {msg['Confidence']:.2f})\")\n", + " print(f\"Message: {msg['Message']}\")\n", + " \n", + " # Show village segments\n", + " print(\"\\nVILLAGE SEGMENTS:\")\n", + " segments = analysis[['Village', 'Segment', 'Conversion_Rate', 'Untapped_Potential', 'ML_Recommended_Action']]\n", + " print(segments.to_string(index=False))\n", + " \n", + " return recommendations, ml_messages, analysis\n", + "\n", + "if __name__ == \"__main__\":\n", + " recommendations, ml_messages, analysis = main()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4b79bd1d", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.0" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/OLD/Chatbot.py b/OLD/Chatbot.py new file mode 100644 index 0000000000000000000000000000000000000000..ee79158c9d1f7128428ed17959b4ad2d864e6949 --- /dev/null +++ b/OLD/Chatbot.py @@ -0,0 +1,52 @@ +import streamlit as st +import pandas as pd +import requests + +# ---- Load sample data ---- +@st.cache_data +def load_data(): + return pd.read_csv("data.csv") + +df = load_data() + +# ---- Sidebar ---- +st.sidebar.title("Controls") +task = st.sidebar.selectbox("Choose task", ["Chat with Bot (via n8n)", "Analyze Data"]) + +# ---- Main UI ---- +st.title("๐Ÿ’ฌ Data Analysis Assistant (Streamlit + n8n + Ollama)") + +if task == "Analyze Data": + st.subheader("๐Ÿ“Š Sales Data") + st.dataframe(df) + + st.write("### Total Sales:") + st.metric("๐Ÿ’ต Amount", f"${df['amount'].sum():,.2f}") + + top_customer = df.groupby("customer")["amount"].sum().idxmax() + st.write(f"**Top Customer:** {top_customer}") + +elif task == "Chat with Bot (via n8n)": + st.subheader("๐Ÿค– Ask Questions") + user_input = st.text_area("Your question:", placeholder="e.g. Who spent the most?") + + if st.button("Ask Bot") and user_input: + # Send request to n8n webhook + payload = { + "question": user_input, + "data": df.to_dict(orient="records") + } + + try: + response = requests.post( + "http://localhost:5678/webhook/chatbot", + json=payload, + timeout=60 + ) + if response.ok: + answer = response.json().get("answer", response.text) + st.success(answer) + else: + st.error(f"n8n Error: {response.status_code}") + except Exception as e: + st.error(f"Connection failed: {e}") \ No newline at end of file diff --git a/OLD/Main.py b/OLD/Main.py new file mode 100644 index 0000000000000000000000000000000000000000..3993addf6eb573e7ce6ed04dc0b57f957ef909e3 --- /dev/null +++ b/OLD/Main.py @@ -0,0 +1,244 @@ +import pandas as pd +import numpy as np +from datetime import datetime, timedelta + +def analyze_sales_data(data1, data2): + """ + Analyze sales data to identify targets for mantri communication and village focus + """ + + # Convert date column if needed + data1['Date'] = pd.to_datetime(data1['Date']) + + # Clean and preprocess data2 + data2['Date'] = pd.to_datetime(data2['Date']) + + # Calculate key metrics from Data1 (village level) + data1['Conversion_Rate'] = (data1['Contact_In_Group'] / data1['Sabhasad'] * 100).round(2) + data1['Conversion_Rate'] = data1['Conversion_Rate'].replace([np.inf, -np.inf], 0).fillna(0) + data1['Untapped_Potential'] = data1['Sabhasad'] - data1['Contact_In_Group'] + data1['Sales_Per_Contact'] = (data1['Total_L'] / data1['Contact_In_Group']).round(2) + data1['Sales_Per_Contact'] = data1['Sales_Per_Contact'].replace([np.inf, -np.inf], 0).fillna(0) + + # Calculate priority score for villages + data1['Priority_Score'] = ( + (data1['Untapped_Potential'] / data1['Untapped_Potential'].max() * 50) + + ((100 - data1['Conversion_Rate']) / 100 * 50) + ).round(2) + + # Analyze recent sales from Data2 (customer level) + # Since we don't have customer contact info, we'll analyze at village level + recent_sales = data2.groupby('Village').agg({ + 'Total_L': ['sum', 'count'], + 'Date': 'max' + }).reset_index() + + # Flatten the column names + recent_sales.columns = ['Village', 'Recent_Sales_L', 'Recent_Customers', 'Last_Sale_Date'] + + # Calculate days since last sale + recent_sales['Days_Since_Last_Sale'] = (datetime.now() - recent_sales['Last_Sale_Date']).dt.days + + # Merge with Data1 + analysis_df = data1.merge(recent_sales, on='Village', how='left') + analysis_df['Recent_Sales_L'] = analysis_df['Recent_Sales_L'].fillna(0) + analysis_df['Recent_Customers'] = analysis_df['Recent_Customers'].fillna(0) + analysis_df['Days_Since_Last_Sale'] = analysis_df['Days_Since_Last_Sale'].fillna(999) + + # Generate recommendations for mantris + recommendations = [] + + for _, row in analysis_df.iterrows(): + village = row['Village'] + mantri = row['Mantri_Name'] + mobile = row['Mantri_Mobile'] + taluka = row['Taluka'] + district = row['District'] + + # Recommendation logic + if row['Conversion_Rate'] < 20: + recommendations.append({ + 'Village': village, + 'Taluka': taluka, + 'District': district, + 'Mantri': mantri, + 'Mobile': mobile, + 'Action': 'Send Marketing Team', + 'Reason': f'Low conversion rate ({row["Conversion_Rate"]:.1f}%) - Only {row["Contact_In_Group"]} of {row["Sabhasad"]} sabhasad contacted', + 'Priority': 'High', + 'Score': row['Priority_Score'] + }) + elif row['Untapped_Potential'] > 30: + recommendations.append({ + 'Village': village, + 'Taluka': taluka, + 'District': district, + 'Mantri': mantri, + 'Mobile': mobile, + 'Action': 'Call Mantri for Follow-up', + 'Reason': f'High untapped potential ({row["Untapped_Potential"]} sabhasad not contacted)', + 'Priority': 'High', + 'Score': row['Priority_Score'] + }) + elif row['Days_Since_Last_Sale'] > 30: + recommendations.append({ + 'Village': village, + 'Taluka': taluka, + 'District': district, + 'Mantri': mantri, + 'Mobile': mobile, + 'Action': 'Check on Mantri', + 'Reason': f'No recent sales ({row["Days_Since_Last_Sale"]} days since last sale)', + 'Priority': 'Medium', + 'Score': row['Priority_Score'] + }) + elif row['Sales_Per_Contact'] > 10: + recommendations.append({ + 'Village': village, + 'Taluka': taluka, + 'District': district, + 'Mantri': mantri, + 'Mobile': mobile, + 'Action': 'Provide More Stock', + 'Reason': f'High sales per contact ({row["Sales_Per_Contact"]}L per contact)', + 'Priority': 'Medium', + 'Score': row['Priority_Score'] + }) + else: + recommendations.append({ + 'Village': village, + 'Taluka': taluka, + 'District': district, + 'Mantri': mantri, + 'Mobile': mobile, + 'Action': 'Regular Follow-up', + 'Reason': 'Steady performance - maintain relationship', + 'Priority': 'Low', + 'Score': row['Priority_Score'] + }) + + return pd.DataFrame(recommendations), analysis_df + +def generate_mantri_messages(recommendations): + """ + Generate personalized WhatsApp messages for mantris based on recommendations + """ + messages = [] + + for _, row in recommendations.iterrows(): + if row['Action'] == 'Send Marketing Team': + message = f""" +Namaste {row['Mantri']} Ji! + +Aapke kshetra {row['Village']} mein humare calcium supplement ki conversion rate kam hai. +Humari marketing team aapke yaha demo dene aayegi. +Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein. + +Dhanyavaad, +Calcium Supplement Team +""" + elif row['Action'] == 'Call Mantri for Follow-up': + message = f""" +Namaste {row['Mantri']} Ji! + +Aapke kshetra {row['Village']} mein bahut se aise farmers hain jo abhi tak humare product se anabhijit hain. +Kripya unse sampark karein aur unhe product ke fayde batayein. +Aapke liye special commission offer hai agle 10 customers ke liye. + +Dhanyavaad, +Calcium Supplement Team +""" + elif row['Action'] == 'Check on Mantri': + message = f""" +Namaste {row['Mantri']} Ji! + +Humne dekha ki aapke kshetra {row['Village']} mein kuch samay se sales nahi hue hain. +Kya koi samasya hai? Kya hum aapki kisi tarah madad kar sakte hain? + +Kripya hame batayein. + +Dhanyavaad, +Calcium Supplement Team +""" + elif row['Action'] == 'Provide More Stock': + message = f""" +Namaste {row['Mantri']} Ji! + +Badhai ho! Aapke kshetra {row['Village']} mein humare product ki demand badh rahi hai. +Kya aapko aur stock ki zaroorat hai? Hum jald se jald aapko extra stock bhej denge. + +Dhanyavaad, +Calcium Supplement Team +""" + else: + message = f""" +Namaste {row['Mantri']} Ji! + +Aapke kshetra {row['Village']} mein humare product ki sales theek chal rahi hain. +Kripya aise hi continue rakhein aur koi bhi sujhav ho toh hame batayein. + +Dhanyavaad, +Calcium Supplement Team +""" + + messages.append({ + 'Mantri': row['Mantri'], + 'Mobile': row['Mobile'], + 'Village': row['Village'], + 'Action': row['Action'], + 'Message': message, + 'Priority': row['Priority'] + }) + + return pd.DataFrame(messages) + +def identify_demo_locations(analysis_df, top_n=5): + """ + Identify the best locations for demos based on various factors + """ + # Calculate a demo score based on multiple factors + analysis_df['Demo_Score'] = ( + (analysis_df['Untapped_Potential'] / analysis_df['Untapped_Potential'].max() * 40) + + ((100 - analysis_df['Conversion_Rate']) / 100 * 30) + + (analysis_df['Recent_Sales_L'] / analysis_df['Recent_Sales_L'].max() * 30) + ).round(2) + + # Get top locations for demos + demo_locations = analysis_df.nlargest(top_n, 'Demo_Score')[ + ['Village', 'Taluka', 'District', 'Mantri_Name', 'Mantri_Mobile', + 'Conversion_Rate', 'Untapped_Potential', 'Demo_Score'] + ] + + return demo_locations + +# Example usage with sample data structure +def main(): + # Sample data based on your new structure + data2=pd.read_excel("sampletesting.xlsx",sheet_name="Sheet1") + data1=pd.read_excel("sampletesting.xlsx",sheet_name="Sheet2") + + # Generate recommendations + recommendations, analysis = analyze_sales_data(data1, data2) + + print("RECOMMENDED ACTIONS:") + print(recommendations.sort_values('Score', ascending=False).to_string(index=False)) + + # Generate messages for mantris + mantri_messages = generate_mantri_messages(recommendations) + + print("\nMANTRI MESSAGES:") + for _, msg in mantri_messages.iterrows(): + print(f"\nTo: {msg['Mantri']} ({msg['Mobile']}) - {msg['Village']}") + print(f"Action: {msg['Action']}") + print(f"Message: {msg['Message']}") + + # Identify demo locations + demo_locations = identify_demo_locations(analysis) + + print("\nTOP DEMO LOCATIONS:") + print(demo_locations.to_string(index=False)) + + return recommendations, mantri_messages, demo_locations + +if __name__ == "__main__": + recommendations, mantri_messages, demo_locations = main() \ No newline at end of file diff --git a/OLD/__dbmlsystem.py b/OLD/__dbmlsystem.py new file mode 100644 index 0000000000000000000000000000000000000000..eb1391a8ac56b997fe25ee9e345f529f107cdc69 --- /dev/null +++ b/OLD/__dbmlsystem.py @@ -0,0 +1,596 @@ +import streamlit as st +import pandas as pd +import numpy as np +import plotly.express as px +import plotly.graph_objects as go +from datetime import datetime, timedelta +from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor +from sklearn.model_selection import train_test_split +from sklearn.preprocessing import StandardScaler +from sklearn.cluster import KMeans +import warnings +warnings.filterwarnings('ignore') + +# Set page configuration +st.set_page_config( + page_title="Calcium Supplement Sales Automation", + page_icon="๐Ÿ„", + layout="wide", + initial_sidebar_state="expanded" +) + +# App title +st.title("๐Ÿ„ Calcium Supplement Sales Automation Dashboard") +st.markdown("---") + +# Your exact ML functions +def enhanced_analyze_sales_data(data1, data2): + """ + Enhanced analysis with ML components for better predictions + """ + + data1['Date'] = pd.to_datetime(data1['Date']) + data2['Date'] = pd.to_datetime(data2['Date']) + + # Calculate basic metrics + data1['Conversion_Rate'] = (data1['Contact_In_Group'] / data1['Sabhasad'] * 100).round(2) + data1['Conversion_Rate'] = data1['Conversion_Rate'].replace([np.inf, -np.inf], 0).fillna(0) + data1['Untapped_Potential'] = data1['Sabhasad'] - data1['Contact_In_Group'] + data1['Sales_Per_Contact'] = (data1['Total_L'] / data1['Contact_In_Group']).round(2) + data1['Sales_Per_Contact'] = data1['Sales_Per_Contact'].replace([np.inf, -np.inf], 0).fillna(0) + + # Analyze recent sales + recent_sales = data2.groupby('Village').agg({ + 'Total_L': ['sum', 'count'], + 'Date': 'max' + }).reset_index() + + recent_sales.columns = ['Village', 'Recent_Sales_L', 'Recent_Customers', 'Last_Sale_Date'] + recent_sales['Days_Since_Last_Sale'] = (datetime.now() - recent_sales['Last_Sale_Date']).dt.days + + # Merge data + analysis_df = data1.merge(recent_sales, on='Village', how='left') + analysis_df['Recent_Sales_L'] = analysis_df['Recent_Sales_L'].fillna(0) + analysis_df['Recent_Customers'] = analysis_df['Recent_Customers'].fillna(0) + analysis_df['Days_Since_Last_Sale'] = analysis_df['Days_Since_Last_Sale'].fillna(999) + + # ML Component 1: Village Clustering for Segmentation + analysis_df = apply_village_clustering(analysis_df) + + # ML Component 2: Predict Sales Potential + analysis_df = predict_sales_potential(analysis_df) + + # ML Component 3: Action Recommendation Classifier + analysis_df = predict_recommended_actions(analysis_df) + + # Generate recommendations based on ML predictions + recommendations = generate_ml_recommendations(analysis_df) + + return recommendations, analysis_df + +def apply_village_clustering(analysis_df): + """ + Use K-Means clustering to segment villages into groups + """ + # Prepare features for clustering + cluster_features = analysis_df[[ + 'Conversion_Rate', 'Untapped_Potential', 'Sales_Per_Contact', + 'Recent_Sales_L', 'Days_Since_Last_Sale' + ]].fillna(0) + + # Standardize features + scaler = StandardScaler() + scaled_features = scaler.fit_transform(cluster_features) + + # Apply K-Means clustering + kmeans = KMeans(n_clusters=4, random_state=42, n_init=10) + clusters = kmeans.fit_predict(scaled_features) + + # Add clusters to dataframe + analysis_df['Cluster'] = clusters + + # Name the clusters based on characteristics + cluster_names = { + 0: 'High Potential - Low Engagement', + 1: 'Steady Performers', + 2: 'Underperforming', + 3: 'New/Developing' + } + + analysis_df['Segment'] = analysis_df['Cluster'].map(cluster_names) + + return analysis_df + +def predict_sales_potential(analysis_df): + """ + Predict sales potential for each village using Random Forest + """ + # Prepare features for prediction + prediction_features = analysis_df[[ + 'Sabhasad', 'Contact_In_Group', 'Conversion_Rate', + 'Untapped_Potential', 'Recent_Sales_L', 'Days_Since_Last_Sale' + ]].fillna(0) + + # Target variable: Total_L (current sales) + target = analysis_df['Total_L'].fillna(0) + + # Only train if we have enough data + if len(prediction_features) > 10: + # Split data + X_train, X_test, y_train, y_test = train_test_split( + prediction_features, target, test_size=0.2, random_state=42 + ) + + # Train model + model = RandomForestRegressor(n_estimators=100, random_state=42) + model.fit(X_train, y_train) + + # Make predictions + predictions = model.predict(prediction_features) + + # Calculate feature importance + feature_importance = pd.DataFrame({ + 'feature': prediction_features.columns, + 'importance': model.feature_importances_ + }).sort_values('importance', ascending=False) + + # Add predictions to dataframe + analysis_df['Predicted_Sales'] = predictions + analysis_df['Sales_Gap'] = analysis_df['Predicted_Sales'] - analysis_df['Total_L'] + else: + # Fallback if not enough data + analysis_df['Predicted_Sales'] = analysis_df['Total_L'] + analysis_df['Sales_Gap'] = 0 + + return analysis_df + +def predict_recommended_actions(analysis_df): + """ + Use ML to predict the best action for each village + """ + # Define actions based on rules (for training data) + analysis_df['Action_Label'] = np.where( + analysis_df['Conversion_Rate'] < 20, 'Send Marketing Team', + np.where( + analysis_df['Untapped_Potential'] > 30, 'Call Mantri for Follow-up', + np.where( + analysis_df['Days_Since_Last_Sale'] > 30, 'Check on Mantri', + np.where( + analysis_df['Sales_Per_Contact'] > 10, 'Provide More Stock', + 'Regular Follow-up' + ) + ) + ) + ) + + # Prepare features for classification + classification_features = analysis_df[[ + 'Conversion_Rate', 'Untapped_Potential', 'Sales_Per_Contact', + 'Recent_Sales_L', 'Days_Since_Last_Sale', 'Sales_Gap' + ]].fillna(0) + + # Target variable: Action_Label + target = analysis_df['Action_Label'] + + # Only train if we have enough data + if len(classification_features) > 10 and len(target.unique()) > 1: + # Split data + X_train, X_test, y_train, y_test = train_test_split( + classification_features, target, test_size=0.2, random_state=42, stratify=target + ) + + # Train classifier + clf = RandomForestClassifier(n_estimators=100, random_state=42) + clf.fit(X_train, y_train) + + # Make predictions + predictions = clf.predict(classification_features) + prediction_proba = clf.predict_proba(classification_features) + + # Add predictions to dataframe + analysis_df['ML_Recommended_Action'] = predictions + analysis_df['Action_Confidence'] = np.max(prediction_proba, axis=1) + else: + # Fallback to rule-based if not enough data + analysis_df['ML_Recommended_Action'] = analysis_df['Action_Label'] + analysis_df['Action_Confidence'] = 1.0 + + return analysis_df + +def generate_ml_recommendations(analysis_df): + """ + Generate recommendations based on ML predictions + """ + recommendations = [] + + for _, row in analysis_df.iterrows(): + village = row['Village'] + mantri = row['Mantri_Name'] + mobile = row['Mantri_Mobile'] + taluka = row['Taluka'] + district = row['District'] + segment = row['Segment'] + action = row['ML_Recommended_Action'] + confidence = row['Action_Confidence'] + + # Generate reason based on ML prediction + if action == 'Send Marketing Team': + reason = f"ML predicts marketing team needed (Confidence: {confidence:.2f}). Segment: {segment}" + priority = 'High' + elif action == 'Call Mantri for Follow-up': + reason = f"ML predicts mantri follow-up needed (Confidence: {confidence:.2f}). Segment: {segment}" + priority = 'High' + elif action == 'Check on Mantri': + reason = f"ML suggests checking on mantri (Confidence: {confidence:.2f}). Segment: {segment}" + priority = 'Medium' + elif action == 'Provide More Stock': + reason = f"ML predicts stock increase needed (Confidence: {confidence:.2f}). Segment: {segment}" + priority = 'Medium' + else: + reason = f"ML recommends regular follow-up (Confidence: {confidence:.2f}). Segment: {segment}" + priority = 'Low' + + recommendations.append({ + 'Village': village, + 'Taluka': taluka, + 'District': district, + 'Mantri': mantri, + 'Mobile': mobile, + 'Action': action, + 'Reason': reason, + 'Priority': priority, + 'Confidence': confidence, + 'Segment': segment, + 'Sales_Gap': row.get('Sales_Gap', 0) + }) + + return pd.DataFrame(recommendations) + +def generate_ml_mantri_messages(recommendations): + """ + Generate personalized messages based on ML recommendations + """ + messages = [] + + for _, row in recommendations.iterrows(): + if row['Action'] == 'Send Marketing Team': + message = f""" +Namaste {row['Mantri']} Ji! + +Our AI system has identified that your village {row['Village']} has high potential for growth. +We're sending our marketing team to conduct demo sessions and help you reach more customers. + +Based on our analysis: +- Segment: {row['Segment']} +- Confidence: {row['Confidence']*100:.1f}% + +Please prepare for their visit and notify potential customers. + +Dhanyavaad, +Calcium Supplement Team +""" + elif row['Action'] == 'Call Mantri for Follow-up': + message = f""" +Namaste {row['Mantri']} Ji! + +Our AI analysis shows significant untapped potential in {row['Village']}. +We recommend focusing on follow-up with these customers: + +- Segment: {row['Segment']} +- Confidence: {row['Confidence']*100:.1f}% + +A special commission offer is available for your next 10 customers. + +Dhanyavaad, +Calcium Supplement Team +""" + elif row['Action'] == 'Check on Mantri': + message = f""" +Namaste {row['Mantri']} Ji! + +Our system shows reduced activity in {row['Village']}. +Is everything alright? Do you need any support from our team? + +- Segment: {row['Segment']} +- Confidence: {row['Confidence']*100:.1f}% + +Please let us know how we can help. + +Dhanyavaad, +Calcium Supplement Team +""" + elif row['Action'] == 'Provide More Stock': + message = f""" +Namaste {row['Mantri']} Ji! + +Great news! Our AI predicts increased demand in {row['Village']}. +Would you like us to send additional stock? + +- Segment: {row['Segment']} +- Confidence: {row['Confidence']*100:.1f}% +- Predicted Sales Gap: {row['Sales_Gap']:.1f}L + +Please confirm your additional requirements. + +Dhanyavaad, +Calcium Supplement Team +""" + else: + message = f""" +Namaste {row['Mantri']} Ji! + +Our system shows steady performance in {row['Village']}. +Keep up the good work! + +- Segment: {row['Segment']} +- Confidence: {row['Confidence']*100:.1f}% + +As always, let us know if you need any support. + +Dhanyavaad, +Calcium Supplement Team +""" + + messages.append({ + 'Mantri': row['Mantri'], + 'Mobile': row['Mobile'], + 'Village': row['Village'], + 'Action': row['Action'], + 'Message': message, + 'Priority': row['Priority'], + 'Confidence': row['Confidence'] + }) + + return pd.DataFrame(messages) + +# Visualization functions +def plot_village_performance(analysis_df): + """Create performance visualization for villages""" + fig = px.scatter(analysis_df, + x='Conversion_Rate', + y='Untapped_Potential', + size='Total_L', + color='Segment', + hover_name='Village', + title='Village Performance Analysis', + labels={'Conversion_Rate': 'Conversion Rate (%)', + 'Untapped_Potential': 'Untapped Potential'}) + + fig.update_layout(height=500) + return fig + +def plot_sales_trends(analysis_df): + """Create sales trends visualization""" + fig = px.bar(analysis_df, + x='Village', + y='Total_L', + color='Segment', + title='Total Sales by Village', + labels={'Total_L': 'Total Sales (L)', 'Village': 'Village'}) + + fig.update_layout(height=400, xaxis_tickangle=-45) + return fig + +def plot_priority_matrix(recommendations): + """Create priority matrix visualization""" + priority_order = {'High': 3, 'Medium': 2, 'Low': 1} + recommendations['Priority_Value'] = recommendations['Priority'].map(priority_order) + + fig = px.treemap(recommendations, + path=['Priority', 'Village'], + values='Priority_Value', + color='Priority_Value', + color_continuous_scale='RdYlGn_r', + title='Action Priority Matrix') + + fig.update_layout(height=500) + return fig + +def display_key_metrics(analysis_df): + """Display key performance metrics""" + col1, col2, col3, col4 = st.columns(4) + + with col1: + st.metric("Total Villages", len(analysis_df)) + with col2: + avg_conversion = analysis_df['Conversion_Rate'].mean() + st.metric("Avg Conversion Rate", f"{avg_conversion:.1f}%") + with col3: + total_untapped = analysis_df['Untapped_Potential'].sum() + st.metric("Total Untapped Potential", f"{total_untapped}") + with col4: + total_sales = analysis_df['Total_L'].sum() + st.metric("Total Sales (L)", f"{total_sales}") + +# Initialize session state +if 'data1' not in st.session_state: + st.session_state.data1 = None +if 'data2' not in st.session_state: + st.session_state.data2 = None +if 'analysis_df' not in st.session_state: + st.session_state.analysis_df = None +if 'recommendations' not in st.session_state: + st.session_state.recommendations = None +if 'ml_messages' not in st.session_state: + st.session_state.ml_messages = None + +# Sidebar +with st.sidebar: + st.header("Data Input") + + # File uploaders + st.subheader("Upload Village Data (Data1)") + uploaded_data1 = st.file_uploader("CSV or Excel file", type=["csv", "xlsx"], key="data1") + + st.subheader("Upload Sales Data (Data2)") + uploaded_data2 = st.file_uploader("CSV or Excel file", type=["csv", "xlsx"], key="data2") + + if st.button("Load Data and Run ML Analysis"): + if uploaded_data1 and uploaded_data2: + try: + # Load data + if uploaded_data1.name.endswith('.csv'): + data1 = pd.read_csv(uploaded_data1) + else: + data1 = pd.read_excel(uploaded_data1) + + if uploaded_data2.name.endswith('.csv'): + data2 = pd.read_csv(uploaded_data2) + else: + data2 = pd.read_excel(uploaded_data2) + + # Store in session state + st.session_state.data1 = data1 + st.session_state.data2 = data2 + + # Run ML analysis + with st.spinner("Running ML analysis..."): + recommendations, analysis_df = enhanced_analyze_sales_data(data1, data2) + st.session_state.analysis_df = analysis_df + st.session_state.recommendations = recommendations + + ml_messages = generate_ml_mantri_messages(recommendations) + st.session_state.ml_messages = ml_messages + + st.success("ML analysis completed successfully!") + + except Exception as e: + st.error(f"Error processing data: {str(e)}") + else: + st.error("Please upload both files to proceed") + +# Main content +if st.session_state.analysis_df is not None and st.session_state.recommendations is not None: + # Display dashboard + tab1, tab2, tab3, tab4 = st.tabs(["Dashboard", "Village Analysis", "Actions & Messages", "Team Dispatch"]) + + with tab1: + st.header("ML-Powered Performance Dashboard") + display_key_metrics(st.session_state.analysis_df) + + col1, col2 = st.columns(2) + + with col1: + st.plotly_chart(plot_village_performance(st.session_state.analysis_df), use_container_width=True) + + with col2: + st.plotly_chart(plot_priority_matrix(st.session_state.recommendations), use_container_width=True) + + st.plotly_chart(plot_sales_trends(st.session_state.analysis_df), use_container_width=True) + + with tab2: + st.header("Village Analysis with ML Segmentation") + + selected_village = st.selectbox("Select Village", st.session_state.analysis_df['Village'].unique()) + village_data = st.session_state.analysis_df[st.session_state.analysis_df['Village'] == selected_village].iloc[0] + + col1, col2 = st.columns(2) + + with col1: + st.subheader("Village Details") + st.write(f"**Village:** {village_data['Village']}") + st.write(f"**Taluka:** {village_data['Taluka']}") + st.write(f"**District:** {village_data['District']}") + st.write(f"**Mantri:** {village_data['Mantri_Name']}") + st.write(f"**Mantri Mobile:** {village_data['Mantri_Mobile']}") + st.write(f"**Segment:** {village_data.get('Segment', 'N/A')}") + st.write(f"**ML Recommended Action:** {village_data.get('ML_Recommended_Action', 'N/A')}") + st.write(f"**Action Confidence:** {village_data.get('Action_Confidence', 'N/A'):.2f}") + + with col2: + st.subheader("Performance Metrics") + st.write(f"**Sabhasad:** {village_data['Sabhasad']}") + st.write(f"**Contacted:** {village_data['Contact_In_Group']}") + st.write(f"**Conversion Rate:** {village_data['Conversion_Rate']}%") + st.write(f"**Untapped Potential:** {village_data['Untapped_Potential']}") + st.write(f"**Total Sales:** {village_data['Total_L']}L") + st.write(f"**Sales per Contact:** {village_data['Sales_Per_Contact']}L") + st.write(f"**Predicted Sales:** {village_data.get('Predicted_Sales', 'N/A'):.1f}L") + st.write(f"**Sales Gap:** {village_data.get('Sales_Gap', 'N/A'):.1f}L") + + with tab3: + st.header("ML-Based Actions & Messages") + + st.subheader("ML-Generated Recommendations") + st.dataframe(st.session_state.recommendations) + + # Download recommendations + csv_data = st.session_state.recommendations.to_csv(index=False) + st.download_button( + label="Download Recommendations as CSV", + data=csv_data, + file_name="ml_sales_recommendations.csv", + mime="text/csv" + ) + + st.subheader("Generate ML-Powered Messages") + selected_mantri = st.selectbox("Select Mantri", st.session_state.recommendations['Mantri'].unique()) + mantri_data = st.session_state.recommendations[ + st.session_state.recommendations['Mantri'] == selected_mantri].iloc[0] + + message_df = st.session_state.ml_messages[ + st.session_state.ml_messages['Mantri'] == selected_mantri] + + if not message_df.empty: + message = message_df.iloc[0]['Message'] + st.text_area("ML-Generated Message", message, height=300) + + if st.button("Send Message"): + st.success(f"Message sent to {mantri_data['Mantri']} at {mantri_data['Mobile']}") + + st.subheader("Bulk Message Sender") + if st.button("Generate All ML Messages"): + st.session_state.all_messages = st.session_state.ml_messages + + if 'all_messages' in st.session_state: + st.dataframe(st.session_state.all_messages[['Mantri', 'Village', 'Action', 'Priority', 'Confidence']]) + + if st.button("Send All ML Messages"): + progress_bar = st.progress(0) + for i, row in st.session_state.all_messages.iterrows(): + # Simulate sending message + progress_bar.progress((i + 1) / len(st.session_state.all_messages)) + st.success("All ML-powered messages sent successfully!") + + with tab4: + st.header("Marketing Team Dispatch with ML Insights") + + st.subheader("Villages Needing Team Visit (ML Identified)") + high_priority = st.session_state.recommendations[ + st.session_state.recommendations['Action'] == 'Send Marketing Team'] + + if not high_priority.empty: + for _, row in high_priority.iterrows(): + with st.expander(f"{row['Village']} - {row['Mantri']} (Confidence: {row['Confidence']:.2f})"): + st.write(f"**Reason:** {row['Reason']}") + st.write(f"**Segment:** {row['Segment']}") + st.write(f"**Sales Gap:** {row['Sales_Gap']:.1f}L") + + dispatch_date = st.date_input("Dispatch Date", key=f"date_{row['Village']}") + team_size = st.slider("Team Size", 1, 5, 2, key=f"size_{row['Village']}") + + if st.button("Schedule Dispatch", key=f"dispatch_{row['Village']}"): + st.success(f"Team dispatch scheduled for {row['Village']} on {dispatch_date}") + else: + st.info("No villages currently require immediate team dispatch based on ML analysis.") + + st.subheader("ML Performance Insights") + st.write("Based on our machine learning analysis, here are key insights:") + + # Show segment distribution + segment_counts = st.session_state.analysis_df['Segment'].value_counts() + fig = px.pie(values=segment_counts.values, names=segment_counts.index, + title="Village Segment Distribution") + st.plotly_chart(fig, use_container_width=True) + + # Show confidence distribution + fig = px.histogram(st.session_state.recommendations, x='Confidence', + title='Confidence Distribution of ML Recommendations') + st.plotly_chart(fig, use_container_width=True) + +else: + st.info("Please upload your data files using the sidebar and click 'Load Data and Run ML Analysis' to get started.") + +# Footer +st.markdown("---") +st.markdown("**ML-Powered Calcium Supplement Sales Automation System** | For internal use only") \ No newline at end of file diff --git a/OLD/sampleDashboard.py b/OLD/sampleDashboard.py new file mode 100644 index 0000000000000000000000000000000000000000..7ebbb23fa542de408f12a51bae3ef5658823afb6 --- /dev/null +++ b/OLD/sampleDashboard.py @@ -0,0 +1,350 @@ +import streamlit as st +import pandas as pd +import numpy as np +import plotly.express as px +import plotly.graph_objects as go +from datetime import datetime, timedelta +import time + +# Set page configuration +st.set_page_config( + page_title="Calcium Supplement Sales Dashboard", + page_icon="๐Ÿ„", + layout="wide", + initial_sidebar_state="expanded" +) + +# Sample data (replace with your actual data loading) +@st.cache_data +def load_data(): + # Sales data with customer information + sales_data = pd.DataFrame({ + 'Date': ['2025-06-01', '2025-06-01', '2025-06-10', '2025-06-11', '2025-06-12', + '2025-07-30', '2025-07-30', '2025-07-31', '2025-07-31', '2025-07-31'], + 'Customer': ['Gopalbhai', 'Ramprasad Khatik', 'Vikramsinh', 'Prahladbhai -Mantry', 'V S Stud Farm', + 'Hemendrabhai Parmar', 'Sundarbhai', 'Kamleshbhai Vasava -Mantry', 'Kiranbhai -Mantry', 'Kiritbhai'], + 'Village': ['Shilly', 'Rajasthan', 'Mithapura', 'Bhalod Dairy', 'Waghodia', + 'Panchdevla', 'Siyali', 'Moran', 'Talodara', 'Sindhrot'], + 'Total_L': [35.0, 400.0, 30.0, 7.0, 400.0, 50.0, 13.0, 1.0, 1.0, 30.0] + }) + + # Mantri data with village information + mantri_data = pd.DataFrame({ + 'DATE': ['2024-03-08', '2025-06-03', '2025-02-23', '2025-05-28', '2025-05-02', + '2024-09-21', '2024-10-26', '2024-03-19', '2025-01-30', '2025-07-18'], + 'VILLAGE': ['JILOD', 'MANJIPURA', 'GOTHADA', 'UNTKHARI', 'VEMAR', + 'KANODA', 'KOTAMBI', 'RASNOL', 'JITPURA', 'BHATPURA'], + 'MANTRY_NAME': ['AJAYBHAI PATEL', 'AJAYBHAI PATEL', 'AJGAR KHAN', 'AMBALAL CHAUHAN', 'AMBALAL GOHIL', + 'VINUBHAI SOLANKI', 'VISHNUBHAI', 'VITHTHALBHAI', 'YOGESHBHAI', 'YUVRAJSINH'], + 'MOBILE_NO': [7984136988, 9737910554, 9724831903, 9313860902, 9978081739, + 9998756469, 9909550170, 9924590017, 7990383811, 6353209447], + 'sabhasad': [38, 21, 3, 0, 2, 0, 14, 1183, 8, 6], + 'contact_in_group': [38.0, 16.0, 2.0, 0.0, 0.0, 0.0, 14.0, 268.0, 5.0, 4.0], + 'TOTAL_L': [99.0, 120.0, 19.0, 87.0, 32.0, 60.0, 54.0, 82.0, 25.0, 11.0] + }) + + # Convert dates to datetime + sales_data['Date'] = pd.to_datetime(sales_data['Date']) + mantri_data['DATE'] = pd.to_datetime(mantri_data['DATE'], errors='coerce') + + return sales_data, mantri_data + +# Analysis functions +def analyze_mantri_performance(mantri_data, sales_data): + mantri_data = mantri_data.copy() + + # Calculate performance metrics + mantri_data['Conversion_Rate'] = (mantri_data['contact_in_group'] / mantri_data['sabhasad'] * 100).round(2) + mantri_data['Conversion_Rate'] = mantri_data['Conversion_Rate'].replace([np.inf, -np.inf], 0).fillna(0) + mantri_data['Untapped_Potential'] = mantri_data['sabhasad'] - mantri_data['contact_in_group'] + mantri_data['Sales_Efficiency'] = (mantri_data['TOTAL_L'] / mantri_data['contact_in_group']).round(2) + mantri_data['Sales_Efficiency'] = mantri_data['Sales_Efficiency'].replace([np.inf, -np.inf], 0).fillna(0) + + # Priority score calculation + mantri_data['Priority_Score'] = ( + (mantri_data['Untapped_Potential'] / mantri_data['Untapped_Potential'].max() * 50) + + ((100 - mantri_data['Conversion_Rate']) / 100 * 50) + ).round(2) + + # Add recent sales data + recent_sales = sales_data.groupby('Village').agg({ + 'Total_L': 'sum', + 'Customer': 'count' + }).reset_index() + recent_sales.columns = ['VILLAGE', 'Recent_Sales', 'Recent_Customers'] + + mantri_data = mantri_data.merge(recent_sales, on='VILLAGE', how='left') + mantri_data['Recent_Sales'] = mantri_data['Recent_Sales'].fillna(0) + mantri_data['Recent_Customers'] = mantri_data['Recent_Customers'].fillna(0) + + return mantri_data + +def analyze_village_performance(sales_data, mantri_data): + # Group sales by village + village_sales = sales_data.groupby('Village').agg({ + 'Total_L': 'sum', + 'Customer': 'count', + 'Date': 'max' + }).reset_index() + village_sales.columns = ['Village', 'Total_Sales', 'Customer_Count', 'Last_Sale_Date'] + + # Calculate days since last sale + village_sales['Days_Since_Last_Sale'] = (datetime.now() - village_sales['Last_Sale_Date']).dt.days + + # Merge with mantri data + mantri_summary = mantri_data[['VILLAGE', 'MANTRY_NAME', 'MOBILE_NO', 'sabhasad', 'contact_in_group']] + mantri_summary.columns = ['Village', 'Mantri_Name', 'Mantri_Mobile', 'Sabhasad', 'Contacts'] + + village_performance = village_sales.merge(mantri_summary, on='Village', how='left') + + # Calculate performance metrics + village_performance['Conversion_Rate'] = (village_performance['Contacts'] / village_performance['Sabhasad'] * 100).round(2) + village_performance['Conversion_Rate'] = village_performance['Conversion_Rate'].replace([np.inf, -np.inf], 0).fillna(0) + village_performance['Untapped_Potential'] = village_performance['Sabhasad'] - village_performance['Contacts'] + + return village_performance + +# Message templates +def get_mantri_message_template(mantri_name, village, reason, performance_data): + templates = { + 'Low Conversion': f""" +Namaste {mantri_name} Ji! + +Aapke kshetra {village} mein humare calcium supplement ki conversion rate kam hai ({performance_data['Conversion_Rate']}%). +Humari marketing team aapke yaha demo dene aayegi. +Kripya taiyaari rakhein aur sabhi dudh utpadakon ko soochit karein. + +Aapke paas abhi bhi {int(performance_data['Untapped_Potential'])} aise farmers hain jo product nahi use kar rahe hain. + +Dhanyavaad, +Calcium Supplement Team +""", + 'High Potential': f""" +Namaste {mantri_name} Ji! + +Aapke kshetra {village} mein {int(performance_data['Untapped_Potential'])} aise farmers hain jo abhi tak humare product se anabhijit hain. +Kripya unse sampark karein aur unhe product ke fayde batayein. +Aapke liye special commission offer hai agle 10 naye customers ke liye. + +Dhanyavaad, +Calcium Supplement Team +""", + 'Good Performance': f""" +Namaste {mantri_name} Ji! + +Aapke kshetra {village} mein humare product ki demand badh rahi hai. +Aapki conversion rate {performance_data['Conversion_Rate']}% hai jo bahut achchi hai. + +Kripya farmers ko yaad dilaein ki pregnancy ke 3-9 mahine aur delivery ke baad calcium supplement zaroori hai. + +Dhanyavaad, +Calcium Supplement Team +""" + } + + return templates.get(reason, "Custom message based on analysis") + +# Load data +sales_data, mantri_data = load_data() +mantri_performance = analyze_mantri_performance(mantri_data, sales_data) +village_performance = analyze_village_performance(sales_data, mantri_data) + +# Streamlit app +st.title("๐Ÿ„ Calcium Supplement Sales Automation Dashboard") +st.markdown("---") + +# Sidebar +st.sidebar.header("Navigation") +section = st.sidebar.radio("Go to", ["Dashboard", "Mantri Performance", "Village Analysis", "Message Center", "Team Dispatch"]) + +# Dashboard +if section == "Dashboard": + st.header("Sales Performance Overview") + + col1, col2, col3, col4 = st.columns(4) + + with col1: + st.metric("Total Villages Covered", len(mantri_performance)) + with col2: + st.metric("Total Mantris", len(mantri_performance['MANTRY_NAME'].unique())) + with col3: + st.metric("Total Sales (Liters)", mantri_performance['TOTAL_L'].sum()) + with col4: + avg_conversion = mantri_performance['Conversion_Rate'].mean() + st.metric("Avg Conversion Rate", f"{avg_conversion:.2f}%") + + st.subheader("Top Priority Mantris") + priority_mantris = mantri_performance.nlargest(5, 'Priority_Score')[['MANTRY_NAME', 'VILLAGE', 'Conversion_Rate', 'Untapped_Potential', 'Priority_Score']] + st.dataframe(priority_mantris) + + st.subheader("Sales Distribution by Village") + fig = px.bar(mantri_performance, x='VILLAGE', y='TOTAL_L', title='Total Sales by Village') + st.plotly_chart(fig, use_container_width=True) + + st.subheader("Conversion Rate vs Untapped Potential") + fig = px.scatter(mantri_performance, x='Conversion_Rate', y='Untapped_Potential', + size='TOTAL_L', color='VILLAGE', hover_name='MANTRY_NAME', + title='Mantri Performance Analysis') + st.plotly_chart(fig, use_container_width=True) + +# Mantri Performance +elif section == "Mantri Performance": + st.header("Mantri Performance Analysis") + + selected_mantri = st.selectbox("Select Mantri", mantri_performance['MANTRY_NAME'].unique()) + mantri_data = mantri_performance[mantri_performance['MANTRY_NAME'] == selected_mantri].iloc[0] + + col1, col2, col3, col4 = st.columns(4) + + with col1: + st.metric("Mantri", mantri_data['MANTRY_NAME']) + with col2: + st.metric("Village", mantri_data['VILLAGE']) + with col3: + st.metric("Conversion Rate", f"{mantri_data['Conversion_Rate']}%") + with col4: + st.metric("Untapped Potential", int(mantri_data['Untapped_Potential'])) + + st.subheader("Mantri Details") + st.dataframe(mantri_data) + + st.subheader("Action Recommendations") + if mantri_data['Conversion_Rate'] < 20: + st.error(f"**Send Marketing Team**: Conversion rate is low ({mantri_data['Conversion_Rate']}%). Need demos and awareness campaigns.") + if mantri_data['Untapped_Potential'] > 10: + st.warning(f"**Call Mantri**: {int(mantri_data['Untapped_Potential'])} farmers still not converted. Push Mantri to contact them.") + if mantri_data['Conversion_Rate'] > 50: + st.success(f"**Expand Success**: This mantri is performing well. Consider replicating their strategies.") + +# Village Analysis +elif section == "Village Analysis": + st.header("Village Performance Analysis") + + selected_village = st.selectbox("Select Village", village_performance['Village'].unique()) + village_data = village_performance[village_performance['Village'] == selected_village].iloc[0] + + col1, col2, col3, col4 = st.columns(4) + + with col1: + st.metric("Village", village_data['Village']) + with col2: + st.metric("Mantri", village_data['Mantri_Name']) + with col3: + st.metric("Total Sales (L)", village_data['Total_Sales']) + with col4: + st.metric("Days Since Last Sale", village_data['Days_Since_Last_Sale']) + + st.subheader("Village Details") + st.dataframe(village_data) + + st.subheader("Action Recommendations") + if village_data['Days_Since_Last_Sale'] > 30: + st.error(f"**Send Marketing Team**: No sales in {village_data['Days_Since_Last_Sale']} days. Need immediate attention.") + if village_data['Conversion_Rate'] < 25: + st.warning(f"**Low Conversion**: Only {village_data['Conversion_Rate']}% of potential customers are converted.") + if village_data['Total_Sales'] > 100: + st.success(f"**High Performer**: This village has high sales volume. Consider expanding product range.") + +# Message Center +elif section == "Message Center": + st.header("Message Center") + + st.subheader("Mantri Communication") + selected_mantri = st.selectbox("Select Mantri", mantri_performance['MANTRY_NAME'].unique()) + mantri_data = mantri_performance[mantri_performance['MANTRY_NAME'] == selected_mantri].iloc[0] + + st.write(f"**Village:** {mantri_data['VILLAGE']}") + st.write(f"**Conversion Rate:** {mantri_data['Conversion_Rate']}%") + st.write(f"**Untapped Potential:** {int(mantri_data['Untapped_Potential'])} farmers") + + if mantri_data['Conversion_Rate'] < 20: + reason = "Low Conversion" + elif mantri_data['Untapped_Potential'] > 10: + reason = "High Potential" + else: + reason = "Good Performance" + + message = get_mantri_message_template( + mantri_data['MANTRY_NAME'], + mantri_data['VILLAGE'], + reason, + mantri_data + ) + + st.text_area("Generated Message", message, height=200) + + if st.button("Send to Mantri"): + st.success(f"Message sent to {mantri_data['MANTRY_NAME']} at {mantri_data['MOBILE_NO']}") + # Here you would integrate with WhatsApp API + + st.subheader("Bulk Message Sender") + st.write("Send messages to multiple mantris at once") + + options = st.multiselect("Select Mantris", mantri_performance['MANTRY_NAME'].unique()) + message_template = st.text_area("Message Template", height=100) + + if st.button("Send to Selected Mantris"): + progress_bar = st.progress(0) + for i, mantri in enumerate(options): + # Simulate sending + time.sleep(0.5) + progress_bar.progress((i + 1) / len(options)) + st.success(f"Messages sent to {len(options)} mantris") + +# Team Dispatch +elif section == "Team Dispatch": + st.header("Marketing Team Dispatch Planner") + + st.subheader("Villages Needing Immediate Attention") + + # Find villages with no recent sales or low conversion + high_priority = village_performance[ + (village_performance['Days_Since_Last_Sale'] > 30) | + (village_performance['Conversion_Rate'] < 20) + ] + + if not high_priority.empty: + for _, village in high_priority.iterrows(): + with st.expander(f"{village['Village']} (Last sale: {village['Days_Since_Last_Sale']} days ago)"): + st.write(f"**Mantri:** {village['Mantri_Name']} ({village['Mantri_Mobile']})") + st.write(f"**Conversion Rate:** {village['Conversion_Rate']}%") + st.write(f"**Recommended Action:** Conduct demo sessions and awareness campaign") + + if st.button(f"Dispatch Team to {village['Village']}", key=f"dispatch_{village['Village']}"): + st.success(f"Team dispatched to {village['Village']}. Mantri {village['Mantri_Name']} has been notified.") + else: + st.info("No villages currently require immediate team dispatch.") + + st.subheader("Create New Dispatch Plan") + + col1, col2 = st.columns(2) + + with col1: + selected_village = st.selectbox("Select Village for Dispatch", village_performance['Village'].unique()) + village_data = village_performance[village_performance['Village'] == selected_village].iloc[0] + + st.write(f"**Mantri:** {village_data['Mantri_Name']}") + st.write(f"**Last Sale:** {village_data['Days_Since_Last_Sale']} days ago") + st.write(f"**Conversion Rate:** {village_data['Conversion_Rate']}%") + + with col2: + dispatch_date = st.date_input("Dispatch Date", datetime.now() + timedelta(days=1)) + team_size = st.slider("Team Size", 1, 5, 2) + duration = st.selectbox("Duration", ["1 day", "2 days", "3 days", "1 week"]) + + objectives = st.text_area("Objectives", "Conduct demo sessions, educate farmers about benefits, collect feedback") + + if st.button("Schedule Dispatch"): + st.success(f"Dispatch to {selected_village} scheduled for {dispatch_date}") + st.json({ + "village": selected_village, + "mantri": village_data['Mantri_Name'], + "date": str(dispatch_date), + "team_size": team_size, + "duration": duration, + "objectives": objectives + }) + +# Footer +st.markdown("---") +st.markdown("**Calcium Supplement Sales Automation System** | For internal use only") \ No newline at end of file diff --git a/__pycache__/analytics.cpython-310.pyc b/__pycache__/analytics.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2d9ff2d8197b3168a3b3afcf3d300019d030e185 Binary files /dev/null and b/__pycache__/analytics.cpython-310.pyc differ diff --git a/__pycache__/analytics.cpython-313.pyc b/__pycache__/analytics.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4b04eb3818b4de485c73db21c3ec2f8cf47d53cd Binary files /dev/null and b/__pycache__/analytics.cpython-313.pyc differ diff --git a/__pycache__/config.cpython-313.pyc b/__pycache__/config.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7d309f238ced1f63bda35fc6a965f65fd5b14d4b Binary files /dev/null and b/__pycache__/config.cpython-313.pyc differ diff --git a/__pycache__/data_processor.cpython-310.pyc b/__pycache__/data_processor.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f2c7d3fb4a0dbbe2f15094d1c35fddde1ab29525 Binary files /dev/null and b/__pycache__/data_processor.cpython-310.pyc differ diff --git a/__pycache__/data_processor.cpython-313.pyc b/__pycache__/data_processor.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0679ee8c30e3d2f6a9f7ef4bf3d801a9f96f0cbb Binary files /dev/null and b/__pycache__/data_processor.cpython-313.pyc differ diff --git a/__pycache__/database.cpython-310.pyc b/__pycache__/database.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4e08bbefef337bba639a52286de182c06603bf75 Binary files /dev/null and b/__pycache__/database.cpython-310.pyc differ diff --git a/__pycache__/database.cpython-313.pyc b/__pycache__/database.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a0783f6527ff8a830580b90d43537049d148ab37 Binary files /dev/null and b/__pycache__/database.cpython-313.pyc differ diff --git a/__pycache__/database_schema.cpython-313.pyc b/__pycache__/database_schema.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c9affef730ccf0616f347ef8ac1b8d9168656a67 Binary files /dev/null and b/__pycache__/database_schema.cpython-313.pyc differ diff --git a/__pycache__/excel_exporter.cpython-313.pyc b/__pycache__/excel_exporter.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..939fde42ecb4db4cfa3ebb96ee7690bc301b921b Binary files /dev/null and b/__pycache__/excel_exporter.cpython-313.pyc differ diff --git a/__pycache__/main.cpython-313.pyc b/__pycache__/main.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..abfa46559eb95f2169b02fa9c0a79205993aef57 Binary files /dev/null and b/__pycache__/main.cpython-313.pyc differ diff --git a/__pycache__/sales_manager.cpython-313.pyc b/__pycache__/sales_manager.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..badccd0fa0665a2b33a5704ec59a0d3fda25a1d1 Binary files /dev/null and b/__pycache__/sales_manager.cpython-313.pyc differ diff --git a/__pycache__/whatsapp_manager.cpython-310.pyc b/__pycache__/whatsapp_manager.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9459b44abf885fbd0dc53b02633653a1ebd84bab Binary files /dev/null and b/__pycache__/whatsapp_manager.cpython-310.pyc differ diff --git a/analytics.py b/analytics.py new file mode 100644 index 0000000000000000000000000000000000000000..1777430237cb1bea1ad0728af4180adb4bd89302 --- /dev/null +++ b/analytics.py @@ -0,0 +1,192 @@ +import pandas as pd +import numpy as np +from datetime import datetime, timedelta + +class Analytics: + def __init__(self, db_manager): + self.db = db_manager + + def get_sales_summary(self): + """Get comprehensive sales summary statistics""" + try: + sales_df = self.db.get_dataframe('sales') + payments_df = self.db.get_dataframe('payments') + + if sales_df.empty: + return { + 'total_sales': 0, + 'total_payments': 0, + 'pending_amount': 0, + 'total_transactions': 0, + 'avg_sale_value': 0 + } + + total_sales = sales_df['total_amount'].sum() + total_payments = payments_df['amount'].sum() if not payments_df.empty else 0 + pending_amount = total_sales - total_payments + + return { + 'total_sales': total_sales, + 'total_payments': total_payments, + 'pending_amount': pending_amount, + 'total_transactions': len(sales_df), + 'avg_sale_value': sales_df['total_amount'].mean() + } + except Exception as e: + return { + 'total_sales': 0, + 'total_payments': 0, + 'pending_amount': 0, + 'total_transactions': 0, + 'avg_sale_value': 0 + } + + def get_customer_analysis(self): + """Analyze customer data""" + try: + customers_df = self.db.get_dataframe('customers') + sales_df = self.db.get_dataframe('sales') + + if customers_df.empty: + return { + 'total_customers': 0, + 'village_distribution': {}, + 'top_customers': {} + } + + # Customer distribution by village + village_stats = customers_df['village'].value_counts().head(10) + + # Top customers by spending + if not sales_df.empty: + customer_sales = sales_df.groupby('customer_id')['total_amount'].sum() + top_customers = customer_sales.nlargest(10) + else: + top_customers = pd.Series(dtype=float) + + return { + 'total_customers': len(customers_df), + 'village_distribution': village_stats.to_dict(), + 'top_customers': top_customers.to_dict() + } + except Exception as e: + return { + 'total_customers': 0, + 'village_distribution': {}, + 'top_customers': {} + } + + def get_payment_analysis(self): + """Analyze payment data""" + try: + pending_payments = self.db.get_pending_payments() + payments_df = self.db.get_dataframe('payments') + + if pending_payments.empty: + return { + 'total_pending': 0, + 'customer_pending': {}, + 'payment_methods': {} + } + + # Group by customer + customer_pending = pending_payments.groupby('customer_id')['pending_amount'].sum() + + # Payment method distribution + if not payments_df.empty: + payment_methods = payments_df['payment_method'].value_counts() + else: + payment_methods = pd.Series(dtype=object) + + return { + 'total_pending': pending_payments['pending_amount'].sum(), + 'customer_pending': customer_pending.to_dict(), + 'payment_methods': payment_methods.to_dict() + } + except Exception as e: + return { + 'total_pending': 0, + 'customer_pending': {}, + 'payment_methods': {} + } + + def get_demo_conversion_rates(self): + """Calculate demo conversion rates""" + try: + demos_df = self.db.get_demo_conversions() + + if demos_df.empty: + return { + 'total_demos': 0, + 'converted_demos': 0, + 'conversion_rate': 0 + } + + total_demos = len(demos_df) + converted_demos = len(demos_df[demos_df['conversion_status'] == 'Converted']) + conversion_rate = (converted_demos / total_demos) * 100 if total_demos > 0 else 0 + + return { + 'total_demos': total_demos, + 'converted_demos': converted_demos, + 'conversion_rate': conversion_rate + } + except Exception as e: + return { + 'total_demos': 0, + 'converted_demos': 0, + 'conversion_rate': 0 + } + + def get_sales_trend(self): + """Get sales trend data for charts""" + try: + sales_df = self.db.get_dataframe('sales') + + if sales_df.empty: + return pd.DataFrame() + + # Convert sale_date to datetime if it's not + sales_df['sale_date'] = pd.to_datetime(sales_df['sale_date']) + + # Group by date + daily_sales = sales_df.groupby('sale_date')['total_amount'].sum().reset_index() + daily_sales = daily_sales.sort_values('sale_date') + + return daily_sales + except Exception as e: + return pd.DataFrame() + + def get_payment_distribution(self): + """Get payment distribution for charts""" + try: + payments_df = self.db.get_dataframe('payments') + + if payments_df.empty: + return pd.DataFrame() + + payment_dist = payments_df.groupby('payment_method')['amount'].sum().reset_index() + return payment_dist + except Exception as e: + return pd.DataFrame() + + def get_product_performance(self): + """Get product performance data""" + try: + sale_items_df = self.db.get_dataframe('sale_items', ''' + SELECT si.*, p.product_name + FROM sale_items si + JOIN products p ON si.product_id = p.product_id + ''') + + if sale_items_df.empty: + return pd.DataFrame() + + product_perf = sale_items_df.groupby('product_name').agg({ + 'quantity': 'sum', + 'amount': 'sum' + }).reset_index() + + return product_perf + except Exception as e: + return pd.DataFrame() \ No newline at end of file diff --git a/automation.py b/automation.py new file mode 100644 index 0000000000000000000000000000000000000000..fe2170816851ee31236113fb6fc685104b1c21e6 --- /dev/null +++ b/automation.py @@ -0,0 +1,88 @@ +# enhanced_automation.py +import schedule +import time +import smtplib +from email.mime.text import MimeText +from email.mime.multipart import MimeMultipart +from datetime import datetime, timedelta + +class AutomationManager: + def __init__(self, db_manager, whatsapp_manager): + self.db = db_manager + self.whatsapp = whatsapp_manager + + def daily_payment_reminders(self): + """Send payment reminders for overdue payments""" + overdue_payments = self.db.get_pending_payments() + + for _, payment in overdue_payments.iterrows(): + if payment['pending_amount'] > 0: + customer = self.db.get_dataframe('customers', + f"SELECT * FROM customers WHERE customer_id = {payment['customer_id']}") + + if not customer.empty: + customer_data = customer.iloc[0] + message = f"""Hello {customer_data['name']}, + +This is a friendly reminder that your payment of โ‚น{payment['pending_amount']:,.2f} for invoice {payment['invoice_no']} is overdue. + +Please make the payment at your earliest convenience. + +Thank you, +Sales Team""" + + self.whatsapp.send_message(customer_data['mobile'], message) + + def demo_followups(self): + """Send follow-up messages for demos""" + upcoming_followups = self.db.get_dataframe('demos', ''' + SELECT d.*, c.name as customer_name, c.mobile, p.product_name + FROM demos d + JOIN customers c ON d.customer_id = c.customer_id + JOIN products p ON d.product_id = p.product_id + WHERE d.follow_up_date = date('now') + AND d.conversion_status = 'Not Converted' + ''') + + for _, demo in upcoming_followups.iterrows(): + message = f"""Hello {demo['customer_name']}, + +Following up on your demo of {demo['product_name']} on {demo['demo_date']}. + +How was your experience? Would you like to place an order or need another demo? + +Best regards, +Sales Team""" + + self.whatsapp.send_message(demo['mobile'], message) + + def weekly_performance_report(self): + """Generate and send weekly performance report""" + analytics = Analytics(self.db) + + sales_summary = analytics.get_sales_summary() + demo_stats = analytics.get_demo_conversion_rates() + payment_analysis = analytics.get_payment_analysis() + + report = f""" + ๐Ÿ“Š WEEKLY PERFORMANCE REPORT + ---------------------------- + Total Sales: โ‚น{sales_summary.get('total_sales', 0):,.2f} + Pending Payments: โ‚น{sales_summary.get('pending_amount', 0):,.2f} + Demo Conversion Rate: {demo_stats.get('conversion_rate', 0):.1f}% + Total Customers: {analytics.get_customer_analysis().get('total_customers', 0)} + + Generated on: {datetime.now().strftime('%Y-%m-%d %H:%M')} + """ + + # You can extend this to email the report + self._save_report(report) + return report + + def _save_report(self, report): + """Save report to file""" + filename = f"reports/weekly_report_{datetime.now().strftime('%Y%m%d')}.txt" + os.makedirs('reports', exist_ok=True) + + with open(filename, 'w') as f: + f.write(report) \ No newline at end of file diff --git a/components/__init__.py b/components/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/components/__pycache__/__init__.cpython-310.pyc b/components/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f5f41ed5ae67059b711cdc1c7e9e2b374dbbdf9b Binary files /dev/null and b/components/__pycache__/__init__.cpython-310.pyc differ diff --git a/components/__pycache__/database_status.cpython-310.pyc b/components/__pycache__/database_status.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ea3223bdbda1ee3d5f47635396f4e47268faa4aa Binary files /dev/null and b/components/__pycache__/database_status.cpython-310.pyc differ diff --git a/components/database_status.py b/components/database_status.py new file mode 100644 index 0000000000000000000000000000000000000000..282babdcf2d7367c9b7831481d209bb8e9c6a4ad --- /dev/null +++ b/components/database_status.py @@ -0,0 +1,26 @@ +# components/database_status.py +import streamlit as st + +def show_database_status(db): + """Show current database status""" + st.sidebar.markdown("---") + st.sidebar.subheader("๐Ÿ“Š Database Status") + + try: + if db: + customers_count = len(db.get_dataframe('customers')) + sales_count = len(db.get_dataframe('sales')) + distributors_count = len(db.get_dataframe('distributors')) + payments_count = len(db.get_dataframe('payments')) + products_count = len(db.get_dataframe('products')) + + st.sidebar.metric("๐Ÿ‘ฅ Customers", customers_count) + st.sidebar.metric("๐Ÿ’ฐ Sales", sales_count) + st.sidebar.metric("๐Ÿค Distributors", distributors_count) + st.sidebar.metric("๐Ÿ’ณ Payments", payments_count) + st.sidebar.metric("๐Ÿ“ฆ Products", products_count) + else: + st.sidebar.error("Database not available") + + except Exception as e: + st.sidebar.error("Database connection issue") \ No newline at end of file diff --git a/data/AMBERAVPURA ENGLISH SABHASAD LIST.xlsx b/data/AMBERAVPURA ENGLISH SABHASAD LIST.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..b67dde7a89bb8afa0c9b1f9fbff58dc1c40ea398 Binary files /dev/null and b/data/AMBERAVPURA ENGLISH SABHASAD LIST.xlsx differ diff --git a/data/APRIL 24-25.xlsx b/data/APRIL 24-25.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..2be3dd3283be32dc3d5ad6b50e1008006704f81f Binary files /dev/null and b/data/APRIL 24-25.xlsx differ diff --git a/data/AUGUST 24-25.xlsx b/data/AUGUST 24-25.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..27a7fa8104b373ffb58d98d369b6538fe06ec561 Binary files /dev/null and b/data/AUGUST 24-25.xlsx differ diff --git a/data/JULY 24-25.xlsx b/data/JULY 24-25.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..9b1483bfa9d6af3a9a86f0424c6415a3bdc7ec30 Binary files /dev/null and b/data/JULY 24-25.xlsx differ diff --git a/data/JUNE 24-25.xlsx b/data/JUNE 24-25.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..60549d697c8adc88543e83f717e99b4014bbee9e Binary files /dev/null and b/data/JUNE 24-25.xlsx differ diff --git a/data/MAY 24-25.xlsx b/data/MAY 24-25.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..770f379ac5d13d57789732ffc02ac19ee620c728 Binary files /dev/null and b/data/MAY 24-25.xlsx differ diff --git a/data/SEPTEMBER 24-25.xlsx b/data/SEPTEMBER 24-25.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..8bacb1f5ab5a830564a2fd6287d6b6c6481d9919 Binary files /dev/null and b/data/SEPTEMBER 24-25.xlsx differ diff --git a/data/amiyad.xlsx b/data/amiyad.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..060604e28c1357cc2fdf645f67bb025157285d59 Binary files /dev/null and b/data/amiyad.xlsx differ diff --git a/data/dharkhuniya.xlsx b/data/dharkhuniya.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..2211443dce96e6ed554a75245672fd44b99c0da2 Binary files /dev/null and b/data/dharkhuniya.xlsx differ diff --git a/data/distributors.xlsx b/data/distributors.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..e232f990783a1d4303588db9a855f4df5cbbac63 Binary files /dev/null and b/data/distributors.xlsx differ diff --git a/data/kamrol.xlsx b/data/kamrol.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..9840b37927803ddfe7af99cdc4415033ec49453e Binary files /dev/null and b/data/kamrol.xlsx differ diff --git a/data/sandha.xlsx b/data/sandha.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..7a46a5aca8bc0ccdc5ec6808232cbfdc23159d4c Binary files /dev/null and b/data/sandha.xlsx differ diff --git a/data/vishnoli.xlsx b/data/vishnoli.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..635c88534e29d384c5640a78769496b8eeb934de Binary files /dev/null and b/data/vishnoli.xlsx differ diff --git a/data_processor.py b/data_processor.py new file mode 100644 index 0000000000000000000000000000000000000000..3cea47cf416716f466682237944610f71f3515e8 --- /dev/null +++ b/data_processor.py @@ -0,0 +1,710 @@ +import pandas as pd +import numpy as np +import os +import re +from datetime import datetime +import logging + +# Set up logging +logging.basicConfig(level=logging.INFO) +logger = logging.getLogger(__name__) + +class DataProcessor: + def __init__(self, db_manager): + self.db = db_manager + self.product_mapping = self._create_product_mapping() + + def _create_product_mapping(self): + """Create product mapping from database""" + try: + products_df = self.db.get_dataframe('products') + return {row['product_name'].upper(): row['product_id'] for _, row in products_df.iterrows()} + except Exception as e: + logger.error(f"Error creating product mapping: {e}") + return {} + + def process_excel_file(self, file_path): + """Enhanced file processing with all data types""" + try: + file_name = os.path.basename(file_path) + print(f"๐Ÿš€ Processing file: {file_name}") + + excel_file = pd.ExcelFile(file_path) + processed_sheets = 0 + + for sheet_name in excel_file.sheet_names: + df = pd.read_excel(file_path, sheet_name=sheet_name) + df_clean = self._clean_dataframe(df) + + print(f"\n๐Ÿ“Š Sheet: {sheet_name}") + print(f" Columns: {df_clean.columns.tolist()}") + + # Check all types with priority + is_payment = self._is_payment_sheet(df_clean) + is_sales = self._is_sales_sheet(df_clean) + is_customer = self._is_customer_sheet(df_clean) + is_distributor = self._is_distributor_sheet(df_clean) + + print(f" Detection - Payment: {is_payment}, Sales: {is_sales}, Customer: {is_customer}, Distributor: {is_distributor}") + + processed = False + if is_payment: + processed = self.process_payment_sheet(df_clean, file_name, sheet_name) + elif is_sales: + processed = self.process_sales_sheet(df_clean, file_name, sheet_name) + elif is_distributor: + processed = self.process_distributor_sheet(df_clean, file_name, sheet_name) + elif is_customer: + processed = self.process_customer_sheet(df_clean, file_name, sheet_name) + + if processed: + processed_sheets += 1 + print(f" โœ… Successfully processed as detected type") + else: + print(f" โŒ Failed to process") + + print(f"\n๐ŸŽ‰ File processing complete: {processed_sheets}/{len(excel_file.sheet_names)} sheets processed") + return processed_sheets > 0 + + except Exception as e: + print(f"๐Ÿ’ฅ Error processing file {file_path}: {e}") + return False + + def _clean_dataframe(self, df): + """Clean and prepare dataframe for processing""" + # Remove completely empty rows and columns + df = df.dropna(how='all').dropna(axis=1, how='all') + + # Reset index + df = df.reset_index(drop=True) + + # Convert column names to string and clean them + df.columns = [str(col).strip().upper() for col in df.columns] + + return df + + def _is_sales_sheet(self, df): + """Check if sheet contains sales data""" + required_columns = ['INVOICE', 'CUSTOMER', 'PRODUCT', 'QUANTITY', 'AMOUNT'] + existing_columns = [col for col in df.columns if any(req in col for req in required_columns)] + return len(existing_columns) >= 3 + + def _is_customer_sheet(self, df): + """Check if sheet contains customer data""" + required_columns = ['CUSTOMER', 'NAME', 'MOBILE', 'VILLAGE'] + existing_columns = [col for col in df.columns if any(req in col for req in required_columns)] + return len(existing_columns) >= 2 + + def _is_distributor_sheet(self, df): + """Check if sheet contains distributor data""" + required_columns = ['DISTRIBUTOR', 'MANTRI', 'SABHASAD'] + existing_columns = [col for col in df.columns if any(req in col for req in required_columns)] + return len(existing_columns) >= 2 + + def process_sales_sheet(self, df, file_name, sheet_name): + """Process sales data from sheet""" + try: + processed_rows = 0 + + for index, row in df.iterrows(): + try: + # Skip header rows and empty rows + if self._is_header_row(row) or pd.isna(row.iloc[0]): + continue + + # Extract sales data (adjust column indices based on your Excel structure) + invoice_no = str(row.iloc[0]) if len(row) > 0 else f"INV_{datetime.now().strftime('%Y%m%d%H%M%S')}_{index}" + customer_name = str(row.iloc[1]) if len(row) > 1 else "Unknown Customer" + product_name = str(row.iloc[2]) if len(row) > 2 else "Unknown Product" + quantity = self._safe_float(row.iloc[3]) if len(row) > 3 else 0 + amount = self._safe_float(row.iloc[4]) if len(row) > 4 else 0 + + # Get or create customer + customer_id = self._get_or_create_customer(customer_name, "", "", "", "") + + # Get product ID + product_id = self._get_product_id(product_name) + + if customer_id and product_id and quantity > 0: + # Create sale + sale_date = datetime.now().date() + sale_items = [{ + 'product_id': product_id, + 'quantity': quantity, + 'rate': amount / quantity if quantity > 0 else 0 + }] + + self.db.add_sale(invoice_no, customer_id, sale_date, sale_items) + processed_rows += 1 + + except Exception as e: + logger.warning(f"Error processing row {index} in sales sheet: {e}") + continue + + logger.info(f"Processed {processed_rows} sales from {sheet_name}") + return processed_rows > 0 + + except Exception as e: + logger.error(f"Error processing sales sheet: {e}") + return False + + def process_customer_sheet(self, df, file_name, sheet_name): + """Process customer data from sheet with duplicate handling""" + try: + processed_rows = 0 + duplicate_rows = 0 + error_rows = 0 + + print(f"๐Ÿ”„ Processing customer sheet: {sheet_name} with {len(df)} rows") + + for index, row in df.iterrows(): + try: + # Skip header rows and empty rows + if self._is_header_row(row) or pd.isna(row.iloc[0]): + continue + + # Extract customer data + customer_code = str(row.iloc[0]) if len(row) > 0 and pd.notna(row.iloc[0]) else None + name = str(row.iloc[1]) if len(row) > 1 and pd.notna(row.iloc[1]) else "Unknown" + mobile = str(row.iloc[2]) if len(row) > 2 and pd.notna(row.iloc[2]) else "" + + # Extract location - adjust indices based on your Excel structure + village = str(row.iloc[3]) if len(row) > 3 and pd.notna(row.iloc[3]) else "" + taluka = str(row.iloc[4]) if len(row) > 4 and pd.notna(row.iloc[4]) else "" + district = str(row.iloc[5]) if len(row) > 5 and pd.notna(row.iloc[5]) else "" + + # If village is combined with name, split them + if not village and "(" in name: + name_parts = name.split("(") + if len(name_parts) > 1: + name = name_parts[0].strip() + village = name_parts[1].replace(")", "").strip() + + # Skip if no name + if not name or name == "Unknown": + continue + + # Add customer to database (method now handles duplicates) + customer_id = self.db.add_customer(name, mobile, village, taluka, district, customer_code) + + if customer_id and customer_id != -1: + processed_rows += 1 + if processed_rows % 50 == 0: # Progress update + print(f"๐Ÿ“Š Processed {processed_rows} customers...") + else: + duplicate_rows += 1 + + except Exception as e: + error_rows += 1 + if error_rows <= 5: # Only log first few errors + print(f"โŒ Error in row {index}: {e}") + continue + + print(f"๐ŸŽ‰ Customer processing complete: {processed_rows} added, {duplicate_rows} duplicates, {error_rows} errors") + return processed_rows > 0 + + except Exception as e: + print(f"๐Ÿ’ฅ Error processing customer sheet: {e}") + return False + + def process_distributor_sheet(self, df, file_name, sheet_name): + """Process distributor data from sheet""" + try: + processed_rows = 0 + + # Clean the dataframe - convert column names to consistent format + df.columns = [str(col).strip().upper() for col in df.columns] + print(f"DEBUG: Processing distributor sheet with columns: {df.columns.tolist()}") + + for index, row in df.iterrows(): + try: + # Skip header rows and empty rows + if self._is_header_row(row) or pd.isna(row.iloc[0]): + print(f"DEBUG: Skipping row {index} - header or empty") + continue + + print(f"DEBUG: Processing row {index}") + + # Extract distributor data based on YOUR ACTUAL COLUMNS + # Map your Excel columns to database fields + name = self._extract_distributor_name(row) # We'll use Village + Taluka as name + village = self._safe_get(row, 'Village', 1) + taluka = self._safe_get(row, 'Taluka', 2) + district = self._safe_get(row, 'District', 3) + mantri_name = self._safe_get(row, 'Mantri_Name', 4) + mantri_mobile = self._safe_get(row, 'Mantri_Mobile', 5) + sabhasad_count = self._safe_get_int(row, 'Sabhasad', 6) + contact_in_group = self._safe_get_int(row, 'Contact_In_Group', 7) + + print(f"DEBUG: Extracted - Village: {village}, Taluka: {taluka}, Mantri: {mantri_name}") + + # Validate we have essential data + if not village or not taluka: + print(f"DEBUG: Skipping - missing village or taluka") + continue + + # Create distributor name from village + taluka + if not name: + name = f"{village} - {taluka}" + + # Add distributor to database with ALL fields + self.db.execute_query(''' + INSERT OR REPLACE INTO distributors + (name, village, taluka, district, mantri_name, mantri_mobile, sabhasad_count, contact_in_group) + VALUES (?, ?, ?, ?, ?, ?, ?, ?) + ''', (name, village, taluka, district, mantri_name, mantri_mobile, sabhasad_count, contact_in_group)) + + processed_rows += 1 + print(f"DEBUG: Successfully added distributor: {name}") + + except Exception as e: + logger.warning(f"Error processing row {index} in distributor sheet: {e}") + continue + + logger.info(f"Processed {processed_rows} distributors from {sheet_name}") + return processed_rows > 0 + + except Exception as e: + logger.error(f"Error processing distributor sheet: {e}") + return False + + def _extract_distributor_name(self, row): + """Extract distributor name from village and taluka""" + village = self._safe_get(row, 'Village', 1) + taluka = self._safe_get(row, 'Taluka', 2) + + if village and taluka: + return f"{village} - {taluka}" + elif village: + return village + elif taluka: + return taluka + else: + return "Unknown Distributor" + + def _safe_get(self, row, column_name, default_index): + """Safely get value from row by column name or index""" + try: + # Try by column name first + if column_name in row.index: + value = row[column_name] + if pd.isna(value): + return "" + return str(value).strip() + + # Fallback to index + if len(row) > default_index: + value = row.iloc[default_index] + if pd.isna(value): + return "" + return str(value).strip() + + return "" + except Exception: + return "" + + def _safe_get_int(self, row, column_name, default_index): + """Safely get integer value from row""" + try: + str_value = self._safe_get(row, column_name, default_index) + if str_value and str_value.strip(): + return int(float(str_value)) # Handle both int and float strings + return 0 + except (ValueError, TypeError): + return 0 + + def _is_header_row(self, row): + """Check if row is a header row - updated for your data""" + if len(row) == 0: + return True + + first_value = str(row.iloc[0]) if pd.notna(row.iloc[0]) else "" + first_value_upper = first_value.upper() + + # Header indicators for YOUR data + header_indicators = [ + 'DATE', 'VILLAGE', 'TALUKA', 'DISTRICT', 'MANTRI', + 'SABHASAD', 'CONTACT', 'TOTAL', 'SR', 'NO', 'NAME' + ] + + # If first value contains any header indicator, it's likely a header + return any(indicator in first_value_upper for indicator in header_indicators) + + def _safe_float(self, value): + """Safely convert value to float""" + try: + if pd.isna(value): + return 0.0 + return float(value) + except (ValueError, TypeError): + return 0.0 + + def _get_or_create_customer(self, name, mobile, village, taluka, district): + """Get existing customer or create new one""" + try: + # Check if customer exists + result = self.db.execute_query( + 'SELECT customer_id FROM customers WHERE name = ? AND mobile = ?', + (name, mobile) + ) + + if result: + return result[0][0] + else: + # Create new customer + customer_code = f"CUST_{datetime.now().strftime('%Y%m%d%H%M%S')}" + self.db.add_customer(name, mobile, village, taluka, district, customer_code) + + # Get the new customer ID + result = self.db.execute_query( + 'SELECT customer_id FROM customers WHERE customer_code = ?', + (customer_code,) + ) + return result[0][0] if result else None + + except Exception as e: + logger.error(f"Error getting/creating customer: {e}") + return None + + def _get_product_id(self, product_name): + """Get product ID from product name""" + clean_name = product_name.upper().strip() + return self.product_mapping.get(clean_name, None) + + def _extract_location_from_name(self, name): + """Extract village and taluka from customer name""" + name_upper = name.upper() + + locations = { + 'AMIYAD': ('Amiyad', ''), + 'AMVAD': ('Amvad', ''), + 'ANKALAV': ('', 'Ankalav'), + 'PETLAD': ('', 'Petlad'), + 'BORSAD': ('', 'Borsad'), + 'VADODARA': ('', 'Vadodara'), + 'ANAND': ('', 'Anand'), + 'NADIAD': ('', 'Nadiad') + } + + village, taluka = "", "" + for location, (v, t) in locations.items(): + if location in name_upper: + if v: + village = v + if t: + taluka = t + break + + return village, taluka + + + + # Add to DataProcessor class in data_processor.py + + def _is_sales_sheet(self, df): + """Enhanced sales sheet detection with better logging""" + columns_lower = [str(col).lower() for col in df.columns] + + print(f"\n๐Ÿ” ENHANCED SALES DETECTION:") + print(f" All columns: {columns_lower}") + + sales_indicators = [ + 'invoice', 'sale', 'amount', 'product', 'quantity', 'rate', + 'total', 'price', 'bill', 'payment', 'item', 'qty' + ] + + found_indicators = [] + for indicator in sales_indicators: + matching_cols = [col for col in columns_lower if indicator in col] + if matching_cols: + found_indicators.append((indicator, matching_cols)) + + print(f" Found sales indicators: {found_indicators}") + + score = len(found_indicators) + print(f" Sales detection score: {score}") + + return score >= 2 + + def process_sales_sheet(self, df, file_name, sheet_name): + """Enhanced sales data processing with better logging""" + try: + processed_rows = 0 + print(f"๐Ÿ”„ Processing sales sheet: {sheet_name} with {len(df)} rows") + + for index, row in df.iterrows(): + try: + # Skip header rows and empty rows + if self._is_header_row(row) or pd.isna(row.iloc[0]): + continue + + print(f"๐Ÿ”ง Processing row {index}") + + # Extract sales data with flexible column mapping + invoice_no = self._extract_sales_value(row, 'invoice', 0, f"INV_{datetime.now().strftime('%Y%m%d%H%M%S')}_{index}") + customer_name = self._extract_sales_value(row, 'customer', 1, "Unknown Customer") + product_name = self._extract_sales_value(row, 'product', 2, "Unknown Product") + quantity = self._safe_float(self._extract_sales_value(row, 'quantity', 3, 0)) + amount = self._safe_float(self._extract_sales_value(row, 'amount', 4, 0)) + + print(f" Extracted - Invoice: '{invoice_no}', Customer: '{customer_name}', Product: '{product_name}', Qty: {quantity}, Amount: {amount}") + + # Validate essential data + if not customer_name or customer_name == "Unknown Customer": + print(f" โš ๏ธ Skipping - invalid customer name") + continue + + if quantity <= 0: + print(f" โš ๏ธ Skipping - invalid quantity: {quantity}") + continue + + if amount <= 0: + print(f" โš ๏ธ Skipping - invalid amount: {amount}") + continue + + # Get or create customer + customer_id = self._get_or_create_customer(customer_name, "", "", "", "") + if not customer_id: + print(f" โš ๏ธ Skipping - could not get/create customer") + continue + + # Get product ID + product_id = self._get_product_id(product_name) + if not product_id: + print(f" โš ๏ธ Skipping - product not found: '{product_name}'") + print(f" Available products: {list(self.product_mapping.keys())}") + continue + + # Calculate rate + rate = amount / quantity if quantity > 0 else 0 + + # Create sale items + sale_date = datetime.now().date() + sale_items = [{ + 'product_id': product_id, + 'quantity': quantity, + 'rate': rate + }] + + # Generate proper invoice number + if not invoice_no or invoice_no.startswith('INV_'): + invoice_no = self.db.generate_invoice_number() + + print(f" Creating sale - Customer ID: {customer_id}, Product ID: {product_id}") + + # Add sale to database + sale_id = self.db.add_sale(invoice_no, customer_id, sale_date, sale_items) + + if sale_id and sale_id > 0: + processed_rows += 1 + print(f" โœ… Successfully created sale ID: {sale_id}") + else: + print(f" โŒ Failed to create sale") + + except Exception as e: + print(f" โŒ Error in row {index}: {e}") + import traceback + traceback.print_exc() + continue + + print(f"๐ŸŽ‰ Processed {processed_rows} sales from {sheet_name}") + return processed_rows > 0 + + except Exception as e: + print(f"๐Ÿ’ฅ Error processing sales sheet: {e}") + import traceback + traceback.print_exc() + return False + def _extract_sales_value(self, row, field_name, default_index, default_value): + """Extract sales values with flexible column matching""" + # Try to find column by name + for col_name in row.index: + if field_name in str(col_name).lower(): + value = row[col_name] + if pd.notna(value): + return str(value).strip() + + # Fallback to index + if len(row) > default_index: + value = row.iloc[default_index] + if pd.notna(value): + return str(value).strip() + + return default_value + + # Add to DataProcessor class + + def _is_payment_sheet(self, df): + """Detect payment sheets""" + columns_lower = [str(col).lower() for col in df.columns] + + payment_indicators = [ + 'payment', 'paid', 'amount', 'invoice', 'date', 'method', + 'cash', 'gpay', 'cheque', 'bank', 'rrn', 'reference' + ] + + score = sum(1 for indicator in payment_indicators + if any(indicator in col for col in columns_lower)) + + print(f"๐Ÿ” Payment detection - Score: {score}, Columns: {columns_lower}") + return score >= 2 + + def process_payment_sheet(self, df, file_name, sheet_name): + """Process payment data from sheet""" + try: + processed_rows = 0 + print(f"๐Ÿ”„ Processing payment sheet: {sheet_name}") + + for index, row in df.iterrows(): + try: + if self._is_header_row(row) or pd.isna(row.iloc[0]): + continue + + # Extract payment data + invoice_no = self._extract_sales_value(row, 'invoice', 0, "") + amount = self._safe_float(self._extract_sales_value(row, 'amount', 1, 0)) + payment_date = self._extract_sales_value(row, 'date', 2, datetime.now().date()) + payment_method = self._extract_sales_value(row, 'method', 3, "Cash") + + if invoice_no and amount > 0: + # Find sale by invoice number + sale_result = self.db.execute_query( + 'SELECT sale_id FROM sales WHERE invoice_no = ?', + (invoice_no,), + log_action=False + ) + + if sale_result: + sale_id = sale_result[0][0] + + # Add payment + self.db.execute_query(''' + INSERT INTO payments (sale_id, payment_date, payment_method, amount) + VALUES (?, ?, ?, ?) + ''', (sale_id, payment_date, payment_method, amount)) + + processed_rows += 1 + print(f"โœ… Processed payment for invoice {invoice_no}") + + except Exception as e: + print(f"โŒ Error processing payment row {index}: {e}") + continue + + print(f"๐ŸŽ‰ Processed {processed_rows} payments from {sheet_name}") + return processed_rows > 0 + + except Exception as e: + print(f"๐Ÿ’ฅ Error processing payment sheet: {e}") + return False + + + def _is_customer_sheet(self, df): + """Check if sheet contains customer data - IMPROVED""" + columns_lower = [str(col).lower() for col in df.columns] + + customer_indicators = [ + 'customer', 'name', 'mobile', 'phone', 'village', 'taluka', + 'district', 'code', 'contact' + ] + + score = sum(1 for indicator in customer_indicators + if any(indicator in col for col in columns_lower)) + + print(f"๐Ÿ” Customer sheet detection - Score: {score}, Columns: {columns_lower}") + return score >= 2 + + def _is_distributor_sheet(self, df): + """Enhanced distributor sheet detection with better logging""" + columns_lower = [str(col).lower() for col in df.columns] + + print(f"\n๐Ÿ” ENHANCED DISTRIBUTOR DETECTION:") + print(f" All columns: {columns_lower}") + + distributor_indicators = [ + 'distributor', 'mantri', 'sabhasad', 'contact_in_group', + 'village', 'taluka', 'district', 'leader', 'team', 'sabh' + ] + + found_indicators = [] + for indicator in distributor_indicators: + matching_cols = [col for col in columns_lower if indicator in col] + if matching_cols: + found_indicators.append((indicator, matching_cols)) + + print(f" Found indicators: {found_indicators}") + + score = len(found_indicators) + print(f" Detection score: {score}") + + # More flexible detection - lower threshold + return score >= 1 # Even if we find just one indicator, try processing + + def process_single_sheet(self, df, sheet_name, file_name): + """Process a single sheet with detailed logging""" + print(f"๐Ÿ”„ Processing sheet: {sheet_name} from {file_name}") + + if self._is_sales_sheet(df): + print("โœ… Detected as SALES sheet") + return self.process_sales_sheet(df, file_name, sheet_name) + elif self._is_customer_sheet(df): + print("โœ… Detected as CUSTOMER sheet") + return self.process_customer_sheet(df, file_name, sheet_name) + elif self._is_distributor_sheet(df): + print("โœ… Detected as DISTRIBUTOR sheet") + return self.process_distributor_sheet(df, file_name, sheet_name) + else: + print("โ“ Unknown sheet type - trying customer processing as fallback") + return self.process_customer_sheet(df, file_name, sheet_name) + + def process_excel_file(self, file_path): + """Enhanced file processing with all data types""" + try: + file_name = os.path.basename(file_path) + print(f"๐Ÿš€ Processing file: {file_name}") + + excel_file = pd.ExcelFile(file_path) + processed_sheets = 0 + + for sheet_name in excel_file.sheet_names: + df = pd.read_excel(file_path, sheet_name=sheet_name) + df_clean = self._clean_dataframe(df) + + print(f"\n๐Ÿ“Š Sheet: {sheet_name}") + print(f" Columns: {df_clean.columns.tolist()}") + + # Check all types with priority + is_payment = self._is_payment_sheet(df_clean) + is_sales = self._is_sales_sheet(df_clean) + is_customer = self._is_customer_sheet(df_clean) + is_distributor = self._is_distributor_sheet(df_clean) + + print(f" Detection - Payment: {is_payment}, Sales: {is_sales}, Customer: {is_customer}, Distributor: {is_distributor}") + + processed = False + if is_payment: + print(" ๐Ÿ’ณ Processing as PAYMENT sheet") + processed = self.process_payment_sheet(df_clean, file_name, sheet_name) + elif is_sales: + print(" ๐Ÿ’ฐ Processing as SALES sheet") + processed = self.process_sales_sheet(df_clean, file_name, sheet_name) + elif is_distributor: + print(" ๐Ÿค Processing as DISTRIBUTOR sheet") + processed = self.process_distributor_sheet(df_clean, file_name, sheet_name) + elif is_customer: + print(" ๐Ÿ‘ฅ Processing as CUSTOMER sheet") + processed = self.process_customer_sheet(df_clean, file_name, sheet_name) + else: + print(" โ“ Unknown sheet type") + + if processed: + processed_sheets += 1 + print(f" โœ… Successfully processed") + else: + print(f" โŒ Failed to process") + + print(f"\n๐ŸŽ‰ File processing complete: {processed_sheets}/{len(excel_file.sheet_names)} sheets processed") + return processed_sheets > 0 + + except Exception as e: + print(f"๐Ÿ’ฅ Error processing file {file_path}: {e}") + return False \ No newline at end of file diff --git a/database.py b/database.py new file mode 100644 index 0000000000000000000000000000000000000000..2ea0e965cc833a4ffc41664e15d3786cd608db41 --- /dev/null +++ b/database.py @@ -0,0 +1,893 @@ +import sqlite3 +import pandas as pd +import os +import logging +from datetime import datetime, timedelta +from typing import List, Dict, Any, Optional +import random # Add this import +# Set up logging +logging.basicConfig(level=logging.INFO) +logger = logging.getLogger(__name__) + +class DatabaseManager: + def __init__(self, db_path="sales_management.db"): + self.db_path = db_path + self._is_logging = False # Prevent recursion + self.init_database() + + def get_connection(self): + """Get database connection with error handling""" + try: + conn = sqlite3.connect(self.db_path) + conn.row_factory = sqlite3.Row # This enables column access by name + return conn + except sqlite3.Error as e: + logger.error(f"Database connection error: {e}") + raise + + def init_database(self): + """Initialize database with all tables and relationships""" + conn = self.get_connection() + + try: + # Customers table + conn.execute(''' + CREATE TABLE IF NOT EXISTS customers ( + customer_id INTEGER PRIMARY KEY AUTOINCREMENT, + customer_code TEXT UNIQUE, + name TEXT NOT NULL, + mobile TEXT, + village TEXT, + taluka TEXT, + district TEXT, + status TEXT DEFAULT 'Active', + created_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + updated_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP + ) + ''') + + # Distributors table + conn.execute(''' + CREATE TABLE IF NOT EXISTS distributors ( + distributor_id INTEGER PRIMARY KEY AUTOINCREMENT, + name TEXT NOT NULL, + village TEXT, + taluka TEXT, + district TEXT, + mantri_name TEXT, + mantri_mobile TEXT, + sabhasad_count INTEGER DEFAULT 0, + contact_in_group INTEGER DEFAULT 0, + status TEXT DEFAULT 'Active', + created_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + updated_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP + ) + ''') + + # Products table + conn.execute(''' + CREATE TABLE IF NOT EXISTS products ( + product_id INTEGER PRIMARY KEY AUTOINCREMENT, + product_name TEXT UNIQUE NOT NULL, + packing_type TEXT, + capacity_ltr REAL, + category TEXT, + standard_rate REAL, + is_active INTEGER DEFAULT 1, + created_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP + ) + ''') + + # Sales table + conn.execute(''' + CREATE TABLE IF NOT EXISTS sales ( + sale_id INTEGER PRIMARY KEY AUTOINCREMENT, + invoice_no TEXT UNIQUE NOT NULL, + customer_id INTEGER, + sale_date DATE, + total_amount REAL DEFAULT 0, + total_liters REAL DEFAULT 0, + payment_status TEXT DEFAULT 'Pending', + notes TEXT, + created_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + updated_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + FOREIGN KEY (customer_id) REFERENCES customers (customer_id) ON DELETE SET NULL + ) + ''') + + # Sale items table + conn.execute(''' + CREATE TABLE IF NOT EXISTS sale_items ( + item_id INTEGER PRIMARY KEY AUTOINCREMENT, + sale_id INTEGER, + product_id INTEGER, + quantity INTEGER, + rate REAL, + amount REAL, + created_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + FOREIGN KEY (sale_id) REFERENCES sales (sale_id) ON DELETE CASCADE, + FOREIGN KEY (product_id) REFERENCES products (product_id) ON DELETE SET NULL + ) + ''') + + # Payments table + conn.execute(''' + CREATE TABLE IF NOT EXISTS payments ( + payment_id INTEGER PRIMARY KEY AUTOINCREMENT, + sale_id INTEGER, + payment_date DATE, + payment_method TEXT, + amount REAL, + rrn TEXT, + reference TEXT, + status TEXT DEFAULT 'Completed', + notes TEXT, + created_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + FOREIGN KEY (sale_id) REFERENCES sales (sale_id) ON DELETE CASCADE + ) + ''') + + # Demos table + conn.execute(''' + CREATE TABLE IF NOT EXISTS demos ( + demo_id INTEGER PRIMARY KEY AUTOINCREMENT, + customer_id INTEGER, + distributor_id INTEGER, + demo_date DATE, + product_id INTEGER, + quantity_provided INTEGER, + follow_up_date DATE, + conversion_status TEXT DEFAULT 'Not Converted', + notes TEXT, + created_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + updated_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + FOREIGN KEY (customer_id) REFERENCES customers (customer_id) ON DELETE SET NULL, + FOREIGN KEY (distributor_id) REFERENCES distributors (distributor_id) ON DELETE SET NULL, + FOREIGN KEY (product_id) REFERENCES products (product_id) ON DELETE SET NULL + ) + ''') + + # WhatsApp logs table + conn.execute(''' + CREATE TABLE IF NOT EXISTS whatsapp_logs ( + log_id INTEGER PRIMARY KEY AUTOINCREMENT, + customer_id INTEGER, + distributor_id INTEGER, + message_type TEXT, + message_content TEXT, + status TEXT, + sent_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + response TEXT, + FOREIGN KEY (customer_id) REFERENCES customers (customer_id) ON DELETE SET NULL, + FOREIGN KEY (distributor_id) REFERENCES distributors (distributor_id) ON DELETE SET NULL + ) + ''') + + # Follow-ups table + conn.execute(''' + CREATE TABLE IF NOT EXISTS follow_ups ( + follow_up_id INTEGER PRIMARY KEY AUTOINCREMENT, + customer_id INTEGER, + distributor_id INTEGER, + demo_id INTEGER, + follow_up_date DATE, + follow_up_type TEXT, + notes TEXT, + status TEXT DEFAULT 'Pending', + next_follow_up_date DATE, + created_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + FOREIGN KEY (customer_id) REFERENCES customers (customer_id) ON DELETE SET NULL, + FOREIGN KEY (distributor_id) REFERENCES distributors (distributor_id) ON DELETE SET NULL, + FOREIGN KEY (demo_id) REFERENCES demos (demo_id) ON DELETE SET NULL + ) + ''') + + # System logs table + conn.execute(''' + CREATE TABLE IF NOT EXISTS system_logs ( + log_id INTEGER PRIMARY KEY AUTOINCREMENT, + log_type TEXT, + log_message TEXT, + table_name TEXT, + record_id INTEGER, + action TEXT, + created_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + user_info TEXT + ) + ''') + + # Rollback logs table + conn.execute(''' + CREATE TABLE IF NOT EXISTS rollback_logs ( + rollback_id INTEGER PRIMARY KEY AUTOINCREMENT, + table_name TEXT, + record_id INTEGER, + old_data TEXT, + new_data TEXT, + action TEXT, + rollback_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + rolled_back_by TEXT + ) + ''') + + # Offers table + conn.execute(''' + CREATE TABLE IF NOT EXISTS offers ( + offer_id INTEGER PRIMARY KEY AUTOINCREMENT, + offer_name TEXT NOT NULL, + offer_description TEXT, + product_id INTEGER, + discount_percentage REAL, + discount_amount REAL, + start_date DATE, + end_date DATE, + status TEXT DEFAULT 'Active', + created_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + FOREIGN KEY (product_id) REFERENCES products (product_id) ON DELETE SET NULL + ) + ''') + + # Demo teams table + conn.execute(''' + CREATE TABLE IF NOT EXISTS demo_teams ( + team_id INTEGER PRIMARY KEY AUTOINCREMENT, + team_name TEXT NOT NULL, + team_leader TEXT, + team_members TEXT, + assigned_villages TEXT, + status TEXT DEFAULT 'Active', + created_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP + ) + ''') + + conn.commit() + logger.info("Database tables initialized successfully") + + except sqlite3.Error as e: + logger.error(f"Error initializing database: {e}") + raise + finally: + conn.close() + + self.initialize_default_data() + self.create_indexes() + + def create_indexes(self): + """Create indexes for better performance""" + conn = self.get_connection() + + try: + # Create indexes for frequently queried columns + indexes = [ + "CREATE INDEX IF NOT EXISTS idx_customers_village ON customers(village)", + "CREATE INDEX IF NOT EXISTS idx_customers_mobile ON customers(mobile)", + "CREATE INDEX IF NOT EXISTS idx_sales_customer_id ON sales(customer_id)", + "CREATE INDEX IF NOT EXISTS idx_sales_date ON sales(sale_date)", + "CREATE INDEX IF NOT EXISTS idx_sales_invoice ON sales(invoice_no)", + "CREATE INDEX IF NOT EXISTS idx_payments_sale_id ON payments(sale_id)", + "CREATE INDEX IF NOT EXISTS idx_demos_customer_id ON demos(customer_id)", + "CREATE INDEX IF NOT EXISTS idx_demos_date ON demos(demo_date)", + "CREATE INDEX IF NOT EXISTS idx_sale_items_sale_id ON sale_items(sale_id)", + "CREATE INDEX IF NOT EXISTS idx_follow_ups_date ON follow_ups(follow_up_date)", + "CREATE INDEX IF NOT EXISTS idx_whatsapp_customer_id ON whatsapp_logs(customer_id)" + ] + + for index_sql in indexes: + conn.execute(index_sql) + + conn.commit() + logger.info("Database indexes created successfully") + + except sqlite3.Error as e: + logger.error(f"Error creating indexes: {e}") + finally: + conn.close() + + def initialize_default_data(self): + """Initialize with default products and demo teams""" + default_products = [ + ('1 LTR PLASTIC JAR', 'PLASTIC_JAR', 1.0, 'Regular', 95), + ('2 LTR PLASTIC JAR', 'PLASTIC_JAR', 2.0, 'Regular', 185), + ('5 LTR PLASTIC JAR', 'PLASTIC_JAR', 5.0, 'Regular', 460), + ('5 LTR STEEL BARNI', 'STEEL_BARNI', 5.0, 'Premium', 680), + ('10 LTR STEEL BARNI', 'STEEL_BARNI', 10.0, 'Premium', 1300), + ('20 LTR STEEL BARNI', 'STEEL_BARNI', 20.0, 'Premium', 2950), + ('20 LTR PLASTIC CAN', 'PLASTIC_CAN', 20.0, 'Regular', 2400), + ('1 LTR PET BOTTLE', 'PET_BOTTLE', 1.0, 'Regular', 85) + ] + + default_teams = [ + ('Team A - North Region', 'Rajesh Kumar', 'Mohan, Suresh, Priya', 'Amiyad, Amvad, Ankalav'), + ('Team B - South Region', 'Sunil Patel', 'Anita, Vijay, Deepak', 'Petlad, Borsad, Vadodara') + ] + + conn = self.get_connection() + try: + # Insert default products + for product in default_products: + conn.execute(''' + INSERT OR IGNORE INTO products (product_name, packing_type, capacity_ltr, category, standard_rate) + VALUES (?, ?, ?, ?, ?) + ''', product) + + # Insert default demo teams + for team in default_teams: + conn.execute(''' + INSERT OR IGNORE INTO demo_teams (team_name, team_leader, team_members, assigned_villages) + VALUES (?, ?, ?, ?) + ''', team) + + conn.commit() + logger.info("Default data initialized successfully") + + except sqlite3.Error as e: + logger.error(f"Error initializing default data: {e}") + finally: + conn.close() + + def _execute_query_internal(self, query: str, params: tuple = None) -> List[tuple]: + """Internal method to execute SQL query without logging""" + conn = self.get_connection() + try: + cursor = conn.cursor() + if params: + cursor.execute(query, params) + else: + cursor.execute(query) + + # Only try to fetch results for SELECT queries + if query.strip().upper().startswith('SELECT'): + result = cursor.fetchall() + else: + result = [] + + conn.commit() + return result + + except sqlite3.Error as e: + logger.error(f"Database query error: {e}") + conn.rollback() + raise + finally: + conn.close() + + def execute_query(self, query: str, params: tuple = None, log_action: bool = True) -> List[tuple]: + """Execute a SQL query with comprehensive error handling""" + try: + result = self._execute_query_internal(query, params) + + # Log the query execution (but avoid recursion) + if log_action and not self._is_logging: + try: + self._is_logging = True + self._execute_query_internal(''' + INSERT INTO system_logs (log_type, log_message, table_name, record_id, action) + VALUES (?, ?, ?, ?, ?) + ''', ('QUERY_EXECUTION', f"Executed query: {query[:100]}...", None, None, 'EXECUTE')) + except Exception as e: + logger.error(f"Error logging system action: {e}") + finally: + self._is_logging = False + + return result + except Exception as e: + logger.error(f"Error in execute_query: {e}") + return [] # Return empty list instead of raising exception + + def get_dataframe(self, table_name: str = None, query: str = None, params: tuple = None) -> pd.DataFrame: + """Get table data as DataFrame with flexible query support""" + conn = self.get_connection() + try: + if query: + df = pd.read_sql_query(query, conn, params=params) + else: + df = pd.read_sql_query(f"SELECT * FROM {table_name}", conn) + return df + except Exception as e: + logger.error(f"Error getting DataFrame for {table_name if table_name else 'query'}: {e}") + # Return empty DataFrame with proper structure + return pd.DataFrame() + finally: + conn.close() + + def add_customer(self, name: str, mobile: str = "", village: str = "", taluka: str = "", + district: str = "", customer_code: str = None) -> int: + """Add a new customer with duplicate handling""" + + # Generate customer code if not provided + if not customer_code: + customer_code = f"CUST{datetime.now().strftime('%Y%m%d%H%M%S')}{random.randint(100, 999)}" + + try: + # Check if customer already exists (by mobile or similar name+village) + existing_customer = self.execute_query( + 'SELECT customer_id FROM customers WHERE mobile = ? OR (name = ? AND village = ?)', + (mobile, name, village), + log_action=False + ) + + if existing_customer: + # Customer already exists, return existing ID + return existing_customer[0][0] + + # If customer_code already exists, generate a new one + max_attempts = 5 + for attempt in range(max_attempts): + try: + result = self.execute_query(''' + INSERT INTO customers (customer_code, name, mobile, village, taluka, district) + VALUES (?, ?, ?, ?, ?, ?) + ''', (customer_code, name, mobile, village, taluka, district), log_action=False) + break + except sqlite3.IntegrityError as e: + if "UNIQUE constraint failed: customers.customer_code" in str(e) and attempt < max_attempts - 1: + # Generate new unique customer code + customer_code = f"CUST{datetime.now().strftime('%Y%m%d%H%M%S')}{random.randint(1000, 9999)}" + continue + else: + raise e + + # Get the inserted customer_id + customer_id = self.execute_query('SELECT last_insert_rowid()', log_action=False)[0][0] + + self.log_system_action('CUSTOMER_ADD', f"Added customer: {name}", 'customers', customer_id, 'INSERT') + + return customer_id + except Exception as e: + logger.error(f"Error adding customer: {e}") + # Return a fallback - this won't be in database but prevents crashes + return -1 + def add_distributor(self, name: str, village: str = "", taluka: str = "", district: str = "", + mantri_name: str = "", mantri_mobile: str = "", sabhasad_count: int = 0, + contact_in_group: int = 0, status: str = "Active") -> int: + """Add a new distributor with duplicate handling""" + + try: + # Check if distributor already exists + existing_distributor = self.execute_query( + 'SELECT distributor_id FROM distributors WHERE name = ? AND village = ? AND taluka = ?', + (name, village, taluka), + log_action=False + ) + + if existing_distributor: + # Distributor already exists, return existing ID + return existing_distributor[0][0] + + # Insert new distributor + self.execute_query(''' + INSERT INTO distributors (name, village, taluka, district, mantri_name, mantri_mobile, + sabhasad_count, contact_in_group, status) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) + ''', (name, village, taluka, district, mantri_name, mantri_mobile, + sabhasad_count, contact_in_group, status), log_action=False) + + # Get the inserted distributor_id + distributor_id = self.execute_query('SELECT last_insert_rowid()', log_action=False)[0][0] + + self.log_system_action('DISTRIBUTOR_ADD', f"Added distributor: {name}", 'distributors', distributor_id, 'INSERT') + + return distributor_id + + except Exception as e: + logger.error(f"Error adding distributor: {e}") + return -1 + def get_distributor_by_location(self, village: str, taluka: str) -> Optional[Dict]: + """Get distributor by village and taluka""" + try: + result = self.execute_query( + 'SELECT * FROM distributors WHERE village = ? AND taluka = ?', + (village, taluka), + log_action=False + ) + if result: + return dict(result[0]) + return None + except Exception as e: + logger.error(f"Error getting distributor by location: {e}") + return None + + def distributor_exists(self, name: str, village: str, taluka: str) -> bool: + """Check if distributor already exists""" + try: + result = self.execute_query( + 'SELECT distributor_id FROM distributors WHERE name = ? AND village = ? AND taluka = ?', + (name, village, taluka), + log_action=False + ) + return len(result) > 0 + except Exception as e: + logger.error(f"Error checking distributor existence: {e}") + return False + # In your DatabaseManager class in database.py, replace the generate_invoice_number method: + + def generate_invoice_number(self): + """Generate automatic invoice number in format: INVCLmmyyserial""" + try: + # Get current date components + now = datetime.now() + month = now.strftime('%m') # Two-digit month + year = now.strftime('%y') # Two-digit year + + # Get the last invoice number for this month-year + result = self.execute_query( + "SELECT invoice_no FROM sales WHERE invoice_no LIKE ? ORDER BY sale_id DESC LIMIT 1", + (f"INVCL{month}{year}%",), + log_action=False + ) + + if result: + last_invoice = result[0][0] + # Extract serial number and increment + try: + # Format: INVCLmmyyXXX + serial_part = last_invoice[8:] # Get part after INVCLmmyy + last_serial = int(serial_part) + new_serial = last_serial + 1 + except ValueError: + new_serial = 1 + else: + # First invoice of the month-year + new_serial = 1 + + # Format: INVCL + month(2) + year(2) + serial(3 digits) + return f"INVCL{month}{year}{new_serial:03d}" + + except Exception as e: + logger.error(f"Error generating invoice number: {e}") + # Fallback: timestamp-based + return f"INVCL{int(datetime.now().timestamp())}" + + # Or if you want a more flexible version with configurable prefix: + def generate_invoice_number(self, prefix="INVCL"): + """Generate automatic invoice number in format: PREFIXmmyyserial""" + try: + now = datetime.now() + month = now.strftime('%m') + year = now.strftime('%y') + + result = self.execute_query( + "SELECT invoice_no FROM sales WHERE invoice_no LIKE ? ORDER BY sale_id DESC LIMIT 1", + (f"{prefix}{month}{year}%",), + log_action=False + ) + + if result: + last_invoice = result[0][0] + try: + # Remove prefix and date part, get serial + serial_part = last_invoice[len(prefix) + 4:] # prefix + 4 digits (mmyy) + last_serial = int(serial_part) + new_serial = last_serial + 1 + except ValueError: + new_serial = 1 + else: + new_serial = 1 + + return f"{prefix}{month}{year}{new_serial:03d}" + + except Exception as e: + logger.error(f"Error generating invoice number: {e}") + return f"{prefix}{int(datetime.now().timestamp())}" + + # Add to your DatabaseManager class in database.py + + def add_sale(self, invoice_no: str, customer_id: int, sale_date, items: List[Dict], + payments: List[Dict] = None, notes: str = "") -> int: + """Add a new sale with items and optional payments - ENHANCED""" + conn = self.get_connection() + try: + cursor = conn.cursor() + + # Calculate total amount and liters + total_amount = sum(item['quantity'] * item['rate'] for item in items) + total_liters = sum(item.get('liters', 0) for item in items) + + print(f"๐Ÿ”ง DEBUG: Creating sale - Invoice: {invoice_no}, Customer: {customer_id}, Total: {total_amount}") # DEBUG + + # Add sale record + cursor.execute(''' + INSERT INTO sales (invoice_no, customer_id, sale_date, total_amount, total_liters, notes) + VALUES (?, ?, ?, ?, ?, ?) + ''', (invoice_no, customer_id, sale_date, total_amount, total_liters, notes)) + + # Get the sale ID + sale_id = cursor.lastrowid + print(f"๐Ÿ”ง DEBUG: Sale created with ID: {sale_id}") # DEBUG + + # Add sale items + for item in items: + amount = item['quantity'] * item['rate'] + print(f"๐Ÿ”ง DEBUG: Adding item - Product: {item['product_id']}, Qty: {item['quantity']}, Rate: {item['rate']}") # DEBUG + + cursor.execute(''' + INSERT INTO sale_items (sale_id, product_id, quantity, rate, amount) + VALUES (?, ?, ?, ?, ?) + ''', (sale_id, item['product_id'], item['quantity'], item['rate'], amount)) + + # Add payments if provided + if payments: + for payment in payments: + cursor.execute(''' + INSERT INTO payments (sale_id, payment_date, payment_method, amount, rrn, reference) + VALUES (?, ?, ?, ?, ?, ?) + ''', (sale_id, payment['payment_date'], payment['method'], + payment['amount'], payment.get('rrn', ''), payment.get('reference', ''))) + + conn.commit() + + # Update payment status + self._update_payment_status(sale_id) + + print(f"๐Ÿ”ง DEBUG: Sale {sale_id} completed successfully") # DEBUG + return sale_id + + except Exception as e: + conn.rollback() + logger.error(f"Error adding sale: {e}") + print(f"โŒ ERROR in add_sale: {e}") # DEBUG + raise + finally: + conn.close() + + def _update_payment_status(self, sale_id: int): + """Update payment status for a sale""" + conn = self.get_connection() + try: + # Get total paid amount + cursor = conn.cursor() + cursor.execute('SELECT COALESCE(SUM(amount), 0) FROM payments WHERE sale_id = ?', (sale_id,)) + total_paid = cursor.fetchone()[0] + + # Get sale total + cursor.execute('SELECT total_amount FROM sales WHERE sale_id = ?', (sale_id,)) + sale_total = cursor.fetchone()[0] + + # Determine payment status + if total_paid >= sale_total: + status = 'Paid' + elif total_paid > 0: + status = 'Partial' + else: + status = 'Pending' + + # Update status + cursor.execute('UPDATE sales SET payment_status = ? WHERE sale_id = ?', (status, sale_id)) + conn.commit() + + except Exception as e: + logger.error(f"Error updating payment status: {e}") + finally: + conn.close() + + def get_pending_payments(self) -> pd.DataFrame: + """Get all pending payments with customer details""" + return self.get_dataframe('sales', ''' + SELECT s.sale_id, s.invoice_no, s.sale_date, c.name as customer_name, + c.mobile, c.village, s.total_amount, + (s.total_amount - COALESCE(SUM(p.amount), 0)) as pending_amount, + COALESCE(SUM(p.amount), 0) as paid_amount + FROM sales s + LEFT JOIN customers c ON s.customer_id = c.customer_id + LEFT JOIN payments p ON s.sale_id = p.sale_id + WHERE s.payment_status IN ('Pending', 'Partial') + GROUP BY s.sale_id + HAVING pending_amount > 0 + ORDER BY s.sale_date DESC + ''') + + def get_demo_conversions(self) -> pd.DataFrame: + """Get demo conversion statistics with details""" + return self.get_dataframe('demos', ''' + SELECT d.*, c.name as customer_name, p.product_name, + dist.name as distributor_name, c.village, c.taluka, + CASE WHEN d.conversion_status = 'Converted' THEN 1 ELSE 0 END as converted + FROM demos d + LEFT JOIN customers c ON d.customer_id = c.customer_id + LEFT JOIN products p ON d.product_id = p.product_id + LEFT JOIN distributors dist ON d.distributor_id = dist.distributor_id + ORDER BY d.demo_date DESC + ''') + + def get_sales_analytics(self, start_date: str = None, end_date: str = None) -> Dict: + """Get comprehensive sales analytics""" + if not start_date: + start_date = (datetime.now() - timedelta(days=30)).strftime('%Y-%m-%d') + if not end_date: + end_date = datetime.now().strftime('%Y-%m-%d') + + query = ''' + SELECT + COUNT(*) as total_sales, + SUM(total_amount) as total_revenue, + AVG(total_amount) as avg_sale_value, + COUNT(DISTINCT customer_id) as unique_customers, + SUM(CASE WHEN payment_status = 'Paid' THEN 1 ELSE 0 END) as completed_payments, + SUM(CASE WHEN payment_status IN ('Pending', 'Partial') THEN 1 ELSE 0 END) as pending_payments + FROM sales + WHERE sale_date BETWEEN ? AND ? + ''' + + result = self.execute_query(query, (start_date, end_date), log_action=False) + + if result: + row = result[0] + return { + 'total_sales': row[0] or 0, + 'total_revenue': row[1] or 0, + 'avg_sale_value': row[2] or 0, + 'unique_customers': row[3] or 0, + 'completed_payments': row[4] or 0, + 'pending_payments': row[5] or 0 + } + return {} + + def log_system_action(self, log_type: str, message: str, table_name: str = None, + record_id: int = None, action: str = None): + """Log system actions for audit trail - without recursion""" + if self._is_logging: + return # Prevent recursion + + try: + self._is_logging = True + self._execute_query_internal(''' + INSERT INTO system_logs (log_type, log_message, table_name, record_id, action) + VALUES (?, ?, ?, ?, ?) + ''', (log_type, message, table_name, record_id, action)) + except Exception as e: + logger.error(f"Error logging system action: {e}") + finally: + self._is_logging = False + + def create_rollback_point(self, table_name: str, record_id: int, old_data: str, + new_data: str, action: str): + """Create a rollback point for data changes""" + try: + self.execute_query(''' + INSERT INTO rollback_logs (table_name, record_id, old_data, new_data, action) + VALUES (?, ?, ?, ?, ?) + ''', (table_name, record_id, old_data, new_data, action), log_action=False) + except Exception as e: + logger.error(f"Error creating rollback point: {e}") + + def get_recent_activity(self, limit: int = 10) -> pd.DataFrame: + """Get recent system activity""" + return self.get_dataframe('system_logs', f''' + SELECT log_type, log_message, table_name, record_id, action, created_date + FROM system_logs + ORDER BY created_date DESC + LIMIT {limit} + ''') + + def backup_database(self, backup_path: str = None): + """Create a database backup""" + if not backup_path: + backup_path = f"backup_{datetime.now().strftime('%Y%m%d_%H%M%S')}.db" + + try: + conn = self.get_connection() + backup_conn = sqlite3.connect(backup_path) + + with backup_conn: + conn.backup(backup_conn) + + conn.close() + backup_conn.close() + + logger.info(f"Database backup created: {backup_path}") + return backup_path + + except Exception as e: + logger.error(f"Error creating database backup: {e}") + return None + + def get_village_wise_sales(self) -> pd.DataFrame: + """Get sales data grouped by village""" + return self.get_dataframe('sales', ''' + SELECT c.village, COUNT(s.sale_id) as total_sales, + SUM(s.total_amount) as total_revenue, + AVG(s.total_amount) as avg_sale_value, + COUNT(DISTINCT s.customer_id) as unique_customers + FROM sales s + JOIN customers c ON s.customer_id = c.customer_id + WHERE c.village IS NOT NULL AND c.village != '' + GROUP BY c.village + ORDER BY total_revenue DESC + ''') + + def get_product_performance(self) -> pd.DataFrame: + """Get product performance analytics""" + return self.get_dataframe('sale_items', ''' + SELECT p.product_name, COUNT(si.item_id) as times_sold, + SUM(si.quantity) as total_quantity, + SUM(si.amount) as total_revenue, + AVG(si.rate) as avg_rate + FROM sale_items si + JOIN products p ON si.product_id = p.product_id + GROUP BY p.product_id, p.product_name + ORDER BY total_revenue DESC + ''') + + def get_upcoming_follow_ups(self) -> pd.DataFrame: + """Get upcoming follow-ups""" + return self.get_dataframe('follow_ups', ''' + SELECT f.*, c.name as customer_name, c.mobile, + d.name as distributor_name, dm.demo_date + FROM follow_ups f + LEFT JOIN customers c ON f.customer_id = c.customer_id + LEFT JOIN distributors d ON f.distributor_id = d.distributor_id + LEFT JOIN demos dm ON f.demo_id = dm.demo_id + WHERE f.follow_up_date >= date('now') + AND f.status = 'Pending' + ORDER BY f.follow_up_date ASC + LIMIT 20 + ''') + + def get_whatsapp_logs(self, customer_id: int = None) -> pd.DataFrame: + """Get WhatsApp communication logs""" + if customer_id: + return self.get_dataframe('whatsapp_logs', ''' + SELECT w.*, c.name as customer_name, c.mobile + FROM whatsapp_logs w + LEFT JOIN customers c ON w.customer_id = c.customer_id + WHERE w.customer_id = ? + ORDER BY w.sent_date DESC + ''', (customer_id,)) + else: + return self.get_dataframe('whatsapp_logs', ''' + SELECT w.*, c.name as customer_name, c.mobile + FROM whatsapp_logs w + LEFT JOIN customers c ON w.customer_id = c.customer_id + ORDER BY w.sent_date DESC + LIMIT 50 + ''') + + def cleanup_old_data(self, days: int = 365): + """Clean up old data (logs, etc.) older than specified days""" + try: + cutoff_date = (datetime.now() - timedelta(days=days)).strftime('%Y-%m-%d') + + # Clean system logs + self.execute_query('DELETE FROM system_logs WHERE created_date < ?', (cutoff_date,), log_action=False) + + # Clean rollback logs + self.execute_query('DELETE FROM rollback_logs WHERE rollback_date < ?', (cutoff_date,), log_action=False) + + logger.info(f"Cleaned up data older than {days} days") + + except Exception as e: + logger.error(f"Error cleaning up old data: {e}") + +# Utility function to check database health +def check_database_health(db_path: str = "sales_management.db") -> Dict: + """Check database health and statistics""" + try: + db = DatabaseManager(db_path) + + # Get table counts + tables = ['customers', 'sales', 'distributors', 'demos', 'payments', 'products'] + counts = {} + + for table in tables: + result = db.execute_query(f"SELECT COUNT(*) FROM {table}", log_action=False) + counts[table] = result[0][0] if result else 0 + + # Get database size + db_size = os.path.getsize(db_path) if os.path.exists(db_path) else 0 + + return { + 'status': 'healthy', + 'table_counts': counts, + 'database_size_mb': round(db_size / (1024 * 1024), 2), + 'last_backup': 'N/A', # You can implement backup tracking + 'integrity_check': 'passed' # You can add actual integrity checks + } + + except Exception as e: + return { + 'status': 'error', + 'error': str(e), + 'table_counts': {}, + 'database_size_mb': 0, + 'integrity_check': 'failed' + } \ No newline at end of file diff --git a/main.py b/main.py new file mode 100644 index 0000000000000000000000000000000000000000..0c77040a84d3cc4009cf572cbb6c163af0a3d111 --- /dev/null +++ b/main.py @@ -0,0 +1,211 @@ +# main.py (Fixed version) +import streamlit as st +import os +import sys + +# Add the current directory to Python path +sys.path.append(os.path.dirname(__file__)) + +# MUST BE FIRST - Page configuration +st.set_page_config( + page_title="Sales Management System", + page_icon="๐Ÿ“Š", + layout="wide", + initial_sidebar_state="expanded" +) + +# Import utilities - Create these if they don't exist +try: + from utils.styling import apply_custom_css + from utils.helpers import init_session_state, check_module_availability + from components.database_status import show_database_status +except ImportError: + # Create basic fallbacks if utils don't exist + def apply_custom_css(): + st.markdown(""" + + """, unsafe_allow_html=True) + + def init_session_state(): + if 'db' not in st.session_state: + st.session_state.db = None + if 'data_processor' not in st.session_state: + st.session_state.data_processor = None + if 'analytics' not in st.session_state: + st.session_state.analytics = None + if 'whatsapp_manager' not in st.session_state: + st.session_state.whatsapp_manager = None + + def check_module_availability(): + try: + import pandas, plotly, sqlite3 + MODULES_AVAILABLE = True + except ImportError: + MODULES_AVAILABLE = False + + try: + import pywhatkit + WHATSAPP_AVAILABLE = True + except ImportError: + WHATSAPP_AVAILABLE = False + + return MODULES_AVAILABLE, WHATSAPP_AVAILABLE + + def show_database_status(db): + if db: + try: + health = db.execute_query("SELECT COUNT(*) FROM sqlite_master", log_action=False) + st.sidebar.success("โœ… Database Connected") + except: + st.sidebar.error("โŒ Database Error") + else: + st.sidebar.warning("โš ๏ธ Database Not Initialized") + +# Apply custom CSS +apply_custom_css() + +# Initialize session state +init_session_state() + +# Check module availability +MODULES_AVAILABLE, WHATSAPP_AVAILABLE = check_module_availability() + +# Initialize components with error handling +if MODULES_AVAILABLE: + try: + from database import DatabaseManager + from data_processor import DataProcessor + from analytics import Analytics + + if st.session_state.db is None: + st.session_state.db = DatabaseManager() + st.success("โœ… Database initialized successfully!") + + if st.session_state.data_processor is None: + st.session_state.data_processor = DataProcessor(st.session_state.db) + + if st.session_state.analytics is None: + st.session_state.analytics = Analytics(st.session_state.db) + + if WHATSAPP_AVAILABLE and st.session_state.whatsapp_manager is None: + try: + from whatsapp_manager import WhatsAppManager + st.session_state.whatsapp_manager = WhatsAppManager(st.session_state.db) + st.success("โœ… WhatsApp Manager initialized!") + except Exception as e: + st.warning(f"โš ๏ธ WhatsApp Manager not available: {e}") + st.session_state.whatsapp_manager = None + + except Exception as e: + st.error(f"โŒ Application initialization failed: {e}") + st.info("Please check that all required files are in the correct location.") + +# Assign to local variables for easier access +db = st.session_state.db +data_processor = st.session_state.data_processor +analytics = st.session_state.analytics +whatsapp_manager = st.session_state.whatsapp_manager + +# Sidebar navigation +st.sidebar.markdown("

๐Ÿš€ Sales Management

", unsafe_allow_html=True) + +page = st.sidebar.radio("Navigation", [ + "๐Ÿ“Š Dashboard", "๐Ÿ‘ฅ Customers", "๐Ÿ’ฐ Sales", "๐Ÿ’ณ Payments", + "๐ŸŽฏ Demos", "๐Ÿค Distributors", "๐Ÿ” File Viewer", "๐Ÿ“ค Data Import", "๐Ÿ“ˆ Reports" +], index=0) + +# Page routing with error handling +try: + if page == "๐Ÿ“Š Dashboard": + try: + from pages.dashboard import create_dashboard + create_dashboard(db, analytics) + except ImportError: + st.error("Dashboard page not available. Creating basic dashboard...") + show_basic_dashboard(db, analytics) + + elif page == "๐Ÿ‘ฅ Customers": + try: + from pages.customers import show_customers_page + show_customers_page(db, whatsapp_manager) + except ImportError: + st.error("Customers page not available") + + elif page == "๐Ÿ’ฐ Sales": + try: + from pages.sales import show_sales_page + show_sales_page(db, whatsapp_manager) + except ImportError: + st.error("Sales page not available") + + elif page == "๐ŸŽฏ Demos": + from pages.demos import show_demos_page + show_demos_page(db, whatsapp_manager) + + elif page == "๐Ÿ’ณ Payments": + from pages.payments import show_payments_page + show_payments_page(db, whatsapp_manager) + + elif page == "๐Ÿค Distributors": + try: + from pages.distributors import show_distributors_page + show_distributors_page(db, whatsapp_manager) + except ImportError: + st.error("Distributors page not available") + + elif page == "๐Ÿ” File Viewer": + try: + from pages.file_viewer import show_file_viewer_page + show_file_viewer_page(db, data_processor) + except ImportError: + st.error("File Viewer page not available") + + elif page == "๐Ÿ“ค Data Import": + try: + from pages.data_import import show_data_import_page + show_data_import_page(db, data_processor) + except ImportError: + st.error("Data Import page not available") + + elif page == "๐Ÿ“ˆ Reports": + try: + from pages.reports import show_reports_page + show_reports_page(db,whatsapp_manager) + except ImportError: + st.error("Reports page not available") + +except Exception as e: + st.error(f"Application error: {e}") + st.info("Please check the console for more details.") + +# Show database status in sidebar +show_database_status(db) + +st.sidebar.markdown("---") +st.sidebar.info("๐Ÿš€ Sales Management System v2.0") + +# Basic dashboard fallback +def show_basic_dashboard(db, analytics): + st.title("๐Ÿ“Š Sales Dashboard") + + if db and analytics: + try: + sales_summary = analytics.get_sales_summary() + + col1, col2, col3, col4 = st.columns(4) + with col1: + st.metric("Total Sales", f"โ‚น{sales_summary.get('total_sales', 0):,.0f}") + with col2: + st.metric("Pending Payments", f"โ‚น{sales_summary.get('pending_amount', 0):,.0f}") + with col3: + st.metric("Total Transactions", sales_summary.get('total_transactions', 0)) + with col4: + st.metric("Avg Sale", f"โ‚น{sales_summary.get('avg_sale_value', 0):,.0f}") + + except Exception as e: + st.error(f"Error loading dashboard data: {e}") + else: + st.warning("Database or analytics not available") \ No newline at end of file diff --git a/pages/__init__.py b/pages/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/pages/__pycache__/__init__.cpython-310.pyc b/pages/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..20a0b26d7d78d11aaa98ddff933a2ae84da894fe Binary files /dev/null and b/pages/__pycache__/__init__.cpython-310.pyc differ diff --git a/pages/__pycache__/customers.cpython-310.pyc b/pages/__pycache__/customers.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..569a3e5d06dd8c3bc68b89feb93e563642067d5a Binary files /dev/null and b/pages/__pycache__/customers.cpython-310.pyc differ diff --git a/pages/__pycache__/dashboard.cpython-310.pyc b/pages/__pycache__/dashboard.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3c3ba707a9160d373af3a06fdaa42d5f418c5c6e Binary files /dev/null and b/pages/__pycache__/dashboard.cpython-310.pyc differ diff --git a/pages/__pycache__/data_import.cpython-310.pyc b/pages/__pycache__/data_import.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..54626ef05ef46b6429f59f1157c96f3a11be90c1 Binary files /dev/null and b/pages/__pycache__/data_import.cpython-310.pyc differ diff --git a/pages/__pycache__/demos.cpython-310.pyc b/pages/__pycache__/demos.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f78967b32b9b0e5ce44707fd81d191d9c66ea981 Binary files /dev/null and b/pages/__pycache__/demos.cpython-310.pyc differ diff --git a/pages/__pycache__/distributors.cpython-310.pyc b/pages/__pycache__/distributors.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..89cf1948cd2a611d33c1a3f0005b35ac41ca6c30 Binary files /dev/null and b/pages/__pycache__/distributors.cpython-310.pyc differ diff --git a/pages/__pycache__/file_viewer.cpython-310.pyc b/pages/__pycache__/file_viewer.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d4beba56a5722519401f40725eb8229168ef9724 Binary files /dev/null and b/pages/__pycache__/file_viewer.cpython-310.pyc differ diff --git a/pages/__pycache__/payments.cpython-310.pyc b/pages/__pycache__/payments.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..36e9c0827cefe92f4a370ed05872e148bffc8689 Binary files /dev/null and b/pages/__pycache__/payments.cpython-310.pyc differ diff --git a/pages/__pycache__/reports.cpython-310.pyc b/pages/__pycache__/reports.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..becab00a96bc4edb148309c7111b7b30a588df6f Binary files /dev/null and b/pages/__pycache__/reports.cpython-310.pyc differ diff --git a/pages/__pycache__/sales.cpython-310.pyc b/pages/__pycache__/sales.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2102c31fc82966e3f12c6764fd4cca71294283fb Binary files /dev/null and b/pages/__pycache__/sales.cpython-310.pyc differ diff --git a/pages/customers.py b/pages/customers.py new file mode 100644 index 0000000000000000000000000000000000000000..0ffcc615a2e6c169aa011f0eea1482d7f50bfac3 --- /dev/null +++ b/pages/customers.py @@ -0,0 +1,449 @@ +# pages/customers.py +import streamlit as st +import pandas as pd +import plotly.express as px +from datetime import datetime, timedelta + +def show_customers_page(db, whatsapp_manager=None): + """Show customer analytics, segmentation, and action planning page""" + st.title("๐Ÿ‘ฅ Customer Intelligence Center") + + if not db: + st.error("Database not available. Please check initialization.") + return + + # Tabs for different customer functions + tab1, tab2, tab3, tab4 = st.tabs(["๐Ÿ“Š Dashboard", "๐ŸŽฏ Segmentation", "๐Ÿ“ž Action Center", "๐Ÿ” Customer Directory"]) + + with tab1: + show_customer_dashboard_tab(db) + + with tab2: + show_customer_segmentation_tab(db) + + with tab3: + show_action_center_tab(db, whatsapp_manager) + + with tab4: + show_customer_directory_tab(db) + +def show_customer_dashboard_tab(db): + """Show customer analytics dashboard""" + st.subheader("๐Ÿ“Š Customer Analytics Dashboard") + + try: + # Get comprehensive customer data + customers_data = get_customer_analytics_data(db) + + if customers_data.empty: + st.info("No customer data available yet.") + return + + # Key Metrics + st.subheader("๐ŸŽฏ Key Metrics") + col1, col2, col3, col4 = st.columns(4) + + with col1: + total_customers = len(customers_data) + st.metric("Total Customers", total_customers) + + with col2: + active_customers = len(customers_data[customers_data['total_purchases'] > 0]) + st.metric("Active Customers", active_customers) + + with col3: + avg_purchase_value = customers_data[customers_data['total_spent'] > 0]['total_spent'].mean() + st.metric("Avg Purchase Value", f"โ‚น{avg_purchase_value:,.0f}" if not pd.isna(avg_purchase_value) else "โ‚น0") + + with col4: + repeat_customers = len(customers_data[customers_data['total_purchases'] > 1]) + st.metric("Repeat Customers", repeat_customers) + + # Village-wise Analysis + st.subheader("๐Ÿ—บ๏ธ Geographic Distribution") + col1, col2 = st.columns(2) + + with col1: + village_stats = customers_data.groupby('village').agg({ + 'customer_id': 'count', + 'total_spent': 'sum', + 'total_purchases': 'sum' + }).reset_index() + village_stats.columns = ['Village', 'Customers', 'Total Revenue', 'Total Purchases'] + village_stats = village_stats.sort_values('Customers', ascending=False) + + if not village_stats.empty: + fig = px.bar(village_stats.head(10), x='Village', y='Customers', + title='Top 10 Villages by Customer Count', + color='Customers') + st.plotly_chart(fig, use_container_width=True) + + with col2: + if not village_stats.empty: + fig = px.pie(village_stats.head(8), values='Customers', names='Village', + title='Customer Distribution by Village') + st.plotly_chart(fig, use_container_width=True) + + # Purchase Behavior + st.subheader("๐Ÿ’ฐ Purchase Behavior Analysis") + col1, col2 = st.columns(2) + + with col1: + # Customer lifetime value distribution + spending_brackets = customers_data[customers_data['total_spent'] > 0]['total_spent'] + if not spending_brackets.empty: + fig = px.histogram(spending_brackets, nbins=10, + title='Customer Spending Distribution', + labels={'value': 'Total Spent (โ‚น)', 'count': 'Number of Customers'}) + st.plotly_chart(fig, use_container_width=True) + + with col2: + # Recency analysis + if 'last_purchase_date' in customers_data.columns: + recent_customers = customers_data[customers_data['last_purchase_date'].notna()] + if not recent_customers.empty: + recent_customers['days_since_purchase'] = (datetime.now() - pd.to_datetime(recent_customers['last_purchase_date'])).dt.days + fig = px.histogram(recent_customers, x='days_since_purchase', nbins=10, + title='Days Since Last Purchase', + labels={'days_since_purchase': 'Days', 'count': 'Customers'}) + st.plotly_chart(fig, use_container_width=True) + + except Exception as e: + st.error(f"Error loading customer analytics: {e}") + +def show_customer_segmentation_tab(db): + """Show customer segmentation and targeting""" + st.subheader("๐ŸŽฏ Customer Segmentation") + + try: + customers_data = get_customer_analytics_data(db) + + if customers_data.empty: + st.info("No customer data available for segmentation.") + return + + # Segmentation criteria + st.subheader("๐Ÿ” Define Segments") + + col1, col2 = st.columns(2) + + with col1: + segment_by = st.selectbox("Segment By", + ["Purchase Behavior", "Geographic", "Demographic", "Custom"]) + + if segment_by == "Purchase Behavior": + min_purchases = st.slider("Minimum Purchases", 0, 20, 1) + min_spent = st.number_input("Minimum Amount Spent (โ‚น)", 0, 100000, 1000) + + segment_customers = customers_data[ + (customers_data['total_purchases'] >= min_purchases) & + (customers_data['total_spent'] >= min_spent) + ] + + elif segment_by == "Geographic": + selected_villages = st.multiselect("Select Villages", + customers_data['village'].unique()) + if selected_villages: + segment_customers = customers_data[customers_data['village'].isin(selected_villages)] + else: + segment_customers = customers_data + + elif segment_by == "Demographic": + # Add demographic filters here + segment_customers = customers_data + + with col2: + st.write("**Segment Actions**") + segment_size = len(segment_customers) + st.metric("Segment Size", segment_size) + + if segment_size > 0: + avg_segment_value = segment_customers['total_spent'].mean() + st.metric("Avg Customer Value", f"โ‚น{avg_segment_value:,.0f}") + + # Quick actions for segment + if st.button("๐Ÿ“ฑ Send Bulk WhatsApp", key="segment_whatsapp"): + st.info(f"Ready to send message to {segment_size} customers") + + if st.button("๐Ÿ“ Plan Field Visit", key="segment_visit"): + villages = segment_customers['village'].value_counts().head(5) + st.success(f"Top villages to visit: {', '.join(villages.index.tolist())}") + + # Show segment details + if not segment_customers.empty: + st.subheader("๐Ÿ‘ฅ Segment Details") + + # Segment characteristics + col1, col2, col3 = st.columns(3) + + with col1: + top_village = segment_customers['village'].mode()[0] if not segment_customers['village'].mode().empty else "N/A" + st.metric("Most Common Village", top_village) + + with col2: + avg_purchases = segment_customers['total_purchases'].mean() + st.metric("Avg Purchases/Customer", f"{avg_purchases:.1f}") + + with col3: + total_potential = segment_customers['total_spent'].sum() + st.metric("Segment Total Value", f"โ‚น{total_potential:,.0f}") + + # Customer list in segment + st.dataframe(segment_customers[['name', 'village', 'mobile', 'total_purchases', 'total_spent']].head(20), + use_container_width=True) + + except Exception as e: + st.error(f"Error in customer segmentation: {e}") + +def show_action_center_tab(db, whatsapp_manager): + """Show action planning and communication center""" + st.subheader("๐Ÿ“ž Customer Action Center") + + try: + customers_data = get_customer_analytics_data(db) + + if customers_data.empty: + st.info("No customer data available for actions.") + return + + # Action categories + action_type = st.selectbox("Action Type", + ["Follow-up Calls", "Demo Follow-ups", "Payment Reminders", + "New Product Announcements", "Customer Feedback"]) + + if action_type == "Follow-up Calls": + show_followup_calls_section(db, customers_data) + + elif action_type == "Demo Follow-ups": + show_demo_followups_section(db, customers_data) + + elif action_type == "Payment Reminders": + show_payment_reminders_section(db, customers_data, whatsapp_manager) + + elif action_type == "New Product Announcements": + show_product_announcements_section(db, customers_data, whatsapp_manager) + + elif action_type == "Customer Feedback": + show_feedback_section(db, customers_data, whatsapp_manager) + + except Exception as e: + st.error(f"Error in action center: {e}") + +def show_followup_calls_section(db, customers_data): + """Show customers needing follow-up calls""" + st.write("### ๐Ÿ“ž Customers Needing Follow-up") + + # Identify customers for follow-up + follow_up_criteria = st.multiselect("Follow-up Criteria", + ["No Purchase in 30 days", "High Value Customers", + "Single Purchase Only", "Specific Villages"]) + + target_customers = customers_data.copy() + + if "No Purchase in 30 days" in follow_up_criteria: + # This would require last_purchase_date in your data + st.info("Last purchase date tracking needed for this feature") + + if "High Value Customers" in follow_up_criteria: + high_value_threshold = st.number_input("High Value Threshold (โ‚น)", 1000, 10000, 5000) + target_customers = target_customers[target_customers['total_spent'] >= high_value_threshold] + + if "Single Purchase Only" in follow_up_criteria: + target_customers = target_customers[target_customers['total_purchases'] == 1] + + if not target_customers.empty: + st.write(f"**{len(target_customers)} customers identified for follow-up**") + + # Village concentration + village_concentration = target_customers['village'].value_counts().head(5) + st.write("**Top villages for field visits:**") + for village, count in village_concentration.items(): + st.write(f"- {village}: {count} customers") + + # Display customer list + st.dataframe(target_customers[['name', 'village', 'mobile', 'total_purchases', 'total_spent']], + use_container_width=True) + +def show_demo_followups_section(db, customers_data): + """Show demo conversion tracking""" + st.write("### ๐ŸŽฏ Demo Conversion Tracking") + + try: + # Get demo data + demo_data = db.get_dataframe('demos', ''' + SELECT d.*, c.name as customer_name, c.village, c.mobile, p.product_name + FROM demos d + LEFT JOIN customers c ON d.customer_id = c.customer_id + LEFT JOIN products p ON d.product_id = p.product_id + ORDER BY d.demo_date DESC + ''') + + if not demo_data.empty: + # Demo conversion stats + total_demos = len(demo_data) + converted_demos = len(demo_data[demo_data['conversion_status'] == 'Converted']) + conversion_rate = (converted_demos / total_demos) * 100 if total_demos > 0 else 0 + + col1, col2, col3 = st.columns(3) + with col1: + st.metric("Total Demos", total_demos) + with col2: + st.metric("Converted", converted_demos) + with col3: + st.metric("Conversion Rate", f"{conversion_rate:.1f}%") + + # Pending follow-ups + pending_followups = demo_data[ + (demo_data['conversion_status'] == 'Not Converted') & + (pd.to_datetime(demo_data['follow_up_date']) <= datetime.now()) + ] + + if not pending_followups.empty: + st.warning(f"๐Ÿšจ {len(pending_followups)} demos need immediate follow-up!") + st.dataframe(pending_followups[['customer_name', 'village', 'product_name', 'demo_date', 'follow_up_date']], + use_container_width=True) + + # All demo records + st.write("**All Demo Records**") + st.dataframe(demo_data[['customer_name', 'village', 'product_name', 'demo_date', 'conversion_status']], + use_container_width=True) + else: + st.info("No demo records found.") + + except Exception as e: + st.error(f"Error loading demo data: {e}") + +def show_payment_reminders_section(db, customers_data, whatsapp_manager): + """Show payment reminder system""" + st.write("### ๐Ÿ’ฐ Payment Reminders") + + try: + # Get pending payments + pending_payments = db.get_pending_payments() + + if not pending_payments.empty: + total_pending = pending_payments['pending_amount'].sum() + st.metric("Total Pending Amount", f"โ‚น{total_pending:,.2f}") + + # Group by customer + customer_pending = pending_payments.groupby('customer_name').agg({ + 'pending_amount': 'sum', + 'invoice_no': 'count' + }).reset_index() + customer_pending.columns = ['Customer', 'Total Pending', 'Pending Invoices'] + customer_pending = customer_pending.sort_values('Total Pending', ascending=False) + + st.dataframe(customer_pending, use_container_width=True) + + # Bulk WhatsApp reminders + st.write("**Bulk Payment Reminders**") + if st.button("๐Ÿ“ฑ Send Payment Reminders to All", type="primary") and whatsapp_manager: + st.info("This would send payment reminders to all customers with pending payments") + else: + st.success("๐ŸŽ‰ All payments are cleared! No pending payments.") + + except Exception as e: + st.error(f"Error loading payment data: {e}") + +def show_product_announcements_section(db, customers_data, whatsapp_manager): + """Show new product announcement system""" + st.write("### ๐Ÿ†• New Product Announcements") + + # Target segments for new products + segment = st.selectbox("Target Segment", + ["All Customers", "High Value Customers", "Specific Village", "Previous Product Buyers"]) + + message_template = st.text_area("Announcement Message", + height=100, + value="Hello {name}! We have exciting new products available. Reply YES for details!") + + if st.button("๐Ÿ“ข Send Announcement", type="primary") and whatsapp_manager: + st.success("Ready to send announcement to selected segment!") + +def show_feedback_section(db, customers_data, whatsapp_manager): + """Show customer feedback collection system""" + st.write("### ๐Ÿ’ฌ Customer Feedback Collection") + + feedback_segment = st.selectbox("Request Feedback From", + ["Recent Customers", "High Value Customers", "Inactive Customers"]) + + feedback_message = st.text_area("Feedback Request Message", + height=100, + value="Hello {name}! We value your feedback. How was your experience with us?") + + if st.button("๐Ÿ“ Request Feedback", type="primary") and whatsapp_manager: + st.info("Feedback requests ready to send!") + +def show_customer_directory_tab(db): + """Show comprehensive customer directory""" + st.subheader("๐Ÿ” Customer Directory") + + try: + customers_data = get_customer_analytics_data(db) + + if customers_data.empty: + st.info("No customers found in the database.") + return + + # Filters + col1, col2, col3 = st.columns(3) + + with col1: + village_filter = st.multiselect("Filter by Village", customers_data['village'].unique()) + + with col2: + purchase_filter = st.selectbox("Filter by Purchase History", + ["All", "Has Purchases", "No Purchases", "Multiple Purchases"]) + + with col3: + search_term = st.text_input("Search by Name/Mobile") + + # Apply filters + filtered_customers = customers_data.copy() + + if village_filter: + filtered_customers = filtered_customers[filtered_customers['village'].isin(village_filter)] + + if purchase_filter == "Has Purchases": + filtered_customers = filtered_customers[filtered_customers['total_purchases'] > 0] + elif purchase_filter == "No Purchases": + filtered_customers = filtered_customers[filtered_customers['total_purchases'] == 0] + elif purchase_filter == "Multiple Purchases": + filtered_customers = filtered_customers[filtered_customers['total_purchases'] > 1] + + if search_term: + filtered_customers = filtered_customers[ + filtered_customers['name'].str.contains(search_term, case=False, na=False) | + filtered_customers['mobile'].str.contains(search_term, na=False) + ] + + # Display results + st.write(f"**Found {len(filtered_customers)} customers**") + + display_columns = ['name', 'village', 'mobile', 'total_purchases', 'total_spent'] + display_df = filtered_customers[display_columns] + display_df.columns = ['Name', 'Village', 'Mobile', 'Total Purchases', 'Total Spent (โ‚น)'] + display_df['Total Spent (โ‚น)'] = display_df['Total Spent (โ‚น)'].apply(lambda x: f"โ‚น{x:,.0f}") + + st.dataframe(display_df, use_container_width=True) + + except Exception as e: + st.error(f"Error loading customer directory: {e}") + +def get_customer_analytics_data(db): + """Get comprehensive customer data with analytics""" + try: + customers = db.get_dataframe('customers', ''' + SELECT c.*, + COUNT(s.sale_id) as total_purchases, + COALESCE(SUM(s.total_amount), 0) as total_spent, + MAX(s.sale_date) as last_purchase_date + FROM customers c + LEFT JOIN sales s ON c.customer_id = s.customer_id + GROUP BY c.customer_id + ORDER BY total_spent DESC + ''') + return customers + except Exception as e: + st.error(f"Error loading customer analytics data: {e}") + return pd.DataFrame() \ No newline at end of file diff --git a/pages/dashboard.py b/pages/dashboard.py new file mode 100644 index 0000000000000000000000000000000000000000..b5e3c3a9b8a6d9ff5c1bf25f97060163d42b84d0 --- /dev/null +++ b/pages/dashboard.py @@ -0,0 +1,121 @@ +# pages/dashboard.py +import streamlit as st +from utils.styling import create_metric_card, COLORS +import plotly.express as px + +def create_dashboard(db, analytics): + """Create the main dashboard with metrics and charts""" + st.markdown("

๐Ÿ“Š Sales Dashboard

", unsafe_allow_html=True) + + # Check if components are available + if not analytics or not db: + st.error("Analytics or Database not available. Please check the initialization.") + return + + # Key Metrics + try: + sales_summary = analytics.get_sales_summary() + demo_stats = analytics.get_demo_conversion_rates() + customer_analysis = analytics.get_customer_analysis() + payment_analysis = analytics.get_payment_analysis() + except Exception as e: + st.error(f"Error loading analytics: {e}") + sales_summary = {'total_sales': 0, 'pending_amount': 0} + demo_stats = {'conversion_rate': 0} + customer_analysis = {'total_customers': 0} + payment_analysis = {'total_pending': 0} + + # Top row metrics + col1, col2, col3, col4 = st.columns(4) + + with col1: + st.markdown(create_metric_card( + f"โ‚น{sales_summary.get('total_sales', 0):,.0f}", + "Total Sales", "๐Ÿ’ฐ", COLORS['primary'] + ), unsafe_allow_html=True) + + with col2: + st.markdown(create_metric_card( + f"โ‚น{sales_summary.get('pending_amount', 0):,.0f}", + "Pending Payments", "โณ", COLORS['warning'] + ), unsafe_allow_html=True) + + with col3: + st.markdown(create_metric_card( + f"{demo_stats.get('conversion_rate', 0):.1f}%", + "Demo Conversion", "๐ŸŽฏ", COLORS['success'] + ), unsafe_allow_html=True) + + with col4: + st.markdown(create_metric_card( + f"{customer_analysis.get('total_customers', 0)}", + "Total Customers", "๐Ÿ‘ฅ", COLORS['secondary'] + ), unsafe_allow_html=True) + + # Charts and Visualizations + col1, col2 = st.columns(2) + + with col1: + st.markdown("

Sales Trend

", unsafe_allow_html=True) + try: + sales_trend = analytics.get_sales_trend() + if not sales_trend.empty: + fig = px.line(sales_trend, x='sale_date', y='total_amount', + title='Daily Sales Trend', color_discrete_sequence=[COLORS['primary']]) + st.plotly_chart(fig, use_container_width=True) + else: + st.info("No sales data available for trend analysis") + except Exception as e: + st.error(f"Error loading sales trend: {e}") + + with col2: + st.markdown("

Payment Status

", unsafe_allow_html=True) + try: + payment_data = analytics.get_payment_distribution() + if not payment_data.empty: + fig = px.pie(payment_data, values='amount', names='payment_method', + title='Payment Methods Distribution', color_discrete_sequence=px.colors.qualitative.Set3) + st.plotly_chart(fig, use_container_width=True) + else: + st.info("No payment data available") + except Exception as e: + st.error(f"Error loading payment data: {e}") + + # Recent Activity + col1, col2 = st.columns(2) + + with col1: + st.markdown("

Recent Sales

", unsafe_allow_html=True) + try: + recent_sales = db.get_dataframe('sales', ''' + SELECT s.*, c.name as customer_name, c.village + FROM sales s + JOIN customers c ON s.customer_id = c.customer_id + ORDER BY s.created_date DESC LIMIT 8 + ''') + if not recent_sales.empty: + st.dataframe(recent_sales[['invoice_no', 'customer_name', 'village', 'total_amount', 'sale_date']], + use_container_width=True) + else: + st.info("No recent sales found") + except Exception as e: + st.error(f"Error loading recent sales: {e}") + + with col2: + st.markdown("

Upcoming Demos

", unsafe_allow_html=True) + try: + upcoming_demos = db.get_dataframe('demos', ''' + SELECT d.*, c.name as customer_name, p.product_name + FROM demos d + LEFT JOIN customers c ON d.customer_id = c.customer_id + LEFT JOIN products p ON d.product_id = p.product_id + WHERE d.demo_date >= date('now') + ORDER BY d.demo_date ASC LIMIT 8 + ''') + if not upcoming_demos.empty: + st.dataframe(upcoming_demos[['customer_name', 'product_name', 'demo_date', 'follow_up_date']], + use_container_width=True) + else: + st.info("No upcoming demos scheduled") + except Exception as e: + st.error(f"Error loading upcoming demos: {e}") \ No newline at end of file diff --git a/pages/data_import.py b/pages/data_import.py new file mode 100644 index 0000000000000000000000000000000000000000..180561919722a00e02cd26598d8666a36de52746 --- /dev/null +++ b/pages/data_import.py @@ -0,0 +1,104 @@ +# pages/data_import.py +import streamlit as st +import os +import glob +from datetime import datetime + +def show_data_import_page(db, data_processor): + """Show data import page""" + st.title("๐Ÿ“ค Data Import & Processing") + + if not data_processor: + st.error("Data processor not available. Please check initialization.") + return + + data_dir = "data" + if os.path.exists(data_dir): + excel_files = glob.glob(os.path.join(data_dir, "*.xlsx")) + glob.glob(os.path.join(data_dir, "*.xls")) + + if excel_files: + st.subheader("๐Ÿ“ Existing Files in Data Folder") + + for file_path in excel_files: + file_name = os.path.basename(file_path) + file_size = os.path.getsize(file_path) / 1024 + file_mtime = datetime.fromtimestamp(os.path.getmtime(file_path)) + + col1, col2, col3 = st.columns([3, 2, 1]) + with col1: + st.write(f"**{file_name}**") + st.write(f"Size: {file_size:.1f} KB | Modified: {file_mtime.strftime('%Y-%m-%d %H:%M')}") + with col2: + if st.button(f"๐Ÿ”„ Process", key=f"process_{file_name}"): + try: + if data_processor.process_excel_file(file_path): + st.success(f"โœ… Processed: {file_name}") + st.rerun() + else: + st.warning(f"โš ๏ธ No data processed from: {file_name}") + except Exception as e: + st.error(f"โŒ Error processing {file_name}: {str(e)}") + with col3: + if st.button(f"๐Ÿ—‘๏ธ Delete", key=f"delete_{file_name}"): + try: + os.remove(file_path) + st.success(f"โœ… Deleted: {file_name}") + st.rerun() + except Exception as e: + st.error(f"Error deleting file: {e}") + + if st.button("๐Ÿ”„ Process All Files", type="primary"): + success_count = 0 + for file_path in excel_files: + try: + if data_processor.process_excel_file(file_path): + success_count += 1 + except Exception as e: + st.error(f"Error processing {os.path.basename(file_path)}: {str(e)}") + st.success(f"โœ… Processed {success_count}/{len(excel_files)} files successfully!") + if success_count > 0: + st.rerun() + else: + st.info("No Excel files found in the data folder.") + else: + os.makedirs(data_dir, exist_ok=True) + st.info("Data folder created. Upload Excel files to get started.") + + st.subheader("๐Ÿ“ค Upload New Excel File") + uploaded_file = st.file_uploader("Choose Excel file", type=['xlsx', 'xls']) + + if uploaded_file: + file_path = os.path.join("data", uploaded_file.name) + with open(file_path, "wb") as f: + f.write(uploaded_file.getbuffer()) + + st.success(f"โœ… File saved: {uploaded_file.name}") + + if st.button(f"๐Ÿ”„ Process {uploaded_file.name}"): + try: + if data_processor.process_excel_file(file_path): + st.success(f"โœ… Processed: {uploaded_file.name}") + + # Show data preview + st.subheader("๐Ÿ“Š Imported Data Preview") + try: + customers = db.get_dataframe('customers') + sales = db.get_dataframe('sales') + + col1, col2 = st.columns(2) + with col1: + st.metric("Customers", len(customers)) + if not customers.empty: + st.dataframe(customers.tail(3), use_container_width=True) + with col2: + st.metric("Sales", len(sales)) + if not sales.empty: + st.dataframe(sales.tail(3), use_container_width=True) + except Exception as e: + st.error(f"Error loading preview data: {e}") + + st.rerun() + else: + st.warning(f"โš ๏ธ No data processed from: {uploaded_file.name}") + except Exception as e: + st.error(f"โŒ Error processing {uploaded_file.name}: {str(e)}") \ No newline at end of file diff --git a/pages/demos.py b/pages/demos.py new file mode 100644 index 0000000000000000000000000000000000000000..7c9d2fdd99ec5249849a27593d48bed4b5f9b128 --- /dev/null +++ b/pages/demos.py @@ -0,0 +1,528 @@ +# pages/demos.py +import streamlit as st +import pandas as pd +import plotly.express as px +from datetime import datetime, timedelta + +def show_demos_page(db, whatsapp_manager=None): + """Show demo management and tracking page""" + st.title("๐ŸŽฏ Demo Management Center") + + if not db: + st.error("Database not available. Please check initialization.") + return + + # Tabs for different demo functions + tab1, tab2, tab3, tab4 = st.tabs(["โž• Schedule Demo", "๐Ÿ“‹ Demo Calendar", "๐Ÿ“Š Demo Analytics", "๐Ÿ”„ Follow-ups"]) + + with tab1: + show_schedule_demo_tab(db, whatsapp_manager) + + with tab2: + show_demo_calendar_tab(db) + + with tab3: + show_demo_analytics_tab(db) + + with tab4: + show_follow_ups_tab(db, whatsapp_manager) + +def show_schedule_demo_tab(db, whatsapp_manager): + """Show form to schedule new demos""" + st.subheader("โž• Schedule New Demo") + + with st.form("schedule_demo_form"): + st.markdown("### ๐Ÿ‘ฅ Demo Information") + + col1, col2 = st.columns(2) + + with col1: + # Customer selection + customers = db.get_dataframe('customers', "SELECT customer_id, name, village FROM customers") + if not customers.empty: + customer_options = {f"{row['name']} ({row['village']})": row['customer_id'] + for _, row in customers.iterrows()} + selected_customer = st.selectbox("Select Customer*", options=list(customer_options.keys())) + customer_id = customer_options[selected_customer] if selected_customer else None + else: + st.warning("No customers found. Please add customers first.") + customer_id = None + + # Distributor selection + distributors = db.get_dataframe('distributors', "SELECT distributor_id, name, village FROM distributors") + if not distributors.empty: + distributor_options = {f"{row['name']} ({row['village']})": row['distributor_id'] + for _, row in distributors.iterrows()} + selected_distributor = st.selectbox("Assign Distributor", options=[""] + list(distributor_options.keys())) + distributor_id = distributor_options[selected_distributor] if selected_distributor else None + else: + distributor_id = None + + with col2: + # Product selection + products = db.get_dataframe('products', "SELECT product_id, product_name FROM products WHERE is_active = 1") + if not products.empty: + product_options = {row['product_name']: row['product_id'] for _, row in products.iterrows()} + selected_product = st.selectbox("Product to Demo*", options=list(product_options.keys())) + product_id = product_options[selected_product] if selected_product else None + else: + st.warning("No products found. Please add products first.") + product_id = None + + # Demo details + demo_date = st.date_input("Demo Date*", datetime.now()) + demo_time = st.time_input("Demo Time", datetime.now().time()) + + st.markdown("### ๐Ÿ“ Demo Details") + + col1, col2 = st.columns(2) + + with col1: + quantity_provided = st.number_input("Quantity Provided", min_value=0, value=1, + help="Number of units provided for demo") + demo_location = st.selectbox("Demo Location", ["Customer Home", "Distributor Office", "Public Place", "Other"]) + + with col2: + follow_up_date = st.date_input("Follow-up Date", datetime.now() + timedelta(days=7)) + conversion_status = st.selectbox("Initial Status", ["Scheduled", "Completed", "Cancelled"]) + + notes = st.text_area("Demo Notes", placeholder="Any special instructions, customer requirements, or observations...") + + # Submit button + submitted = st.form_submit_button("๐ŸŽฏ Schedule Demo", type="primary") + + if submitted: + # Validation + errors = [] + if not customer_id: + errors.append("Customer selection is required") + if not product_id: + errors.append("Product selection is required") + if not demo_date: + errors.append("Demo date is required") + + if errors: + for error in errors: + st.error(f"โŒ {error}") + else: + try: + # Combine date and time + demo_datetime = datetime.combine(demo_date, demo_time) + + # Add demo to database + demo_id = add_demo_to_database(db, { + 'customer_id': customer_id, + 'distributor_id': distributor_id, + 'product_id': product_id, + 'demo_date': demo_datetime.date(), + 'demo_time': demo_time, + 'quantity_provided': quantity_provided, + 'follow_up_date': follow_up_date, + 'conversion_status': conversion_status, + 'notes': notes, + 'demo_location': demo_location + }) + + if demo_id and demo_id > 0: + st.success(f"โœ… Demo scheduled successfully! Demo ID: {demo_id}") + + # Send notification if WhatsApp available + if whatsapp_manager and customer_id: + send_demo_notification(whatsapp_manager, db, customer_id, demo_datetime, product_id) + + # Show demo summary + show_demo_summary(db, demo_id) + + else: + st.error("โŒ Failed to schedule demo. Please try again.") + + except Exception as e: + st.error(f"โŒ Error scheduling demo: {e}") + +def add_demo_to_database(db, demo_data): + """Add demo record to database""" + try: + db.execute_query(''' + INSERT INTO demos (customer_id, distributor_id, product_id, demo_date, demo_time, + quantity_provided, follow_up_date, conversion_status, notes, demo_location) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) + ''', ( + demo_data['customer_id'], + demo_data['distributor_id'], + demo_data['product_id'], + demo_data['demo_date'], + demo_data['demo_time'].strftime('%H:%M:%S') if demo_data['demo_time'] else None, + demo_data['quantity_provided'], + demo_data['follow_up_date'], + demo_data['conversion_status'], + demo_data['notes'], + demo_data['demo_location'] + ), log_action=False) + + # Get the inserted demo_id + result = db.execute_query('SELECT last_insert_rowid()', log_action=False) + return result[0][0] if result else -1 + + except Exception as e: + st.error(f"Database error: {e}") + return -1 + +def send_demo_notification(whatsapp_manager, db, customer_id, demo_datetime, product_id): + """Send demo notification to customer""" + try: + # Get customer and product details + customer = db.get_dataframe('customers', f"SELECT * FROM customers WHERE customer_id = {customer_id}") + product = db.get_dataframe('products', f"SELECT * FROM products WHERE product_id = {product_id}") + + if not customer.empty and not product.empty: + customer_data = customer.iloc[0] + product_data = product.iloc[0] + + if customer_data.get('mobile'): + message = f"""Hello {customer_data['name']}! ๐ŸŽ‰ + +We're excited to confirm your product demo! + +๐Ÿ“… Date: {demo_datetime.strftime('%d %b %Y')} +โฐ Time: {demo_datetime.strftime('%I:%M %p')} +๐Ÿ“ฆ Product: {product_data['product_name']} + +Our team will demonstrate the product features and answer any questions you may have. + +We look forward to meeting you! + +Best regards, +Sales Team""" + + success = whatsapp_manager.send_message(customer_data['mobile'], message) + if success: + st.success("๐Ÿ“ฑ Demo notification sent to customer!") + else: + st.warning("โš ๏ธ Could not send demo notification") + + except Exception as e: + st.warning(f"Could not send demo notification: {e}") + +def show_demo_summary(db, demo_id): + """Show summary of scheduled demo""" + try: + demo_data = db.get_dataframe('demos', f''' + SELECT d.*, c.name as customer_name, c.village, p.product_name, + dist.name as distributor_name + FROM demos d + LEFT JOIN customers c ON d.customer_id = c.customer_id + LEFT JOIN products p ON d.product_id = p.product_id + LEFT JOIN distributors dist ON d.distributor_id = dist.distributor_id + WHERE d.demo_id = {demo_id} + ''') + + if not demo_data.empty: + demo = demo_data.iloc[0] + + st.markdown("## ๐ŸŽ‰ Demo Scheduled Successfully!") + + col1, col2 = st.columns(2) + + with col1: + st.subheader("๐Ÿ‘ฅ Demo Details") + st.write(f"**Demo ID:** {demo_id}") + st.write(f"**Customer:** {demo['customer_name']}") + st.write(f"**Village:** {demo['village']}") + st.write(f"**Product:** {demo['product_name']}") + if demo['distributor_name']: + st.write(f"**Distributor:** {demo['distributor_name']}") + + with col2: + st.subheader("๐Ÿ“… Schedule") + st.write(f"**Demo Date:** {demo['demo_date']}") + if demo['demo_time']: + st.write(f"**Demo Time:** {demo['demo_time']}") + st.write(f"**Follow-up Date:** {demo['follow_up_date']}") + st.write(f"**Status:** {demo['conversion_status']}") + + # Quick actions + st.markdown("### โšก Quick Actions") + col1, col2, col3 = st.columns(3) + + with col1: + if st.button("๐Ÿ“‹ View All Demos"): + st.session_state.current_tab = "๐Ÿ“‹ Demo Calendar" + + with col2: + if st.button("โž• Schedule Another"): + st.rerun() + + with col3: + if st.button("๐Ÿ“Š View Analytics"): + st.session_state.current_tab = "๐Ÿ“Š Demo Analytics" + + except Exception as e: + st.error(f"Error displaying demo summary: {e}") + +def show_demo_calendar_tab(db): + """Show demo calendar and upcoming demos""" + st.subheader("๐Ÿ“‹ Demo Calendar & Schedule") + + try: + # Date range filter + col1, col2 = st.columns(2) + with col1: + start_date = st.date_input("Start Date", datetime.now()) + with col2: + end_date = st.date_input("End Date", datetime.now() + timedelta(days=30)) + + # Status filter + status_filter = st.multiselect("Filter by Status", + ["Scheduled", "Completed", "Cancelled", "Converted", "Not Converted"], + default=["Scheduled", "Completed"]) + + # Get demos data + demos_data = get_demos_data(db, start_date, end_date, status_filter) + + if not demos_data.empty: + st.write(f"**๐Ÿ“… Showing {len(demos_data)} demos**") + + # Upcoming demos (next 7 days) + upcoming_demos = demos_data[ + (demos_data['demo_date'] <= datetime.now().date() + timedelta(days=7)) & + (demos_data['conversion_status'] == 'Scheduled') + ] + + if not upcoming_demos.empty: + st.subheader("๐Ÿš€ Upcoming Demos (Next 7 Days)") + display_upcoming = upcoming_demos[['demo_date', 'customer_name', 'village', 'product_name', 'distributor_name']].copy() + display_upcoming.columns = ['Date', 'Customer', 'Village', 'Product', 'Distributor'] + st.dataframe(display_upcoming, use_container_width=True) + + # All demos in date range + st.subheader("๐Ÿ“‹ All Demos") + display_all = demos_data[['demo_date', 'customer_name', 'village', 'product_name', 'conversion_status', 'distributor_name']].copy() + display_all.columns = ['Date', 'Customer', 'Village', 'Product', 'Status', 'Distributor'] + display_all = display_all.sort_values('Date', ascending=False) + st.dataframe(display_all, use_container_width=True) + + # Demo statistics + st.subheader("๐Ÿ“Š Demo Statistics") + col1, col2, col3, col4 = st.columns(4) + + with col1: + total_demos = len(demos_data) + st.metric("Total Demos", total_demos) + + with col2: + scheduled = len(demos_data[demos_data['conversion_status'] == 'Scheduled']) + st.metric("Scheduled", scheduled) + + with col3: + completed = len(demos_data[demos_data['conversion_status'] == 'Completed']) + st.metric("Completed", completed) + + with col4: + converted = len(demos_data[demos_data['conversion_status'] == 'Converted']) + st.metric("Converted", converted) + + else: + st.info("No demos found for the selected criteria.") + + except Exception as e: + st.error(f"Error loading demo calendar: {e}") + +def get_demos_data(db, start_date, end_date, status_filter): + """Get demos data with filters""" + try: + query = ''' + SELECT d.*, c.name as customer_name, c.village, c.mobile, + p.product_name, dist.name as distributor_name + FROM demos d + LEFT JOIN customers c ON d.customer_id = c.customer_id + LEFT JOIN products p ON d.product_id = p.product_id + LEFT JOIN distributors dist ON d.distributor_id = dist.distributor_id + WHERE d.demo_date BETWEEN ? AND ? + ''' + + params = [start_date, end_date] + + if status_filter: + placeholders = ','.join(['?' for _ in status_filter]) + query += f' AND d.conversion_status IN ({placeholders})' + params.extend(status_filter) + + query += ' ORDER BY d.demo_date, d.demo_time' + + return db.get_dataframe('demos', query, params=params) + + except Exception as e: + st.error(f"Error getting demos data: {e}") + return pd.DataFrame() + +def show_demo_analytics_tab(db): + """Show demo analytics and conversion rates""" + st.subheader("๐Ÿ“Š Demo Analytics") + + try: + # Get demo conversion data + demos_data = db.get_dataframe('demos', ''' + SELECT d.*, c.name as customer_name, c.village, + p.product_name, dist.name as distributor_name + FROM demos d + LEFT JOIN customers c ON d.customer_id = c.customer_id + LEFT JOIN products p ON d.product_id = p.product_id + LEFT JOIN distributors dist ON d.distributor_id = dist.distributor_id + ORDER BY d.demo_date DESC + ''') + + if not demos_data.empty: + # Conversion statistics + st.subheader("๐ŸŽฏ Conversion Analytics") + + col1, col2, col3, col4 = st.columns(4) + + with col1: + total_demos = len(demos_data) + st.metric("Total Demos", total_demos) + + with col2: + converted = len(demos_data[demos_data['conversion_status'] == 'Converted']) + st.metric("Converted", converted) + + with col3: + not_converted = len(demos_data[demos_data['conversion_status'] == 'Not Converted']) + st.metric("Not Converted", not_converted) + + with col4: + conversion_rate = (converted / total_demos * 100) if total_demos > 0 else 0 + st.metric("Conversion Rate", f"{conversion_rate:.1f}%") + + # Product-wise conversion + st.subheader("๐Ÿ“ฆ Product Performance") + if 'product_name' in demos_data.columns: + product_stats = demos_data.groupby('product_name').agg({ + 'demo_id': 'count', + 'conversion_status': lambda x: (x == 'Converted').sum() + }).reset_index() + product_stats.columns = ['Product', 'Total Demos', 'Converted'] + product_stats['Conversion Rate'] = (product_stats['Converted'] / product_stats['Total Demos'] * 100).round(1) + product_stats = product_stats.sort_values('Total Demos', ascending=False) + + st.dataframe(product_stats, use_container_width=True) + + # Monthly trend + st.subheader("๐Ÿ“ˆ Monthly Demo Trend") + try: + demos_data['demo_date'] = pd.to_datetime(demos_data['demo_date']) + monthly_trend = demos_data.groupby(demos_data['demo_date'].dt.to_period('M')).size() + monthly_trend.index = monthly_trend.index.astype(str) + + if not monthly_trend.empty: + fig = px.line(x=monthly_trend.index, y=monthly_trend.values, + title='Monthly Demo Trend', + labels={'x': 'Month', 'y': 'Number of Demos'}) + st.plotly_chart(fig, use_container_width=True) + except: + st.info("Could not generate monthly trend chart") + + else: + st.info("No demo data available for analytics.") + + except Exception as e: + st.error(f"Error loading demo analytics: {e}") + +def show_follow_ups_tab(db, whatsapp_manager): + """Show demo follow-ups and conversion tracking""" + st.subheader("๐Ÿ”„ Demo Follow-ups") + + try: + # Get demos needing follow-up + follow_up_data = db.get_dataframe('demos', ''' + SELECT d.*, c.name as customer_name, c.mobile, c.village, + p.product_name, dist.name as distributor_name + FROM demos d + LEFT JOIN customers c ON d.customer_id = c.customer_id + LEFT JOIN products p ON d.product_id = p.product_id + LEFT JOIN distributors dist ON d.distributor_id = dist.distributor_id + WHERE d.follow_up_date <= date('now', '+7 days') + AND d.conversion_status IN ('Completed', 'Not Converted') + ORDER BY d.follow_up_date ASC + ''') + + if not follow_up_data.empty: + # Overdue follow-ups + overdue = follow_up_data[follow_up_data['follow_up_date'] < datetime.now().date()] + if not overdue.empty: + st.warning(f"๐Ÿšจ {len(overdue)} Overdue Follow-ups!") + display_overdue = overdue[['follow_up_date', 'customer_name', 'village', 'product_name', 'conversion_status']].copy() + display_overdue.columns = ['Due Date', 'Customer', 'Village', 'Product', 'Status'] + st.dataframe(display_overdue, use_container_width=True) + + # Upcoming follow-ups + upcoming = follow_up_data[follow_up_data['follow_up_date'] >= datetime.now().date()] + if not upcoming.empty: + st.subheader("๐Ÿ“… Upcoming Follow-ups") + display_upcoming = upcoming[['follow_up_date', 'customer_name', 'village', 'product_name', 'conversion_status']].copy() + display_upcoming.columns = ['Due Date', 'Customer', 'Village', 'Product', 'Status'] + st.dataframe(display_upcoming, use_container_width=True) + + # Follow-up actions + st.subheader("๐Ÿ”„ Follow-up Actions") + selected_demo = st.selectbox("Select Demo for Follow-up", + options=[f"{row['customer_name']} - {row['product_name']} ({row['follow_up_date']})" + for _, row in follow_up_data.iterrows()]) + + if selected_demo: + demo_index = [f"{row['customer_name']} - {row['product_name']} ({row['follow_up_date']})" + for _, row in follow_up_data.iterrows()].index(selected_demo) + selected_demo_data = follow_up_data.iloc[demo_index] + + col1, col2 = st.columns(2) + + with col1: + new_status = st.selectbox("Update Conversion Status", + ["Converted", "Not Converted", "Follow-up Required", "Lost"]) + + if st.button("๐Ÿ”„ Update Status"): + update_demo_status(db, selected_demo_data['demo_id'], new_status) + st.success("โœ… Status updated successfully!") + st.rerun() + + with col2: + if whatsapp_manager and st.button("๐Ÿ“ฑ Send Follow-up Message"): + send_follow_up_message(whatsapp_manager, selected_demo_data) + st.success("โœ… Follow-up message sent!") + + else: + st.success("๐ŸŽ‰ No pending follow-ups! All demos are up to date.") + + except Exception as e: + st.error(f"Error loading follow-ups: {e}") + +def update_demo_status(db, demo_id, new_status): + """Update demo conversion status""" + try: + db.execute_query(''' + UPDATE demos SET conversion_status = ?, updated_date = CURRENT_TIMESTAMP + WHERE demo_id = ? + ''', (new_status, demo_id), log_action=False) + except Exception as e: + st.error(f"Error updating demo status: {e}") + +def send_follow_up_message(whatsapp_manager, demo_data): + """Send follow-up message for demo""" + try: + if demo_data.get('mobile'): + message = f"""Hello {demo_data['customer_name']}! ๐Ÿ‘‹ + +Following up on your {demo_data['product_name']} demo from {demo_data['demo_date']}. + +We'd love to hear about your experience and answer any questions you may have. + +Would you be interested in placing an order or scheduling another demo? + +Best regards, +Sales Team""" + + success = whatsapp_manager.send_message(demo_data['mobile'], message) + return success + return False + except Exception as e: + st.error(f"Error sending follow-up message: {e}") + return False \ No newline at end of file diff --git a/pages/distributors.py b/pages/distributors.py new file mode 100644 index 0000000000000000000000000000000000000000..cd772ca1851ead6e7ee8bc539e3d1e47ce6a99da --- /dev/null +++ b/pages/distributors.py @@ -0,0 +1,971 @@ +# pages/distributors.py +import streamlit as st +import pandas as pd +import plotly.express as px +import plotly.graph_objects as go +from datetime import datetime, timedelta +import numpy as np +# pages/distributors.py +import streamlit as st +import pandas as pd +import plotly.express as px +import plotly.graph_objects as go +from datetime import datetime, timedelta +import numpy as np + +def show_distributors_page(db, whatsapp_manager=None): + """Show intelligent distributors network optimization hub""" + st.title("๐Ÿค Distributor Network Intelligence") + + if not db: + st.error("Database not available. Please check initialization.") + return + + # Tabs for different distributor functions + tab1, tab2, tab3, tab4, tab5, tab6 = st.tabs(["๐Ÿ† Performance Dashboard", "โž• Add New Distributor", + "๐Ÿ—บ๏ธ Territory Analysis", "๐Ÿ“ˆ Growth Opportunities", + "๐Ÿ‘ฅ Team Management", "๐Ÿ” Distributor Directory"]) + + with tab1: + show_performance_dashboard_tab(db) + + with tab2: + show_add_distributor_tab(db, whatsapp_manager) + + with tab3: + show_territory_analysis_tab(db) + + with tab4: + show_growth_opportunities_tab(db) + + with tab5: + show_team_management_tab(db, whatsapp_manager) + + with tab6: + show_distributor_directory_tab(db) + +def show_add_distributor_tab(db, whatsapp_manager): + """Show form to add new distributors with comprehensive data collection""" + st.subheader("โž• Add New Distributor") + + with st.form("add_distributor_form", clear_on_submit=True): + st.markdown("### ๐Ÿ“‹ Basic Information") + + col1, col2 = st.columns(2) + + with col1: + distributor_name = st.text_input("Distributor Name*", placeholder="Enter distributor name") + village = st.text_input("Village*", placeholder="Enter village name") + taluka = st.text_input("Taluka*", placeholder="Enter taluka name") + district = st.text_input("District", placeholder="Enter district name") + + with col2: + mantri_name = st.text_input("Mantri Name*", placeholder="Enter mantri name") + mantri_mobile = st.text_input("Mantri Mobile*", placeholder="Enter 10-digit mobile number") + # Remove status for now since your function doesn't have it + # status = st.selectbox("Status", ["Active", "Inactive", "Prospective"], index=0) + + st.markdown("### ๐Ÿ“Š Network Information") + + col1, col2 = st.columns(2) + + with col1: + sabhasad_count = st.number_input("Current Sabhasad Count", min_value=0, value=0) + contact_in_group = st.number_input("Contacts in WhatsApp Group", min_value=0, value=0) + + with col2: + potential_sabhasad = st.number_input("Potential Sabhasad (6 months)", min_value=0, value=0) + market_coverage = st.slider("Market Coverage (%)", 0, 100, 50) + + # Quick duplicate check + if distributor_name and village and taluka: + if db.distributor_exists(distributor_name, village, taluka): + st.warning("โš ๏ธ A distributor with this name already exists in this location!") + + # Submit button + submitted = st.form_submit_button("๐Ÿš€ Add Distributor to Network", type="primary") + + if submitted: + # Validation + errors = [] + if not distributor_name: + errors.append("Distributor name is required") + if not village: + errors.append("Village is required") + if not taluka: + errors.append("Taluka is required") + if not mantri_name: + errors.append("Mantri name is required") + if not mantri_mobile or len(mantri_mobile) < 10: + errors.append("Valid mobile number is required (10 digits)") + + if errors: + for error in errors: + st.error(f"โŒ {error}") + else: + try: + # Add distributor to database - WITHOUT status parameter + distributor_id = db.add_distributor( + name=distributor_name, + village=village, + taluka=taluka, + district=district, + mantri_name=mantri_name, + mantri_mobile=mantri_mobile, + sabhasad_count=sabhasad_count, + contact_in_group=contact_in_group + # status=status # Remove this line since your function doesn't have it + ) + + if distributor_id and distributor_id > 0: + st.success(f"โœ… Distributor '{distributor_name}' added successfully!") + + # Store additional metrics + save_distributor_metrics(db, distributor_id, { + 'potential_sabhasad': potential_sabhasad, + 'market_coverage': market_coverage, + 'notes': "Added via distributor form" + }) + + # Show success summary + show_distributor_summary(db, distributor_id) + + # Send welcome message + if whatsapp_manager and mantri_mobile: + send_welcome_message(whatsapp_manager, mantri_mobile, distributor_name) + + else: + st.error("โŒ Failed to add distributor. Please try again.") + + except Exception as e: + st.error(f"โŒ Error adding distributor: {e}") + +def calculate_potential_score(sabhasad_count, contact_in_group, potential_sabhasad, + market_coverage, leadership_quality, community_influence, + business_experience, has_vehicle, digital_literacy): + """Calculate distributor potential score (0-100)""" + score = 0 + + # Network factors (40%) + score += min(sabhasad_count * 2, 20) # Max 20 points for current sabhasad + score += min(contact_in_group * 0.2, 10) # Max 10 points for contacts + score += min(potential_sabhasad * 1.5, 10) # Max 10 points for potential + + # Market factors (20%) + score += market_coverage * 0.2 # 20 points for coverage + + # Personal factors (25%) + leadership_scores = {"Low": 0, "Medium": 5, "High": 8, "Very High": 10} + score += leadership_scores.get(leadership_quality, 0) + + influence_scores = {"Low": 0, "Medium": 5, "High": 8, "Very High": 10} + score += influence_scores.get(community_influence, 0) + + experience_scores = {"None": 0, "1-2 years": 2, "3-5 years": 3, "5+ years": 5} + score += experience_scores.get(business_experience, 0) + + # Infrastructure factors (15%) + if has_vehicle: + score += 5 + digital_scores = {"Basic": 2, "Intermediate": 4, "Advanced": 6} + score += digital_scores.get(digital_literacy, 0) + + return min(score, 100) + +def save_distributor_metrics(db, distributor_id, metrics): + """Save additional distributor metrics""" + try: + # Create metrics table if not exists + db.execute_query(''' + CREATE TABLE IF NOT EXISTS distributor_metrics ( + metric_id INTEGER PRIMARY KEY AUTOINCREMENT, + distributor_id INTEGER, + potential_sabhasad INTEGER, + market_coverage INTEGER, + monthly_target REAL, + current_business_value REAL, + has_vehicle BOOLEAN, + vehicle_type TEXT, + storage_capacity TEXT, + whatsapp_active BOOLEAN, + digital_literacy TEXT, + uses_app BOOLEAN, + business_experience TEXT, + sales_background BOOLEAN, + leadership_quality TEXT, + community_influence TEXT, + known_in_village BOOLEAN, + reference_source TEXT, + potential_score REAL, + notes TEXT, + created_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + FOREIGN KEY (distributor_id) REFERENCES distributors (distributor_id) ON DELETE CASCADE + ) + ''', log_action=False) + + # Insert metrics + db.execute_query(''' + INSERT INTO distributor_metrics ( + distributor_id, potential_sabhasad, market_coverage, monthly_target, + current_business_value, has_vehicle, vehicle_type, storage_capacity, + whatsapp_active, digital_literacy, uses_app, business_experience, + sales_background, leadership_quality, community_influence, known_in_village, + reference_source, potential_score, notes + ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) + ''', ( + distributor_id, metrics['potential_sabhasad'], metrics['market_coverage'], + metrics['monthly_target'], metrics['current_business_value'], + metrics['has_vehicle'], metrics['vehicle_type'], metrics['storage_capacity'], + metrics['whatsapp_active'], metrics['digital_literacy'], metrics['uses_app'], + metrics['business_experience'], metrics['sales_background'], + metrics['leadership_quality'], metrics['community_influence'], + metrics['known_in_village'], metrics['reference_source'], + metrics['potential_score'], metrics['notes'] + ), log_action=False) + + except Exception as e: + st.warning(f"Could not save additional metrics: {e}") + +def show_distributor_summary(name, village, taluka, mantri_name, sabhasad_count, + contact_in_group, potential_sabhasad, potential_score, monthly_target): + """Show summary of newly added distributor""" + st.markdown("## ๐ŸŽ‰ Distributor Added Successfully!") + + col1, col2 = st.columns(2) + + with col1: + st.subheader("๐Ÿ‘ค Basic Information") + st.write(f"**Name:** {name}") + st.write(f"**Village:** {village}") + st.write(f"**Taluka:** {taluka}") + st.write(f"**Mantri:** {mantri_name}") + + with col2: + st.subheader("๐Ÿ“Š Network Metrics") + st.write(f"**Current Sabhasad:** {sabhasad_count}") + st.write(f"**WhatsApp Contacts:** {contact_in_group}") + st.write(f"**Potential Sabhasad:** {potential_sabhasad}") + st.write(f"**Monthly Target:** โ‚น{monthly_target:,.0f}") + + st.subheader("๐ŸŽฏ Potential Assessment") + + # Potential score visualization + col1, col2, col3 = st.columns([1, 2, 1]) + + with col2: + # Create gauge chart for potential score + fig = go.Figure(go.Indicator( + mode = "gauge+number+delta", + value = potential_score, + domain = {'x': [0, 1], 'y': [0, 1]}, + title = {'text': "Potential Score"}, + delta = {'reference': 50}, + gauge = { + 'axis': {'range': [None, 100]}, + 'bar': {'color': "darkblue"}, + 'steps': [ + {'range': [0, 40], 'color': "lightgray"}, + {'range': [40, 70], 'color': "gray"}, + {'range': [70, 100], 'color': "lightblue"} + ], + 'threshold': { + 'line': {'color': "red", 'width': 4}, + 'thickness': 0.75, + 'value': 90 + } + } + )) + + fig.update_layout(height=300) + st.plotly_chart(fig, use_container_width=True) + + # Action recommendations based on score + st.subheader("๐Ÿ’ก Recommended Actions") + + if potential_score >= 80: + st.success("**๐ŸŽฏ High Potential Distributor**") + st.write("- Provide advanced training materials") + st.write("- Set ambitious growth targets") + st.write("- Consider for leadership role") + st.write("- Regular high-level engagement") + + elif potential_score >= 60: + st.info("**๐Ÿ“ˆ Good Potential Distributor**") + st.write("- Standard training program") + st.write("- Moderate growth targets") + st.write("- Regular follow-ups") + st.write("- Support with marketing materials") + + elif potential_score >= 40: + st.warning("**๐Ÿ”„ Moderate Potential Distributor**") + st.write("- Basic training focus") + st.write("- Conservative targets") + st.write("- Close monitoring needed") + st.write("- Additional support required") + + else: + st.error("**โš ๏ธ Needs Development**") + st.write("- Intensive training program") + st.write("- Small, achievable targets") + st.write("- Frequent check-ins") + st.write("- Consider mentorship") + +def send_welcome_message(whatsapp_manager, mobile, distributor_name): + """Send welcome message to new distributor""" + try: + message = f"""Welcome {distributor_name}! ๐ŸŽ‰ + +Thank you for joining our distributor network! + +We're excited to have you on board and look forward to working together to grow your business. + +Our team will contact you shortly to discuss: +โ€ข Training schedule +โ€ข Product information +โ€ข Sales strategies +โ€ข Support systems + +For any immediate queries, feel free to contact us. + +Best regards, +Sales Team""" + + success = whatsapp_manager.send_message(mobile, message) + if success: + st.success("๐Ÿ“ฑ Welcome message sent to distributor!") + else: + st.warning("โš ๏ธ Could not send welcome message") + + except Exception as e: + st.warning(f"Could not send welcome message: {e}") + +# Keep all your existing functions (show_performance_dashboard_tab, show_territory_analysis_tab, etc.) +# ... [rest of your existing functions remain unchanged] + +def show_performance_dashboard_tab(db): + """Show distributor performance dashboard""" + st.subheader("๐Ÿ† Distributor Performance Dashboard") + + try: + distributors_data = get_distributor_analytics_data(db) + + if distributors_data.empty: + st.info("No distributor data available yet.") + return + + except: + pass +def show_distributors_page(db, whatsapp_manager=None): + """Show intelligent distributors network optimization hub""" + st.title("๐Ÿค Distributor Network Intelligence") + + if not db: + st.error("Database not available. Please check initialization.") + return + + # Tabs for different distributor functions + tab1, tab2, tab3, tab4, tab5 ,tab6= st.tabs(["๐Ÿ† Performance Dashboard", "๐Ÿ—บ๏ธ Territory Analysis", + "๐Ÿ“ˆ Growth Opportunities", "๐Ÿ‘ฅ Team Management", + "๐Ÿ” Distributor Directory","โž•Add new distributor"]) + + with tab1: + show_performance_dashboard_tab(db) + + with tab2: + show_territory_analysis_tab(db) + + with tab3: + show_growth_opportunities_tab(db) + + with tab4: + show_team_management_tab(db, whatsapp_manager) + + with tab5: + show_distributor_directory_tab(db) + + with tab6: + show_add_distributor_tab(db) + +def show_performance_dashboard_tab(db): + """Show distributor performance dashboard""" + st.subheader("๐Ÿ† Distributor Performance Dashboard") + + try: + distributors_data = get_distributor_analytics_data(db) + + if distributors_data.empty: + st.info("No distributor data available yet.") + return + + # Key Performance Indicators + st.subheader("๐ŸŽฏ Key Performance Indicators") + col1, col2, col3, col4 = st.columns(4) + + with col1: + total_distributors = len(distributors_data) + st.metric("Total Distributors", total_distributors) + + with col2: + active_distributors = len(distributors_data[distributors_data['total_customers'] > 0]) + st.metric("Active Distributors", active_distributors) + + with col3: + avg_sabhasad_per_dist = distributors_data['sabhasad_count'].mean() + st.metric("Avg Sabhasad/Dist", f"{avg_sabhasad_per_dist:.1f}") + + with col4: + total_network_size = distributors_data['sabhasad_count'].sum() + total_distributors + st.metric("Total Network Size", total_network_size) + + # Performance Tiers + st.subheader("๐Ÿ“Š Performance Tiers") + + # Define performance tiers based on sabhasad count + distributors_data['performance_tier'] = distributors_data['sabhasad_count'].apply( + lambda x: 'Platinum' if x >= 20 else 'Gold' if x >= 10 else 'Silver' if x >= 5 else 'Bronze' + ) + + tier_stats = distributors_data['performance_tier'].value_counts() + + col1, col2 = st.columns(2) + + with col1: + fig = px.pie(values=tier_stats.values, names=tier_stats.index, + title='Distributor Performance Tier Distribution', + color=tier_stats.index, + color_discrete_map={'Platinum': '#FFD700', 'Gold': '#C0C0C0', + 'Silver': '#CD7F32', 'Bronze': '#8C7853'}) + st.plotly_chart(fig, use_container_width=True) + + with col2: + # Top performers + top_performers = distributors_data.nlargest(5, 'sabhasad_count')[ + ['name', 'village', 'sabhasad_count', 'contact_in_group'] + ] + top_performers.columns = ['Distributor', 'Village', 'Sabhasad', 'Contacts'] + + st.write("**๐Ÿ… Top 5 Performers**") + st.dataframe(top_performers, use_container_width=True) + + # Geographic Performance Heatmap + st.subheader("๐Ÿ—บ๏ธ Geographic Performance Distribution") + + village_performance = distributors_data.groupby('village').agg({ + 'distributor_id': 'count', + 'sabhasad_count': 'sum', + 'contact_in_group': 'sum' + }).reset_index() + village_performance.columns = ['Village', 'Distributors', 'Total Sabhasad', 'Total Contacts'] + village_performance = village_performance.sort_values('Total Sabhasad', ascending=False) + + if not village_performance.empty: + fig = px.bar(village_performance.head(10), x='Village', y='Total Sabhasad', + title='Top 10 Villages by Sabhasad Network Size', + color='Total Sabhasad', + labels={'Total Sabhasad': 'Sabhasad Count'}) + st.plotly_chart(fig, use_container_width=True) + + # Performance Trends (if we had date data) + st.subheader("๐Ÿ“ˆ Network Growth Potential") + + # Calculate network density score + distributors_data['network_score'] = ( + distributors_data['sabhasad_count'] * 0.6 + + distributors_data['contact_in_group'] * 0.4 + ) + + # Identify high-potential distributors + high_potential = distributors_data[ + (distributors_data['sabhasad_count'] < 10) & + (distributors_data['contact_in_group'] > 20) + ] + + if not high_potential.empty: + st.write(f"**๐Ÿ’Ž {len(high_potential)} High-Potential Distributors Identified**") + st.write("These distributors have good contact base but low sabhasad conversion") + st.dataframe(high_potential[['name', 'village', 'sabhasad_count', 'contact_in_group']], + use_container_width=True) + + except Exception as e: + st.error(f"Error loading performance dashboard: {e}") + +def show_territory_analysis_tab(db): + """Show territory coverage and gap analysis""" + st.subheader("๐Ÿ—บ๏ธ Territory Coverage Analysis") + + try: + distributors_data = get_distributor_analytics_data(db) + customers_data = get_customer_analytics_data(db) + + if distributors_data.empty or customers_data.empty: + st.info("Insufficient data for territory analysis.") + return + + # Territory Coverage Analysis + st.subheader("๐Ÿ“ Coverage Gap Analysis") + + # Get all villages with distributors vs all villages with customers + distributor_villages = set(distributors_data['village'].dropna().unique()) + customer_villages = set(customers_data['village'].dropna().unique()) + + # Coverage analysis + covered_villages = distributor_villages.intersection(customer_villages) + uncovered_villages = customer_villages - distributor_villages + distributor_only_villages = distributor_villages - customer_villages + + col1, col2, col3 = st.columns(3) + + with col1: + st.metric("Covered Villages", len(covered_villages)) + + with col2: + st.metric("Uncovered Villages", len(uncovered_villages)) + + with col3: + st.metric("Distributor-Only Villages", len(distributor_only_villages)) + + # Coverage visualization + col1, col2 = st.columns(2) + + with col1: + coverage_data = { + 'Category': ['Covered', 'Uncovered', 'Distributor Only'], + 'Count': [len(covered_villages), len(uncovered_villages), len(distributor_only_villages)] + } + coverage_df = pd.DataFrame(coverage_data) + + fig = px.pie(coverage_df, values='Count', names='Category', + title='Village Coverage Status', + color='Category', + color_discrete_map={'Covered': '#00FF00', 'Uncovered': '#FF0000', + 'Distributor Only': '#FFFF00'}) + st.plotly_chart(fig, use_container_width=True) + + with col2: + # Customer density in uncovered areas + if uncovered_villages: + uncovered_customers = customers_data[customers_data['village'].isin(uncovered_villages)] + village_customer_count = uncovered_customers['village'].value_counts().head(10) + + if not village_customer_count.empty: + fig = px.bar(x=village_customer_count.index, y=village_customer_count.values, + title='Top Uncovered Villages by Customer Count', + labels={'x': 'Village', 'y': 'Customer Count'}) + st.plotly_chart(fig, use_container_width=True) + + # Strategic Expansion Recommendations + st.subheader("๐ŸŽฏ Strategic Expansion Recommendations") + + if uncovered_villages: + # Prioritize villages with most customers + expansion_priority = customers_data[customers_data['village'].isin(uncovered_villages)] + priority_villages = expansion_priority.groupby('village').agg({ + 'customer_id': 'count', + 'total_spent': 'sum' + }).reset_index() + priority_villages = priority_villages.sort_values('customer_id', ascending=False) + + st.write("**๐Ÿš€ High-Priority Expansion Targets**") + st.dataframe(priority_villages.head(10), use_container_width=True) + + # Expansion strategy + st.write("**๐Ÿ“‹ Recommended Expansion Strategy**") + + high_priority = priority_villages[priority_villages['customer_id'] >= 10] + medium_priority = priority_villages[(priority_villages['customer_id'] >= 5) & + (priority_villages['customer_id'] < 10)] + + if not high_priority.empty: + st.success(f"**Immediate Action Needed:** {len(high_priority)} villages with 10+ customers need distributor coverage") + + if not medium_priority.empty: + st.warning(f"**Plan Expansion:** {len(medium_priority)} villages with 5-9 customers ready for coverage") + + # Territory Optimization + st.subheader("โšก Territory Optimization") + + # Identify overcrowded territories + village_distributor_count = distributors_data['village'].value_counts() + overcrowded_villages = village_distributor_count[village_distributor_count > 2] + + if not overcrowded_villages.empty: + st.write("**๐Ÿ™๏ธ Overcrowded Territories**") + st.write("Consider redistributing some distributors from these villages:") + for village, count in overcrowded_villages.items(): + st.write(f"- {village}: {count} distributors") + + except Exception as e: + st.error(f"Error in territory analysis: {e}") + +def show_growth_opportunities_tab(db): + """Show growth opportunities and network expansion""" + st.subheader("๐Ÿ“ˆ Network Growth Opportunities") + + try: + distributors_data = get_distributor_analytics_data(db) + + if distributors_data.empty: + st.info("No distributor data available for growth analysis.") + return + + # Growth Levers Analysis + st.subheader("๐ŸŽฏ Growth Lever Analysis") + + col1, col2, col3 = st.columns(3) + + with col1: + # Sabhasad Conversion Opportunity + avg_conversion_rate = distributors_data['sabhasad_count'].sum() / distributors_data['contact_in_group'].sum() * 100 + st.metric("Avg Contact to Sabhasad Rate", f"{avg_conversion_rate:.1f}%") + + with col2: + # Underperforming distributors + underperformers = len(distributors_data[distributors_data['sabhasad_count'] < 3]) + st.metric("Distributors Needing Support", underperformers) + + with col3: + # Expansion potential + total_contacts = distributors_data['contact_in_group'].sum() + potential_sabhasad = total_contacts * 0.3 # Assuming 30% conversion potential + st.metric("Potential Sabhasad Growth", f"+{potential_sabhasad:.0f}") + + # Growth Initiatives + st.subheader("๐Ÿš€ Growth Initiatives") + + initiative = st.selectbox("Select Growth Initiative", + ["Sabhasad Conversion Drive", "New Distributor Recruitment", + "Territory Expansion", "Performance Improvement Program"]) + + if initiative == "Sabhasad Conversion Drive": + show_sabhasad_conversion_plan(db, distributors_data) + + elif initiative == "New Distributor Recruitment": + show_recruitment_plan(db, distributors_data) + + elif initiative == "Territory Expansion": + show_territory_expansion_plan(db) + + elif initiative == "Performance Improvement Program": + show_performance_improvement_plan(db, distributors_data) + + # Progress Tracking + st.subheader("๐Ÿ“Š Initiative Progress Tracking") + + # Mock progress data - in real implementation, this would come from database + progress_data = { + 'Initiative': ['Sabhasad Drive', 'Recruitment', 'Territory Expansion', 'Training'], + 'Target': [50, 10, 5, 25], + 'Achieved': [35, 7, 3, 20], + 'Completion': [70, 70, 60, 80] + } + progress_df = pd.DataFrame(progress_data) + + fig = px.bar(progress_df, x='Initiative', y='Completion', + title='Growth Initiative Progress', + labels={'Completion': 'Completion %'}, + color='Completion') + st.plotly_chart(fig, use_container_width=True) + + except Exception as e: + st.error(f"Error in growth opportunities analysis: {e}") + +def show_sabhasad_conversion_plan(db, distributors_data): + """Show sabhasad conversion growth plan""" + st.write("### ๐Ÿ“ˆ Sabhasad Conversion Drive") + + # Identify best candidates for conversion + conversion_candidates = distributors_data[ + (distributors_data['contact_in_group'] > distributors_data['sabhasad_count'] * 2) & + (distributors_data['contact_in_group'] >= 10) + ].sort_values('contact_in_group', ascending=False) + + if not conversion_candidates.empty: + st.write(f"**๐ŸŽฏ {len(conversion_candidates)} Distributors with High Conversion Potential**") + + for _, dist in conversion_candidates.head(5).iterrows(): + conversion_potential = dist['contact_in_group'] - dist['sabhasad_count'] + st.write(f"- **{dist['name']}** ({dist['village']}): {dist['sabhasad_count']} sabhasad, " + f"{dist['contact_in_group']} contacts โ†’ **+{conversion_potential} potential**") + + # Action plan + st.write("**๐Ÿ“‹ Action Plan**") + st.write("1. Conduct conversion training sessions") + st.write("2. Provide conversion scripts and materials") + st.write("3. Set weekly conversion targets") + st.write("4. Implement incentive program for conversions") + else: + st.info("No high-potential conversion candidates identified.") + +def show_recruitment_plan(db, distributors_data): + """Show new distributor recruitment plan""" + st.write("### ๐Ÿ‘ฅ New Distributor Recruitment") + + # Analyze current distribution density + village_coverage = distributors_data['village'].value_counts() + low_coverage_villages = village_coverage[village_coverage == 1] + + if not low_coverage_villages.empty: + st.write("**๐Ÿ“ Villages Needing Additional Distributors**") + for village in low_coverage_villages.index[:5]: + st.write(f"- {village}") + + # Recruitment targets + st.write("**๐ŸŽฏ Recruitment Strategy**") + st.write("- Focus on high-customer-density uncovered villages") + st.write("- Target influential community members") + st.write("- Offer attractive onboarding incentives") + st.write("- Provide comprehensive training and support") + +def show_territory_expansion_plan(db): + """Show territory expansion strategy""" + st.write("### ๐Ÿ—บ๏ธ Territory Expansion Plan") + + # This would integrate with the territory analysis data + st.write("**๐Ÿš€ Expansion Priority Areas**") + st.write("1. High customer density uncovered villages") + st.write("2. Adjacent territories to high-performing distributors") + st.write("3. Villages with existing brand awareness") + st.write("4. Areas with competitor weakness") + +def show_performance_improvement_plan(db, distributors_data): + """Show performance improvement program""" + st.write("### ๐Ÿ“Š Performance Improvement Program") + + # Identify underperformers + underperformers = distributors_data[ + (distributors_data['sabhasad_count'] < 5) & + (distributors_data['status'] == 'Active') + ] + + if not underperformers.empty: + st.write(f"**๐Ÿ”ง {len(underperformers)} Distributors Needing Performance Support**") + + for _, dist in underperformers.head(5).iterrows(): + st.write(f"- **{dist['name']}** ({dist['village']}): {dist['sabhasad_count']} sabhasad") + + # Support plan + st.write("**๐Ÿ› ๏ธ Support Initiatives**") + st.write("1. One-on-one coaching sessions") + st.write("2. Performance benchmarking") + st.write("3. Additional training resources") + st.write("4. Peer mentoring program") + +def show_team_management_tab(db, whatsapp_manager): + """Show team communication and management""" + st.subheader("๐Ÿ‘ฅ Team Management & Communication") + + try: + distributors_data = get_distributor_analytics_data(db) + + if distributors_data.empty: + st.info("No distributor data available for team management.") + return + + # Communication Center + st.subheader("๐Ÿ“ž Communication Center") + + col1, col2 = st.columns(2) + + with col1: + communication_type = st.selectbox("Communication Type", + ["Performance Update", "Training Announcement", + "Incentive Program", "Urgent Meeting", "Custom Message"]) + + with col2: + target_group = st.selectbox("Target Group", + ["All Distributors", "High Performers", "Underperformers", + "Specific Village", "Performance Tier"]) + + # Message templates + message_templates = { + "Performance Update": "Hello {name}! Your current performance: {sabhasad_count} sabhasad. Keep up the great work! ๐ŸŽฏ", + "Training Announcement": "Hello {name}! Training session this week. Learn new strategies to grow your network! ๐Ÿ“š", + "Incentive Program": "Hello {name}! New incentive program launched. Earn more with higher conversions! ๐Ÿ’ฐ", + "Urgent Meeting": "Hello {name}! Urgent meeting tomorrow. Your attendance is important! โฐ", + "Custom Message": "" + } + + message = st.text_area("Message Content", + value=message_templates[communication_type], + height=100) + + # Personalization options + st.write("**๐ŸŽจ Personalization Options**") + col1, col2 = st.columns(2) + + with col1: + include_performance = st.checkbox("Include Performance Data", value=True) + include_village = st.checkbox("Include Village", value=True) + + with col2: + urgent_tag = st.checkbox("Mark as Urgent", value=False) + request_response = st.checkbox("Request Response", value=True) + + # Send communication + if st.button("๐Ÿ“ฑ Send to Distributors", type="primary"): + # Filter target distributors + target_distributors = filter_distributors_by_criteria(distributors_data, target_group) + + if not target_distributors.empty: + st.success(f"โœ… Ready to send message to {len(target_distributors)} distributors") + + # Show preview + sample_dist = target_distributors.iloc[0] + preview_message = personalize_message(message, sample_dist, include_performance, include_village) + st.write("**Preview:**", preview_message) + else: + st.warning("No distributors match the selected criteria") + + # Team Performance Alerts + st.subheader("๐Ÿšจ Performance Alerts") + + # Low performers alert + low_performers = distributors_data[ + (distributors_data['sabhasad_count'] < 3) & + (distributors_data['status'] == 'Active') + ] + + if not low_performers.empty: + st.warning(f"๐Ÿšจ {len(low_performers)} distributors have less than 3 sabhasad") + if st.button("๐Ÿ”„ Schedule Support Calls"): + st.info("Support calls scheduled with underperforming distributors") + + # High performer recognition + high_performers = distributors_data[distributors_data['sabhasad_count'] >= 15] + if not high_performers.empty: + st.success(f"๐Ÿ† {len(high_performers)} elite performers with 15+ sabhasad") + if st.button("๐ŸŽ‰ Send Recognition"): + st.info("Recognition messages sent to top performers") + + except Exception as e: + st.error(f"Error in team management: {e}") + +def show_distributor_directory_tab(db): + """Show comprehensive distributor directory""" + st.subheader("๐Ÿ” Distributor Directory") + + try: + distributors_data = get_distributor_analytics_data(db) + + if distributors_data.empty: + st.info("No distributors found in the database.") + return + + # Advanced filtering + st.subheader("๐Ÿ” Advanced Filters") + + col1, col2, col3 = st.columns(3) + + with col1: + village_filter = st.multiselect("Filter by Village", distributors_data['village'].unique()) + performance_filter = st.selectbox("Performance Tier", + ["All", "Platinum", "Gold", "Silver", "Bronze"]) + + with col2: + sabhasad_min = st.number_input("Min Sabhasad", 0, 100, 0) + sabhasad_max = st.number_input("Max Sabhasad", 0, 100, 100) + + with col3: + status_filter = st.multiselect("Status", distributors_data['status'].unique(), + default=['Active']) + search_term = st.text_input("Search by Name/Village") + + # Apply filters + filtered_data = distributors_data.copy() + + if village_filter: + filtered_data = filtered_data[filtered_data['village'].isin(village_filter)] + + if performance_filter != "All": + filtered_data = filtered_data[filtered_data['performance_tier'] == performance_filter] + + filtered_data = filtered_data[ + (filtered_data['sabhasad_count'] >= sabhasad_min) & + (filtered_data['sabhasad_count'] <= sabhasad_max) + ] + + if status_filter: + filtered_data = filtered_data[filtered_data['status'].isin(status_filter)] + + if search_term: + filtered_data = filtered_data[ + filtered_data['name'].str.contains(search_term, case=False, na=False) | + filtered_data['village'].str.contains(search_term, case=False, na=False) + ] + + # Display results + st.write(f"**Found {len(filtered_data)} distributors**") + + display_columns = ['name', 'village', 'taluka', 'mantri_name', 'sabhasad_count', + 'contact_in_group', 'performance_tier', 'status'] + display_df = filtered_data[display_columns] + display_df.columns = ['Name', 'Village', 'Taluka', 'Mantri', 'Sabhasad', 'Contacts', 'Tier', 'Status'] + + st.dataframe(display_df, use_container_width=True) + + # Export options + if st.button("๐Ÿ“ฅ Export Distributor Data"): + csv = filtered_data.to_csv(index=False) + st.download_button( + label="Download CSV", + data=csv, + file_name=f"distributors_export_{datetime.now().strftime('%Y%m%d')}.csv", + mime="text/csv" + ) + + except Exception as e: + st.error(f"Error loading distributor directory: {e}") + +def get_distributor_analytics_data(db): + """Get comprehensive distributor data with analytics""" + try: + distributors = db.get_dataframe('distributors', ''' + SELECT d.*, + COUNT(DISTINCT c.customer_id) as total_customers, + COALESCE(SUM(s.total_amount), 0) as territory_sales + FROM distributors d + LEFT JOIN customers c ON d.village = c.village AND d.taluka = c.taluka + LEFT JOIN sales s ON c.customer_id = s.customer_id + GROUP BY d.distributor_id + ORDER BY d.sabhasad_count DESC + ''') + return distributors + except Exception as e: + st.error(f"Error loading distributor analytics data: {e}") + return pd.DataFrame() + +def get_customer_analytics_data(db): + """Get customer data for territory analysis""" + try: + customers = db.get_dataframe('customers', "SELECT * FROM customers") + return customers + except Exception as e: + return pd.DataFrame() + +def filter_distributors_by_criteria(distributors_data, criteria): + """Filter distributors based on selection criteria""" + if criteria == "All Distributors": + return distributors_data + elif criteria == "High Performers": + return distributors_data[distributors_data['sabhasad_count'] >= 10] + elif criteria == "Underperformers": + return distributors_data[distributors_data['sabhasad_count'] < 5] + elif criteria == "Specific Village": + # This would need a village selection UI in real implementation + return distributors_data + elif criteria == "Performance Tier": + # This would need a tier selection UI + return distributors_data + return distributors_data + +def personalize_message(message, distributor, include_performance=True, include_village=True): + """Personalize message for distributor""" + personalized = message.replace('{name}', distributor['name']) + + if include_performance and '{sabhasad_count}' in message: + personalized = personalized.replace('{sabhasad_count}', str(distributor['sabhasad_count'])) + + if include_village and '{village}' in message: + personalized = personalized.replace('{village}', distributor.get('village', '')) + + return personalized \ No newline at end of file diff --git a/pages/file_viewer.py b/pages/file_viewer.py new file mode 100644 index 0000000000000000000000000000000000000000..cb337f44da7edb257b90cd66484e62b8aea5fce2 --- /dev/null +++ b/pages/file_viewer.py @@ -0,0 +1,382 @@ +# pages/file_viewer.py +import streamlit as st +import pandas as pd +import os +import glob +import chardet +from datetime import datetime +import re + +try: + from deep_translator import GoogleTranslator + TRANSLATOR_AVAILABLE = True +except ImportError: + TRANSLATOR_AVAILABLE = False + +def show_file_viewer_page(db=None, data_processor=None): + """Universal file viewer for any Excel/CSV file with advanced Gujarati to English conversion""" + st.title("๐Ÿ” Universal File Viewer") + st.markdown("View and analyze any Excel or CSV file, with advanced Gujarati to English conversion using AI translation") + + if not TRANSLATOR_AVAILABLE: + st.error(""" + **Translation features require deep-translator** + Install with: `pip install deep-translator` + + Without this, only basic number conversion will work. + """) + + # File selection options + tab1, tab2 = st.tabs(["๐Ÿ“ Browse Data Folder", "๐Ÿ“ค Upload New File"]) + + with tab1: + show_data_folder_browser() + + with tab2: + show_file_uploader() + +def show_data_folder_browser(): + """Browse and view files from the data folder""" + data_dir = "data" + + if not os.path.exists(data_dir): + os.makedirs(data_dir, exist_ok=True) + st.info("Data folder created. Upload files to get started.") + return + + # Get all supported files + excel_files = glob.glob(os.path.join(data_dir, "*.xlsx")) + glob.glob(os.path.join(data_dir, "*.xls")) + csv_files = glob.glob(os.path.join(data_dir, "*.csv")) + all_files = excel_files + csv_files + + if not all_files: + st.info("No Excel or CSV files found in the data folder.") + return + + # File selection + st.subheader("๐Ÿ“‚ Select File to View") + + file_options = {os.path.basename(f): f for f in all_files} + selected_file_name = st.selectbox("Choose a file", options=list(file_options.keys())) + + if selected_file_name: + file_path = file_options[selected_file_name] + display_file_content(file_path, selected_file_name) + +def show_file_uploader(): + """Upload and view new files""" + st.subheader("๐Ÿ“ค Upload New File") + + uploaded_file = st.file_uploader( + "Choose Excel or CSV file", + type=['xlsx', 'xls', 'csv'], + help="Upload Excel (.xlsx, .xls) or CSV files for viewing" + ) + + if uploaded_file: + # Save to data folder for processing + file_path = os.path.join("data", uploaded_file.name) + with open(file_path, "wb") as f: + f.write(uploaded_file.getbuffer()) + + display_file_content(file_path, uploaded_file.name) + +def display_file_content(file_path, file_name): + """Display file content with conversion options""" + try: + # File info + file_size = os.path.getsize(file_path) / 1024 + file_mtime = datetime.fromtimestamp(os.path.getmtime(file_path)) + + col1, col2, col3 = st.columns(3) + with col1: + st.metric("File", file_name) + with col2: + st.metric("Size", f"{file_size:.1f} KB") + with col3: + st.metric("Modified", file_mtime.strftime('%Y-%m-%d %H:%M')) + + # Conversion options + st.subheader("๐Ÿ”„ Conversion Options") + + col1, col2 = st.columns(2) + with col1: + convert_gujarati = st.checkbox("Convert Gujarati to English", value=True) + with col2: + use_ai_translation = st.checkbox("Use AI Translation", + value=TRANSLATOR_AVAILABLE, + disabled=not TRANSLATOR_AVAILABLE) + + # Read file + if file_path.endswith('.csv'): + df = read_csv_file(file_path) + else: + df = read_excel_file(file_path) + + if df is None or df.empty: + st.warning("No data found in the file.") + return + + # Show original data + st.subheader("๐Ÿ“ Original Data") + display_dataframe_info(df, "Original") + + # Apply conversion if requested + if convert_gujarati: + with st.spinner("Converting Gujarati content..."): + df_converted = convert_gujarati_data_advanced(df, use_ai_translation) + + st.subheader("๐Ÿ”ค Converted Data (Gujarati โ†’ English)") + display_dataframe_info(df_converted, "Converted") + + # Show conversion summary + show_conversion_summary(df, df_converted) + + # Data analysis tools + st.subheader("๐Ÿ”ง Data Analysis Tools") + show_data_analysis_tools(df_converted if convert_gujarati else df) + + except Exception as e: + st.error(f"Error processing file: {str(e)}") + +def show_conversion_summary(original_df, converted_df): + """Show summary of Gujarati to English conversion""" + st.subheader("๐Ÿ“Š Conversion Summary") + + changes_detected = False + conversion_examples = [] + + # Check for changes + for i in range(min(3, len(original_df))): + for col in original_df.columns[:3]: + if i < len(original_df): + orig_val = str(original_df.iloc[i][col]) + conv_val = str(converted_df.iloc[i][col]) + if orig_val != conv_val and contains_gujarati(orig_val): + changes_detected = True + conversion_examples.append(f"`{orig_val}` โ†’ `{conv_val}`") + break + + if changes_detected: + st.success("โœ… Gujarati content was detected and converted to English") + if conversion_examples: + st.write("**Conversion Examples:**") + for example in conversion_examples: + st.write(example) + else: + st.info("โ„น๏ธ No Gujarati content detected - data is already in English") + +# Helper functions for file reading and conversion +def read_csv_file(file_path): + """Read CSV file with automatic encoding detection""" + try: + # Try reading with different encodings + for enc in ['utf-8', 'latin-1', 'cp1252', 'iso-8859-1']: + try: + return pd.read_csv(file_path, encoding=enc) + except: + continue + + # Last resort + return pd.read_csv(file_path, encoding='utf-8', errors='ignore') + except Exception as e: + st.error(f"Error reading CSV: {str(e)}") + return pd.DataFrame() + +def read_excel_file(file_path): + """Read Excel file with all sheets""" + try: + excel_file = pd.ExcelFile(file_path) + + if len(excel_file.sheet_names) == 1: + return pd.read_excel(file_path) + else: + sheet_name = st.selectbox( + "Select Sheet to View", + options=excel_file.sheet_names, + key=f"sheet_select_{file_path}" + ) + return pd.read_excel(file_path, sheet_name=sheet_name) + except Exception as e: + st.error(f"Error reading Excel file: {str(e)}") + return pd.DataFrame() + +def convert_gujarati_data_advanced(df, use_ai_translation=False): + """Convert Gujarati content to English using advanced methods""" + try: + df_converted = df.copy() + + # Convert column names + df_converted.columns = [convert_gujarati_text(col, use_ai_translation) for col in df_converted.columns] + + # Convert data in each column + for col in df_converted.columns: + df_converted[col] = df_converted[col].astype(str) + df_converted[col] = df_converted[col].apply( + lambda x: convert_gujarati_text(x, use_ai_translation) + ) + + return df_converted + except Exception as e: + st.warning(f"Conversion issues: {str(e)}") + return df + +def convert_gujarati_text(text, use_ai_translation=False): + """Convert Gujarati text to English using multiple methods""" + if not isinstance(text, str) or not text.strip(): + return text + + # Step 1: Always convert Gujarati numbers + text = gujarati_to_english_digits(text) + + # Step 2: Check if text contains Gujarati characters + if contains_gujarati(text): + if use_ai_translation and TRANSLATOR_AVAILABLE: + try: + return GoogleTranslator(source='gu', target='en').translate(text) + except Exception as e: + st.warning(f"Translation failed for '{text}': {str(e)}") + return apply_basic_gujarati_conversion(text) + else: + return apply_basic_gujarati_conversion(text) + else: + return text + +def gujarati_to_english_digits(text): + """Convert Gujarati numbers to English digits""" + gujarati_to_english_numbers = { + 'เซฆ': '0', 'เซง': '1', 'เซจ': '2', 'เซฉ': '3', 'เซช': '4', + 'เซซ': '5', 'เซฌ': '6', 'เซญ': '7', 'เซฎ': '8', 'เซฏ': '9' + } + + converted_text = text + for guj, eng in gujarati_to_english_numbers.items(): + converted_text = converted_text.replace(guj, eng) + + return converted_text + +def contains_gujarati(text): + """Check if text contains Gujarati characters""" + gujarati_pattern = re.compile(r'[\u0A80-\u0AFF]') + return bool(gujarati_pattern.search(text)) + +def apply_basic_gujarati_conversion(text): + """Apply basic Gujarati to English conversion for common words""" + gujarati_to_english_words = { + 'เช—เซเชฐเชพเชนเช•': 'Customer', 'เชจเชพเชฎ': 'Name', 'เชฎเซ‹เชฌเชพเชˆเชฒ': 'Mobile', 'เชซเซ‹เชจ': 'Phone', + 'เช—เชพเชฎ': 'Village', 'เชคเชพเชฒเซเช•เซ‹': 'Taluka', 'เชœเชฟเชฒเซเชฒเซ‹': 'District', 'เชถเชนเซ‡เชฐ': 'City', + 'เชฌเซ€เชฒ': 'Bill', 'เชšเชฒเชฃ': 'Invoice', 'เชฐเช•เชฎ': 'Amount', 'เชชเซเชฐเชฎเชพเชฃ': 'Quantity', + 'เช‰เชคเซเชชเชพเชฆเชจ': 'Product', 'เชคเชพเชฐเซ€เช–': 'Date', 'เชšเซเช•เชตเชฃเซ€': 'Payment' + } + + converted_text = text + for guj, eng in gujarati_to_english_words.items(): + converted_text = converted_text.replace(guj, eng) + + return converted_text + +def display_dataframe_info(df, title): + """Display dataframe with comprehensive information""" + st.write(f"**{title} Data Summary**") + + # Basic info + col1, col2, col3, col4 = st.columns(4) + with col1: + st.metric("Rows", len(df)) + with col2: + st.metric("Columns", len(df.columns)) + with col3: + non_empty = len(df.dropna(how='all')) + st.metric("Non-empty Rows", non_empty) + with col4: + empty_cells = df.isna().sum().sum() + st.metric("Empty Cells", empty_cells) + + # Column information + st.subheader("๐Ÿ“‹ Column Details") + col_info = [] + for col in df.columns: + col_info.append({ + 'Column Name': col, + 'Data Type': str(df[col].dtype), + 'Non-Null Count': df[col].count(), + 'Null Count': df[col].isna().sum(), + 'Unique Values': df[col].nunique() + }) + + col_info_df = pd.DataFrame(col_info) + st.dataframe(col_info_df, use_container_width=True) + + # Data preview + st.subheader("๐Ÿ‘€ Data Preview") + show_rows = st.slider("Number of rows to show", 5, 100, 10, key=f"rows_{title}") + st.dataframe(df.head(show_rows), use_container_width=True) + +def show_data_analysis_tools(df): + """Show basic data analysis tools""" + tab1, tab2, tab3 = st.tabs(["๐Ÿ“ˆ Basic Stats", "๐Ÿ” Search & Filter", "๐Ÿ’พ Export"]) + + with tab1: + show_basic_stats(df) + + with tab2: + show_search_filter(df) + + with tab3: + show_export_options(df) + +def show_basic_stats(df): + """Show basic statistical analysis""" + st.write("**Numerical Columns Statistics**") + + numerical_cols = df.select_dtypes(include=['number']).columns + if len(numerical_cols) > 0: + st.dataframe(df[numerical_cols].describe(), use_container_width=True) + else: + st.info("No numerical columns found for statistical analysis") + +def show_search_filter(df): + """Show search and filter options""" + st.write("**Search in Data**") + + search_term = st.text_input("Search term") + if search_term: + # Search across all string columns + mask = pd.Series([False] * len(df)) + for col in df.columns: + if df[col].dtype == 'object': + mask = mask | df[col].astype(str).str.contains(search_term, case=False, na=False) + + filtered_df = df[mask] + st.write(f"Found {len(filtered_df)} matching rows") + st.dataframe(filtered_df.head(20), use_container_width=True) + +def show_export_options(df): + """Show data export options""" + st.write("**Export Processed Data**") + + col1, col2 = st.columns(2) + + with col1: + csv = df.to_csv(index=False) + st.download_button( + label="๐Ÿ“ฅ Download as CSV", + data=csv, + file_name="converted_data.csv", + mime="text/csv" + ) + + with col2: + # For Excel, we need to save to a file first + excel_file = "converted_data.xlsx" + df.to_excel(excel_file, index=False) + with open(excel_file, "rb") as f: + st.download_button( + label="๐Ÿ“Š Download as Excel", + data=f, + file_name=excel_file, + mime="application/vnd.ms-excel" + ) + # Clean up + if os.path.exists(excel_file): + os.remove(excel_file) \ No newline at end of file diff --git a/pages/payments.py b/pages/payments.py new file mode 100644 index 0000000000000000000000000000000000000000..154ddd385eec1c07e1668ffb62b2fdab4a11e57c --- /dev/null +++ b/pages/payments.py @@ -0,0 +1,524 @@ +# pages/payments.py +import streamlit as st +import pandas as pd +import plotly.express as px +from datetime import datetime, timedelta + +def show_payments_page(db, whatsapp_manager=None): + """Show payments management and tracking page""" + st.title("๐Ÿ’ณ Payments Management") + + if not db: + st.error("Database not available. Please check initialization.") + return + + # Tabs for different payment functions + tab1, tab2, tab3, tab4 = st.tabs(["๐Ÿ’ฐ Record Payment", "๐Ÿ“‹ Payment History", "โณ Pending Payments", "๐Ÿ“Š Payment Analytics"]) + + with tab1: + show_record_payment_tab(db, whatsapp_manager) + + with tab2: + show_payment_history_tab(db) + + with tab3: + show_pending_payments_tab(db, whatsapp_manager) + + with tab4: + show_payment_analytics_tab(db) + +def show_record_payment_tab(db, whatsapp_manager): + """Show form to record new payments""" + st.subheader("๐Ÿ’ฐ Record New Payment") + + with st.form("record_payment_form"): + st.markdown("### ๐Ÿ“„ Payment Information") + + col1, col2 = st.columns(2) + + with col1: + # Get pending sales for selection + pending_sales = get_pending_sales(db) + if not pending_sales.empty: + sale_options = {f"{row['invoice_no']} - {row['customer_name']} (โ‚น{row['pending_amount']:,.2f})": row['sale_id'] + for _, row in pending_sales.iterrows()} + selected_sale = st.selectbox("Select Sale*", options=list(sale_options.keys())) + sale_id = sale_options[selected_sale] if selected_sale else None + + # Show sale details + if sale_id: + sale_details = pending_sales[pending_sales['sale_id'] == sale_id].iloc[0] + st.info(f"**Sale Details:** {sale_details['customer_name']} - Pending: โ‚น{sale_details['pending_amount']:,.2f}") + else: + st.warning("No pending sales found. All sales are fully paid!") + sale_id = None + + with col2: + payment_date = st.date_input("Payment Date*", datetime.now()) + payment_method = st.selectbox("Payment Method*", + ["Cash", "G-Pay", "PhonePe", "Bank Transfer", "Cheque", "Other"]) + payment_status = st.selectbox("Payment Status", ["Completed", "Pending", "Failed"]) + + st.markdown("### ๐Ÿ’ต Payment Amount") + + col1, col2 = st.columns(2) + + with col1: + if sale_id: + sale_data = pending_sales[pending_sales['sale_id'] == sale_id].iloc[0] + max_amount = sale_data['pending_amount'] + payment_amount = st.number_input("Payment Amount*", min_value=0.0, max_value=float(max_amount), + value=float(max_amount), step=100.0) + st.write(f"Pending Amount: โ‚น{max_amount:,.2f}") + else: + payment_amount = st.number_input("Payment Amount*", min_value=0.0, value=0.0, step=100.0) + + with col2: + reference_number = st.text_input("Reference Number", + placeholder="UPI ID, Cheque No, Transaction ID, etc.") + rrn_number = st.text_input("RRN Number", placeholder="For bank transfers") + + notes = st.text_area("Payment Notes", placeholder="Any additional notes about this payment...") + + # Submit button + submitted = st.form_submit_button("๐Ÿ’ณ Record Payment", type="primary") + + if submitted: + # Validation + errors = [] + if not sale_id: + errors.append("Sale selection is required") + if not payment_amount or payment_amount <= 0: + errors.append("Valid payment amount is required") + if not payment_date: + errors.append("Payment date is required") + if not payment_method: + errors.append("Payment method is required") + + if errors: + for error in errors: + st.error(f"โŒ {error}") + else: + try: + # Record payment in database + payment_id = add_payment_to_database(db, { + 'sale_id': sale_id, + 'payment_date': payment_date, + 'payment_method': payment_method, + 'amount': payment_amount, + 'rrn': rrn_number, + 'reference': reference_number, + 'status': payment_status, + 'notes': notes + }) + + if payment_id and payment_id > 0: + st.success(f"โœ… Payment recorded successfully! Payment ID: {payment_id}") + + # Update sale payment status + update_sale_payment_status(db, sale_id) + + # Send notification if WhatsApp available + if whatsapp_manager and sale_id: + send_payment_notification(whatsapp_manager, db, sale_id, payment_amount) + + # Show payment summary + show_payment_summary(db, payment_id) + + else: + st.error("โŒ Failed to record payment. Please try again.") + + except Exception as e: + st.error(f"โŒ Error recording payment: {e}") + +def get_pending_sales(db): + """Get sales with pending payments""" + try: + return db.get_dataframe('sales', ''' + SELECT s.sale_id, s.invoice_no, s.total_amount, s.payment_status, + c.name as customer_name, c.mobile, c.village, + (s.total_amount - COALESCE(SUM(p.amount), 0)) as pending_amount + FROM sales s + LEFT JOIN customers c ON s.customer_id = c.customer_id + LEFT JOIN payments p ON s.sale_id = p.sale_id + WHERE s.payment_status IN ('Pending', 'Partial') + GROUP BY s.sale_id + HAVING pending_amount > 0 + ORDER BY s.sale_date DESC + ''') + except Exception as e: + st.error(f"Error getting pending sales: {e}") + return pd.DataFrame() + +def add_payment_to_database(db, payment_data): + """Add payment record to database""" + try: + db.execute_query(''' + INSERT INTO payments (sale_id, payment_date, payment_method, amount, rrn, reference, status, notes) + VALUES (?, ?, ?, ?, ?, ?, ?, ?) + ''', ( + payment_data['sale_id'], + payment_data['payment_date'], + payment_data['payment_method'], + payment_data['amount'], + payment_data['rrn'], + payment_data['reference'], + payment_data['status'], + payment_data['notes'] + ), log_action=False) + + # Get the inserted payment_id + result = db.execute_query('SELECT last_insert_rowid()', log_action=False) + return result[0][0] if result else -1 + + except Exception as e: + st.error(f"Database error: {e}") + return -1 + +def update_sale_payment_status(db, sale_id): + """Update sale payment status based on payments""" + try: + # Get total paid amount + payments_data = db.get_dataframe('payments', f''' + SELECT COALESCE(SUM(amount), 0) as total_paid + FROM payments + WHERE sale_id = {sale_id} AND status = 'Completed' + ''') + + if not payments_data.empty: + total_paid = payments_data.iloc[0]['total_paid'] + + # Get sale total + sale_data = db.get_dataframe('sales', f'SELECT total_amount FROM sales WHERE sale_id = {sale_id}') + if not sale_data.empty: + sale_total = sale_data.iloc[0]['total_amount'] + + # Determine payment status + if total_paid >= sale_total: + new_status = 'Paid' + elif total_paid > 0: + new_status = 'Partial' + else: + new_status = 'Pending' + + # Update sale status + db.execute_query(''' + UPDATE sales SET payment_status = ?, updated_date = CURRENT_TIMESTAMP + WHERE sale_id = ? + ''', (new_status, sale_id), log_action=False) + + except Exception as e: + st.error(f"Error updating payment status: {e}") + +def send_payment_notification(whatsapp_manager, db, sale_id, payment_amount): + """Send payment confirmation to customer""" + try: + # Get sale and customer details + sale_data = db.get_dataframe('sales', f''' + SELECT s.*, c.name as customer_name, c.mobile + FROM sales s + LEFT JOIN customers c ON s.customer_id = c.customer_id + WHERE s.sale_id = {sale_id} + ''') + + if not sale_data.empty: + sale = sale_data.iloc[0] + + if sale.get('mobile'): + message = f"""Hello {sale['customer_name']}! ๐Ÿ’ฐ + +We have received your payment of โ‚น{payment_amount:,.2f} for invoice {sale['invoice_no']}. + +Thank you for your prompt payment! + +If you have any questions, please feel free to contact us. + +Best regards, +Sales Team""" + + success = whatsapp_manager.send_message(sale['mobile'], message) + if success: + st.success("๐Ÿ“ฑ Payment confirmation sent to customer!") + else: + st.warning("โš ๏ธ Could not send payment confirmation") + + except Exception as e: + st.warning(f"Could not send payment notification: {e}") + +def show_payment_summary(db, payment_id): + """Show summary of recorded payment""" + try: + payment_data = db.get_dataframe('payments', f''' + SELECT p.*, s.invoice_no, s.total_amount, c.name as customer_name, c.village + FROM payments p + LEFT JOIN sales s ON p.sale_id = s.sale_id + LEFT JOIN customers c ON s.customer_id = c.customer_id + WHERE p.payment_id = {payment_id} + ''') + + if not payment_data.empty: + payment = payment_data.iloc[0] + + st.markdown("## ๐ŸŽ‰ Payment Recorded Successfully!") + + col1, col2 = st.columns(2) + + with col1: + st.subheader("๐Ÿ’ณ Payment Details") + st.write(f"**Payment ID:** {payment_id}") + st.write(f"**Invoice No:** {payment['invoice_no']}") + st.write(f"**Customer:** {payment['customer_name']}") + st.write(f"**Village:** {payment['village']}") + st.write(f"**Payment Method:** {payment['payment_method']}") + + with col2: + st.subheader("๐Ÿ’ฐ Amount & Status") + st.write(f"**Amount Paid:** โ‚น{payment['amount']:,.2f}") + st.write(f"**Sale Total:** โ‚น{payment['total_amount']:,.2f}") + st.write(f"**Payment Date:** {payment['payment_date']}") + st.write(f"**Status:** {payment['status']}") + + if payment['reference']: + st.write(f"**Reference:** {payment['reference']}") + + # Quick actions + st.markdown("### โšก Quick Actions") + col1, col2, col3 = st.columns(3) + + with col1: + if st.button("๐Ÿ“‹ View Payment History"): + st.session_state.current_tab = "๐Ÿ“‹ Payment History" + + with col2: + if st.button("๐Ÿ’ฐ Record Another"): + st.rerun() + + with col3: + if st.button("โณ View Pending"): + st.session_state.current_tab = "โณ Pending Payments" + + except Exception as e: + st.error(f"Error displaying payment summary: {e}") + +def show_payment_history_tab(db): + """Show payment history and records""" + st.subheader("๐Ÿ“‹ Payment History") + + try: + # Date range filter + col1, col2 = st.columns(2) + with col1: + start_date = st.date_input("Start Date", datetime.now() - timedelta(days=30)) + with col2: + end_date = st.date_input("End Date", datetime.now()) + + # Status filter + status_filter = st.multiselect("Filter by Status", + ["Completed", "Pending", "Failed"], + default=["Completed"]) + + # Method filter + methods = db.get_dataframe('payments', "SELECT DISTINCT payment_method FROM payments") + if not methods.empty: + method_options = methods['payment_method'].dropna().unique().tolist() + method_filter = st.multiselect("Filter by Method", method_options, default=method_options) + + # Get payments data + payments_data = get_payments_data(db, start_date, end_date, status_filter, method_filter) + + if not payments_data.empty: + st.write(f"**๐Ÿ’ฐ Showing {len(payments_data)} payments**") + + # Display payments + display_data = payments_data[['payment_date', 'customer_name', 'invoice_no', 'amount', + 'payment_method', 'status', 'reference']].copy() + display_data.columns = ['Date', 'Customer', 'Invoice', 'Amount', 'Method', 'Status', 'Reference'] + display_data['Amount'] = display_data['Amount'].apply(lambda x: f"โ‚น{x:,.2f}") + display_data = display_data.sort_values('Date', ascending=False) + + st.dataframe(display_data, use_container_width=True) + + # Payment statistics + st.subheader("๐Ÿ“Š Payment Statistics") + col1, col2, col3, col4 = st.columns(4) + + with col1: + total_payments = len(payments_data) + st.metric("Total Payments", total_payments) + + with col2: + total_amount = payments_data['amount'].sum() + st.metric("Total Amount", f"โ‚น{total_amount:,.2f}") + + with col3: + completed = len(payments_data[payments_data['status'] == 'Completed']) + st.metric("Completed", completed) + + with col4: + avg_payment = payments_data['amount'].mean() + st.metric("Avg Payment", f"โ‚น{avg_payment:,.0f}") + + else: + st.info("No payments found for the selected criteria.") + + except Exception as e: + st.error(f"Error loading payment history: {e}") + +def get_payments_data(db, start_date, end_date, status_filter, method_filter): + """Get payments data with filters""" + try: + query = ''' + SELECT p.*, s.invoice_no, c.name as customer_name, c.village + FROM payments p + LEFT JOIN sales s ON p.sale_id = s.sale_id + LEFT JOIN customers c ON s.customer_id = c.customer_id + WHERE p.payment_date BETWEEN ? AND ? + ''' + + params = [start_date, end_date] + + if status_filter: + placeholders = ','.join(['?' for _ in status_filter]) + query += f' AND p.status IN ({placeholders})' + params.extend(status_filter) + + if method_filter: + placeholders = ','.join(['?' for _ in method_filter]) + query += f' AND p.payment_method IN ({placeholders})' + params.extend(method_filter) + + query += ' ORDER BY p.payment_date DESC' + + return db.get_dataframe('payments', query, params=params) + + except Exception as e: + st.error(f"Error getting payments data: {e}") + return pd.DataFrame() + +def show_pending_payments_tab(db, whatsapp_manager): + """Show pending payments and reminders""" + st.subheader("โณ Pending Payments") + + try: + # Get pending payments + pending_payments = get_pending_sales(db) + + if not pending_payments.empty: + st.warning(f"๐Ÿšจ {len(pending_payments)} Sales with Pending Payments!") + + # Display pending payments + display_data = pending_payments[['invoice_no', 'customer_name', 'village', 'total_amount', 'pending_amount', 'payment_status']].copy() + display_data.columns = ['Invoice', 'Customer', 'Village', 'Total Amount', 'Pending Amount', 'Status'] + display_data['Total Amount'] = display_data['Total Amount'].apply(lambda x: f"โ‚น{x:,.2f}") + display_data['Pending Amount'] = display_data['Pending Amount'].apply(lambda x: f"โ‚น{x:,.2f}") + + st.dataframe(display_data, use_container_width=True) + + # Total pending amount + total_pending = pending_payments['pending_amount'].sum() + st.error(f"**๐Ÿ’ฐ Total Pending Amount: โ‚น{total_pending:,.2f}**") + + # Send reminders + st.subheader("๐Ÿ“ฑ Send Payment Reminders") + selected_invoices = st.multiselect("Select Invoices for Reminders", + pending_payments['invoice_no'].tolist()) + + if selected_invoices and whatsapp_manager: + if st.button("๐Ÿ“ง Send WhatsApp Reminders"): + send_bulk_payment_reminders(whatsapp_manager, db, pending_payments, selected_invoices) + st.success("โœ… Payment reminders sent!") + + elif not whatsapp_manager: + st.info("๐Ÿ“ฑ WhatsApp manager not available for sending reminders") + + else: + st.success("๐ŸŽ‰ All payments are cleared! No pending payments.") + + except Exception as e: + st.error(f"Error loading pending payments: {e}") + +def send_bulk_payment_reminders(whatsapp_manager, db, pending_payments, selected_invoices): + """Send bulk payment reminders""" + try: + selected_sales = pending_payments[pending_payments['invoice_no'].isin(selected_invoices)] + + for _, sale in selected_sales.iterrows(): + if sale.get('mobile'): + message = f"""Hello {sale['customer_name']}! โฐ + +Friendly reminder regarding your pending payment. + +Invoice: {sale['invoice_no']} +Pending Amount: โ‚น{sale['pending_amount']:,.2f} + +Please make the payment at your earliest convenience. + +Thank you for your cooperation! + +Best regards, +Sales Team""" + + whatsapp_manager.send_message(sale['mobile'], message) + + except Exception as e: + st.error(f"Error sending reminders: {e}") + +def show_payment_analytics_tab(db): + """Show payment analytics and trends""" + st.subheader("๐Ÿ“Š Payment Analytics") + + try: + # Get payments data for analytics + payments_data = db.get_dataframe('payments', ''' + SELECT p.*, s.invoice_no, c.name as customer_name + FROM payments p + LEFT JOIN sales s ON p.sale_id = s.sale_id + LEFT JOIN customers c ON s.customer_id = c.customer_id + WHERE p.status = 'Completed' + ORDER BY p.payment_date DESC + ''') + + if not payments_data.empty: + # Payment method distribution + st.subheader("๐Ÿ’ณ Payment Methods Distribution") + method_stats = payments_data['payment_method'].value_counts() + + if not method_stats.empty: + fig = px.pie(values=method_stats.values, names=method_stats.index, + title='Payment Methods Distribution') + st.plotly_chart(fig, use_container_width=True) + + # Monthly payment trend + st.subheader("๐Ÿ“ˆ Monthly Payment Trend") + try: + payments_data['payment_date'] = pd.to_datetime(payments_data['payment_date']) + monthly_payments = payments_data.groupby(payments_data['payment_date'].dt.to_period('M')).agg({ + 'amount': 'sum', + 'payment_id': 'count' + }).reset_index() + monthly_payments['payment_date'] = monthly_payments['payment_date'].astype(str) + + if not monthly_payments.empty: + fig = px.line(monthly_payments, x='payment_date', y='amount', + title='Monthly Payment Amount Trend', + labels={'payment_date': 'Month', 'amount': 'Amount (โ‚น)'}) + st.plotly_chart(fig, use_container_width=True) + except: + st.info("Could not generate monthly trend chart") + + # Top customers by payments + st.subheader("๐Ÿ† Top Customers by Payments") + customer_stats = payments_data.groupby('customer_name').agg({ + 'amount': 'sum', + 'payment_id': 'count' + }).reset_index() + customer_stats.columns = ['Customer', 'Total Paid', 'Payment Count'] + customer_stats = customer_stats.sort_values('Total Paid', ascending=False).head(10) + + st.dataframe(customer_stats, use_container_width=True) + + else: + st.info("No payment data available for analytics.") + + except Exception as e: + st.error(f"Error loading payment analytics: {e}") \ No newline at end of file diff --git a/pages/reports.py b/pages/reports.py new file mode 100644 index 0000000000000000000000000000000000000000..c9f1c3e2a03989efe9debc43f0f61eee9b2cee13 --- /dev/null +++ b/pages/reports.py @@ -0,0 +1,1101 @@ +# pages/reports.py +import streamlit as st +import pandas as pd +import plotly.express as px +import plotly.graph_objects as go +from datetime import datetime, timedelta +import numpy as np + +def show_reports_page(db, whatsapp_manager=None): + """Show comprehensive business intelligence and reporting""" + st.title("๐Ÿ“ˆ Business Intelligence & Reports") + + if not db: + st.error("Database not available. Please check initialization.") + return + + # Tabs for different report types + tab1, tab2, tab3, tab4, tab5 = st.tabs(["๐Ÿ“Š Sales Reports", "๐Ÿ‘ฅ Customer Reports", + "๐Ÿค Distributor Reports", "๐Ÿ’ฐ Financial Reports", + "๐ŸŽฏ Performance Reports"]) + + with tab1: + show_sales_reports_tab(db) + + with tab2: + show_customer_reports_tab(db) + + with tab3: + show_distributor_reports_tab(db) + + with tab4: + show_financial_reports_tab(db) + + with tab5: + show_performance_reports_tab(db) + +def show_sales_reports_tab(db): + """Show sales-related reports and analytics""" + st.subheader("๐Ÿ“Š Sales Performance Reports") + + # Date range selection + col1, col2, col3 = st.columns([2, 2, 1]) + + with col1: + start_date = st.date_input("Start Date", datetime.now() - timedelta(days=30)) + with col2: + end_date = st.date_input("End Date", datetime.now()) + with col3: + report_granularity = st.selectbox("Granularity", ["Daily", "Weekly", "Monthly"]) + + try: + # Sales Summary + st.subheader("๐Ÿ’ฐ Sales Summary") + sales_summary = get_sales_summary(db, start_date, end_date) + + if sales_summary: + col1, col2, col3, col4, col5 = st.columns(5) + + with col1: + st.metric("Total Sales", f"โ‚น{sales_summary.get('total_sales', 0):,.0f}") + with col2: + st.metric("Total Revenue", f"โ‚น{sales_summary.get('total_revenue', 0):,.0f}") + with col3: + st.metric("Transactions", sales_summary.get('total_transactions', 0)) + with col4: + st.metric("Avg Sale Value", f"โ‚น{sales_summary.get('avg_sale_value', 0):,.0f}") + with col5: + st.metric("Unique Customers", sales_summary.get('unique_customers', 0)) + + # Sales Trend Chart + st.subheader("๐Ÿ“ˆ Sales Trend") + sales_trend = get_sales_trend(db, start_date, end_date, report_granularity) + + if not sales_trend.empty: + fig = px.line(sales_trend, x='period', y='total_amount', + title=f'Sales Trend ({report_granularity})', + labels={'period': 'Period', 'total_amount': 'Sales Amount (โ‚น)'}) + st.plotly_chart(fig, use_container_width=True) + + # Product Performance + st.subheader("๐Ÿ“ฆ Product Performance") + product_performance = get_product_performance(db, start_date, end_date) + + if not product_performance.empty: + col1, col2 = st.columns(2) + + with col1: + # Top products by revenue + top_products = product_performance.head(10) + fig = px.bar(top_products, x='product_name', y='total_revenue', + title='Top 10 Products by Revenue', + labels={'product_name': 'Product', 'total_revenue': 'Revenue (โ‚น)'}) + st.plotly_chart(fig, use_container_width=True) + + with col2: + # Product sales distribution + fig = px.pie(product_performance, values='total_quantity', names='product_name', + title='Product Sales Distribution (Quantity)') + st.plotly_chart(fig, use_container_width=True) + + # Detailed product table + st.dataframe(product_performance, use_container_width=True) + + # Village-wise Sales + st.subheader("๐Ÿ—บ๏ธ Village-wise Sales Performance") + village_sales = get_village_sales(db, start_date, end_date) + + if not village_sales.empty: + fig = px.bar(village_sales.head(10), x='village', y='total_revenue', + title='Top 10 Villages by Sales Revenue', + labels={'village': 'Village', 'total_revenue': 'Revenue (โ‚น)'}) + st.plotly_chart(fig, use_container_width=True) + + # Village sales table + st.dataframe(village_sales, use_container_width=True) + + # Export options + st.subheader("๐Ÿ“ค Export Sales Report") + col1, col2 = st.columns(2) + + with col1: + if st.button("๐Ÿ“Š Export Sales Data to CSV"): + export_sales_data(db, start_date, end_date) + + with col2: + if st.button("๐Ÿ“ˆ Generate Sales PDF Report"): + generate_sales_pdf_report(db, start_date, end_date) + + except Exception as e: + st.error(f"Error generating sales reports: {e}") + +def get_sales_summary(db, start_date, end_date): + """Get sales summary statistics""" + try: + query = ''' + SELECT + COUNT(*) as total_transactions, + SUM(total_amount) as total_revenue, + AVG(total_amount) as avg_sale_value, + COUNT(DISTINCT customer_id) as unique_customers, + SUM(total_liters) as total_liters_sold + FROM sales + WHERE sale_date BETWEEN ? AND ? + ''' + + result = db.execute_query(query, (start_date, end_date), log_action=False) + + if result: + row = result[0] + return { + 'total_transactions': row[0] or 0, + 'total_revenue': row[1] or 0, + 'avg_sale_value': row[2] or 0, + 'unique_customers': row[3] or 0, + 'total_liters_sold': row[4] or 0 + } + return {} + + except Exception as e: + st.error(f"Error getting sales summary: {e}") + return {} + +def get_sales_trend(db, start_date, end_date, granularity): + """Get sales trend data""" + try: + if granularity == "Daily": + group_by = "DATE(sale_date)" + period_format = "sale_date" + elif granularity == "Weekly": + group_by = "STRFTIME('%Y-%W', sale_date)" + period_format = "STRFTIME('%Y-W%W', sale_date) as period" + else: # Monthly + group_by = "STRFTIME('%Y-%m', sale_date)" + period_format = "STRFTIME('%Y-%m', sale_date) as period" + + query = f''' + SELECT {period_format}, + SUM(total_amount) as total_amount, + COUNT(*) as transaction_count, + AVG(total_amount) as avg_amount + FROM sales + WHERE sale_date BETWEEN ? AND ? + GROUP BY {group_by} + ORDER BY period + ''' + + return db.get_dataframe('sales', query, params=(start_date, end_date)) + + except Exception as e: + st.error(f"Error getting sales trend: {e}") + return pd.DataFrame() + +def get_product_performance(db, start_date, end_date): + """Get product performance data""" + try: + query = ''' + SELECT + p.product_name, + p.packing_type, + p.capacity_ltr, + COUNT(si.item_id) as times_sold, + SUM(si.quantity) as total_quantity, + SUM(si.amount) as total_revenue, + AVG(si.rate) as avg_rate + FROM sale_items si + JOIN products p ON si.product_id = p.product_id + JOIN sales s ON si.sale_id = s.sale_id + WHERE s.sale_date BETWEEN ? AND ? + GROUP BY p.product_id, p.product_name, p.packing_type, p.capacity_ltr + ORDER BY total_revenue DESC + ''' + + return db.get_dataframe('sale_items', query, params=(start_date, end_date)) + + except Exception as e: + st.error(f"Error getting product performance: {e}") + return pd.DataFrame() + +def get_village_sales(db, start_date, end_date): + """Get village-wise sales data""" + try: + query = ''' + SELECT + c.village, + COUNT(DISTINCT s.customer_id) as unique_customers, + COUNT(s.sale_id) as total_transactions, + SUM(s.total_amount) as total_revenue, + AVG(s.total_amount) as avg_sale_value + FROM sales s + JOIN customers c ON s.customer_id = c.customer_id + WHERE s.sale_date BETWEEN ? AND ? + AND c.village IS NOT NULL AND c.village != '' + GROUP BY c.village + ORDER BY total_revenue DESC + ''' + + return db.get_dataframe('sales', query, params=(start_date, end_date)) + + except Exception as e: + st.error(f"Error getting village sales: {e}") + return pd.DataFrame() + +def show_customer_reports_tab(db): + """Show customer-related reports and analytics""" + st.subheader("๐Ÿ‘ฅ Customer Intelligence Reports") + + try: + # Customer Overview + st.subheader("๐Ÿ“‹ Customer Overview") + customer_overview = get_customer_overview(db) + + if customer_overview: + col1, col2, col3, col4 = st.columns(4) + + with col1: + st.metric("Total Customers", customer_overview.get('total_customers', 0)) + with col2: + st.metric("Active Customers", customer_overview.get('active_customers', 0)) + with col3: + st.metric("Avg Customer Value", f"โ‚น{customer_overview.get('avg_customer_value', 0):,.0f}") + with col4: + st.metric("Repeat Customer Rate", f"{customer_overview.get('repeat_rate', 0):.1f}%") + + # Top Customers + st.subheader("๐Ÿ† Top Customers by Spending") + top_customers = get_top_customers(db) + + if not top_customers.empty: + col1, col2 = st.columns(2) + + with col1: + fig = px.bar(top_customers.head(10), x='name', y='total_spent', + title='Top 10 Customers by Total Spending', + labels={'name': 'Customer', 'total_spent': 'Total Spent (โ‚น)'}) + st.plotly_chart(fig, use_container_width=True) + + with col2: + # Customer segmentation by spending + spending_brackets = categorize_customers_by_spending(top_customers) + fig = px.pie(values=spending_brackets.values, names=spending_brackets.index, + title='Customer Segmentation by Spending') + st.plotly_chart(fig, use_container_width=True) + + # Customer details table + st.dataframe(top_customers, use_container_width=True) + + # Customer Acquisition Trend + st.subheader("๐Ÿ“ˆ Customer Acquisition Trend") + acquisition_trend = get_customer_acquisition_trend(db) + + if not acquisition_trend.empty: + fig = px.line(acquisition_trend, x='month', y='new_customers', + title='Monthly Customer Acquisition', + labels={'month': 'Month', 'new_customers': 'New Customers'}) + st.plotly_chart(fig, use_container_width=True) + + # Customer Location Analysis + st.subheader("๐Ÿ—บ๏ธ Customer Geographic Distribution") + customer_geo = get_customer_geographic_data(db) + + if not customer_geo.empty: + col1, col2 = st.columns(2) + + with col1: + # Village-wise customer count + village_customers = customer_geo.groupby('village').size().reset_index(name='customer_count') + village_customers = village_customers.sort_values('customer_count', ascending=False).head(10) + + fig = px.bar(village_customers, x='village', y='customer_count', + title='Top 10 Villages by Customer Count', + labels={'village': 'Village', 'customer_count': 'Number of Customers'}) + st.plotly_chart(fig, use_container_width=True) + + with col2: + # Taluka-wise distribution + taluka_customers = customer_geo.groupby('taluka').size().reset_index(name='customer_count') + + if not taluka_customers.empty: + fig = px.pie(taluka_customers, values='customer_count', names='taluka', + title='Customer Distribution by Taluka') + st.plotly_chart(fig, use_container_width=True) + + # Customer Lifetime Value Analysis + st.subheader("๐Ÿ’ฐ Customer Lifetime Value Analysis") + clv_data = get_customer_lifetime_value(db) + + if not clv_data.empty: + st.dataframe(clv_data, use_container_width=True) + + except Exception as e: + st.error(f"Error generating customer reports: {e}") + +def get_customer_overview(db): + """Get customer overview statistics""" + try: + # Total customers + total_customers = db.execute_query( + "SELECT COUNT(*) FROM customers", log_action=False + )[0][0] + + # Customers with purchases + active_customers = db.execute_query( + "SELECT COUNT(DISTINCT customer_id) FROM sales", log_action=False + )[0][0] + + # Average customer value + avg_value_result = db.execute_query( + "SELECT AVG(total_amount) FROM sales", log_action=False + ) + avg_customer_value = avg_value_result[0][0] if avg_value_result else 0 + + # Repeat customer rate + repeat_customers = db.execute_query( + "SELECT COUNT(*) FROM (SELECT customer_id FROM sales GROUP BY customer_id HAVING COUNT(*) > 1)", + log_action=False + )[0][0] + + repeat_rate = (repeat_customers / active_customers * 100) if active_customers > 0 else 0 + + return { + 'total_customers': total_customers, + 'active_customers': active_customers, + 'avg_customer_value': avg_customer_value or 0, + 'repeat_rate': repeat_rate + } + + except Exception as e: + st.error(f"Error getting customer overview: {e}") + return {} + +def get_top_customers(db, limit=20): + """Get top customers by spending""" + try: + query = ''' + SELECT + c.customer_id, + c.name, + c.village, + c.taluka, + c.mobile, + COUNT(s.sale_id) as total_purchases, + SUM(s.total_amount) as total_spent, + MAX(s.sale_date) as last_purchase_date + FROM customers c + JOIN sales s ON c.customer_id = s.customer_id + GROUP BY c.customer_id, c.name, c.village, c.taluka, c.mobile + ORDER BY total_spent DESC + LIMIT ? + ''' + + return db.get_dataframe('customers', query, params=(limit,)) + + except Exception as e: + st.error(f"Error getting top customers: {e}") + return pd.DataFrame() + +def categorize_customers_by_spending(customers_df): + """Categorize customers by spending levels""" + try: + if customers_df.empty: + return pd.Series() + + bins = [0, 1000, 5000, 10000, float('inf')] + labels = ['Low (<1K)', 'Medium (1K-5K)', 'High (5K-10K)', 'VIP (>10K)'] + + customers_df['spending_category'] = pd.cut( + customers_df['total_spent'], bins=bins, labels=labels, right=False + ) + + return customers_df['spending_category'].value_counts() + + except Exception as e: + st.error(f"Error categorizing customers: {e}") + return pd.Series() + +def get_customer_acquisition_trend(db): + """Get customer acquisition trend""" + try: + query = ''' + SELECT + STRFTIME('%Y-%m', created_date) as month, + COUNT(*) as new_customers + FROM customers + GROUP BY STRFTIME('%Y-%m', created_date) + ORDER BY month + ''' + + return db.get_dataframe('customers', query) + + except Exception as e: + st.error(f"Error getting acquisition trend: {e}") + return pd.DataFrame() + +def get_customer_geographic_data(db): + """Get customer geographic distribution""" + try: + return db.get_dataframe('customers', ''' + SELECT village, taluka, district, COUNT(*) as customer_count + FROM customers + WHERE village IS NOT NULL AND village != '' + GROUP BY village, taluka, district + ORDER BY customer_count DESC + ''') + + except Exception as e: + st.error(f"Error getting geographic data: {e}") + return pd.DataFrame() + +def get_customer_lifetime_value(db): + """Calculate customer lifetime value""" + try: + query = ''' + SELECT + c.customer_id, + c.name, + c.village, + COUNT(s.sale_id) as purchase_frequency, + SUM(s.total_amount) as total_value, + AVG(s.total_amount) as avg_order_value, + JULIANDAY(MAX(s.sale_date)) - JULIANDAY(MIN(s.sale_date)) as customer_tenure_days, + CASE + WHEN COUNT(s.sale_id) > 0 THEN + SUM(s.total_amount) / (COUNT(s.sale_id) * GREATEST((JULIANDAY(MAX(s.sale_date)) - JULIANDAY(MIN(s.sale_date)))/30, 1)) + ELSE 0 + END as clv + FROM customers c + LEFT JOIN sales s ON c.customer_id = s.customer_id + GROUP BY c.customer_id, c.name, c.village + HAVING total_value > 0 + ORDER BY clv DESC + ''' + + return db.get_dataframe('customers', query) + + except Exception as e: + st.error(f"Error calculating CLV: {e}") + return pd.DataFrame() + +def show_distributor_reports_tab(db): + """Show distributor-related reports and analytics""" + st.subheader("๐Ÿค Distributor Performance Reports") + + try: + # Distributor Overview + st.subheader("๐Ÿ“‹ Distributor Network Overview") + distributor_overview = get_distributor_overview(db) + + if distributor_overview: + col1, col2, col3, col4 = st.columns(4) + + with col1: + st.metric("Total Distributors", distributor_overview.get('total_distributors', 0)) + with col2: + st.metric("Active Distributors", distributor_overview.get('active_distributors', 0)) + with col3: + st.metric("Total Sabhasad", distributor_overview.get('total_sabhasad', 0)) + with col4: + st.metric("Network Size", distributor_overview.get('network_size', 0)) + + # Top Performers + st.subheader("๐Ÿ† Top Performing Distributors") + top_distributors = get_top_distributors(db) + + if not top_distributors.empty: + col1, col2 = st.columns(2) + + with col1: + fig = px.bar(top_distributors.head(10), x='name', y='sabhasad_count', + title='Top 10 Distributors by Sabhasad Count', + labels={'name': 'Distributor', 'sabhasad_count': 'Sabhasad Count'}) + st.plotly_chart(fig, use_container_width=True) + + with col2: + # Performance tiers + tier_distribution = top_distributors['performance_tier'].value_counts() + fig = px.pie(values=tier_distribution.values, names=tier_distribution.index, + title='Distributor Performance Tier Distribution') + st.plotly_chart(fig, use_container_width=True) + + # Distributor details table + st.dataframe(top_distributors, use_container_width=True) + + # Territory Coverage + st.subheader("๐Ÿ—บ๏ธ Territory Coverage Analysis") + territory_coverage = get_territory_coverage(db) + + if not territory_coverage.empty: + col1, col2 = st.columns(2) + + with col1: + fig = px.bar(territory_coverage.head(10), x='village', y='distributor_count', + title='Villages with Multiple Distributors', + labels={'village': 'Village', 'distributor_count': 'Distributor Count'}) + st.plotly_chart(fig, use_container_width=True) + + with col2: + # Coverage status + coverage_status = { + 'Covered Villages': len(territory_coverage[territory_coverage['distributor_count'] > 0]), + 'Uncovered Villages': len(territory_coverage[territory_coverage['distributor_count'] == 0]) + } + + fig = px.pie(values=coverage_status.values(), names=coverage_status.keys(), + title='Village Coverage Status') + st.plotly_chart(fig, use_container_width=True) + + # Growth Potential Analysis + st.subheader("๐Ÿ“ˆ Growth Potential Analysis") + growth_potential = get_growth_potential(db) + + if not growth_potential.empty: + st.dataframe(growth_potential, use_container_width=True) + + except Exception as e: + st.error(f"Error generating distributor reports: {e}") + +def get_distributor_overview(db): + """Get distributor network overview""" + try: + distributors = db.get_dataframe('distributors', 'SELECT * FROM distributors') + + if distributors.empty: + return {} + + total_distributors = len(distributors) + active_distributors = len(distributors[distributors['sabhasad_count'] > 0]) + total_sabhasad = distributors['sabhasad_count'].sum() + network_size = total_distributors + total_sabhasad + + return { + 'total_distributors': total_distributors, + 'active_distributors': active_distributors, + 'total_sabhasad': total_sabhasad, + 'network_size': network_size + } + + except Exception as e: + st.error(f"Error getting distributor overview: {e}") + return {} + +def get_top_distributors(db, limit=20): + """Get top performing distributors""" + try: + distributors = db.get_dataframe('distributors', ''' + SELECT *, + (sabhasad_count + contact_in_group) as network_score + FROM distributors + ORDER BY sabhasad_count DESC + LIMIT ? + ''', params=(limit,)) + + if not distributors.empty: + # Add performance tier + distributors['performance_tier'] = distributors['sabhasad_count'].apply( + lambda x: 'Platinum' if x >= 20 else 'Gold' if x >= 10 else 'Silver' if x >= 5 else 'Bronze' + ) + + return distributors + + except Exception as e: + st.error(f"Error getting top distributors: {e}") + return pd.DataFrame() + +def get_territory_coverage(db): + """Get territory coverage analysis""" + try: + # Get all villages from customers + customer_villages = db.get_dataframe('customers', ''' + SELECT DISTINCT village + FROM customers + WHERE village IS NOT NULL AND village != '' + ''') + + # Get distributor villages + distributor_villages = db.get_dataframe('distributors', ''' + SELECT village, COUNT(*) as distributor_count + FROM distributors + WHERE village IS NOT NULL AND village != '' + GROUP BY village + ''') + + # Merge to see coverage + if not customer_villages.empty: + if not distributor_villages.empty: + coverage = pd.merge(customer_villages, distributor_villages, on='village', how='left') + else: + coverage = customer_villages.copy() + coverage['distributor_count'] = 0 + + coverage['distributor_count'] = coverage['distributor_count'].fillna(0) + return coverage.sort_values('distributor_count', ascending=False) + + return pd.DataFrame() + + except Exception as e: + st.error(f"Error getting territory coverage: {e}") + return pd.DataFrame() + +def get_growth_potential(db): + """Get distributor growth potential analysis""" + try: + return db.get_dataframe('distributors', ''' + SELECT + name, + village, + sabhasad_count, + contact_in_group, + (contact_in_group - sabhasad_count) as conversion_potential, + CASE + WHEN sabhasad_count = 0 THEN contact_in_group * 0.3 + ELSE (contact_in_group / sabhasad_count - 1) * sabhasad_count + END as growth_opportunity + FROM distributors + WHERE contact_in_group > sabhasad_count + ORDER BY growth_opportunity DESC + ''') + + except Exception as e: + st.error(f"Error getting growth potential: {e}") + return pd.DataFrame() + +def show_financial_reports_tab(db): + """Show financial reports and analytics""" + st.subheader("๐Ÿ’ฐ Financial Performance Reports") + + # Date range selection + col1, col2 = st.columns(2) + with col1: + start_date = st.date_input("Start Date", datetime.now() - timedelta(days=90), key="financial_start") + with col2: + end_date = st.date_input("End Date", datetime.now(), key="financial_end") + + try: + # Financial Summary + st.subheader("๐Ÿ“‹ Financial Summary") + financial_summary = get_financial_summary(db, start_date, end_date) + + if financial_summary: + col1, col2, col3, col4 = st.columns(4) + + with col1: + st.metric("Total Revenue", f"โ‚น{financial_summary.get('total_revenue', 0):,.0f}") + with col2: + st.metric("Total Payments", f"โ‚น{financial_summary.get('total_payments', 0):,.0f}") + with col3: + st.metric("Pending Amount", f"โ‚น{financial_summary.get('pending_amount', 0):,.0f}") + with col4: + collection_rate = financial_summary.get('collection_rate', 0) + st.metric("Collection Rate", f"{collection_rate:.1f}%") + + # Revenue vs Payments Trend + st.subheader("๐Ÿ“ˆ Revenue vs Payments Trend") + financial_trend = get_financial_trend(db, start_date, end_date) + + if not financial_trend.empty: + fig = go.Figure() + fig.add_trace(go.Scatter(x=financial_trend['period'], y=financial_trend['revenue'], + name='Revenue', line=dict(color='green'))) + fig.add_trace(go.Scatter(x=financial_trend['period'], y=financial_trend['payments'], + name='Payments', line=dict(color='blue'))) + fig.update_layout(title='Revenue vs Payments Trend', xaxis_title='Period', yaxis_title='Amount (โ‚น)') + st.plotly_chart(fig, use_container_width=True) + + # Payment Method Analysis + st.subheader("๐Ÿ’ณ Payment Method Analysis") + payment_methods = get_payment_methods_analysis(db, start_date, end_date) + + if not payment_methods.empty: + col1, col2 = st.columns(2) + + with col1: + fig = px.pie(payment_methods, values='total_amount', names='payment_method', + title='Payment Methods Distribution') + st.plotly_chart(fig, use_container_width=True) + + with col2: + fig = px.bar(payment_methods, x='payment_method', y='transaction_count', + title='Transactions by Payment Method', + labels={'payment_method': 'Payment Method', 'transaction_count': 'Number of Transactions'}) + st.plotly_chart(fig, use_container_width=True) + + # Aging Analysis + st.subheader("โณ Accounts Receivable Aging") + aging_analysis = get_aging_analysis(db) + + if not aging_analysis.empty: + st.dataframe(aging_analysis, use_container_width=True) + + except Exception as e: + st.error(f"Error generating financial reports: {e}") + +def get_financial_summary(db, start_date, end_date): + """Get financial summary""" + try: + # Total revenue + revenue_result = db.execute_query( + "SELECT SUM(total_amount) FROM sales WHERE sale_date BETWEEN ? AND ?", + (start_date, end_date), log_action=False + ) + total_revenue = revenue_result[0][0] or 0 if revenue_result else 0 + + # Total payments + payments_result = db.execute_query( + "SELECT SUM(amount) FROM payments WHERE payment_date BETWEEN ? AND ? AND status = 'Completed'", + (start_date, end_date), log_action=False + ) + total_payments = payments_result[0][0] or 0 if payments_result else 0 + + # Pending amount + pending_result = db.execute_query( + "SELECT SUM(total_amount - COALESCE((SELECT SUM(amount) FROM payments WHERE payments.sale_id = sales.sale_id AND status = 'Completed'), 0)) FROM sales WHERE sale_date BETWEEN ? AND ?", + (start_date, end_date), log_action=False + ) + pending_amount = pending_result[0][0] or 0 if pending_result else 0 + + # Collection rate + collection_rate = (total_payments / total_revenue * 100) if total_revenue > 0 else 0 + + return { + 'total_revenue': total_revenue, + 'total_payments': total_payments, + 'pending_amount': pending_amount, + 'collection_rate': collection_rate + } + + except Exception as e: + st.error(f"Error getting financial summary: {e}") + return {} + +def get_financial_trend(db, start_date, end_date): + """Get financial trend data""" + try: + query = ''' + SELECT + STRFTIME('%Y-%m', sale_date) as period, + SUM(total_amount) as revenue, + (SELECT SUM(amount) FROM payments + WHERE STRFTIME('%Y-%m', payment_date) = STRFTIME('%Y-%m', sales.sale_date) + AND status = 'Completed') as payments + FROM sales + WHERE sale_date BETWEEN ? AND ? + GROUP BY STRFTIME('%Y-%m', sale_date) + ORDER BY period + ''' + + return db.get_dataframe('sales', query, params=(start_date, end_date)) + + except Exception as e: + st.error(f"Error getting financial trend: {e}") + return pd.DataFrame() + +def get_payment_methods_analysis(db, start_date, end_date): + """Get payment methods analysis""" + try: + query = ''' + SELECT + payment_method, + COUNT(*) as transaction_count, + SUM(amount) as total_amount, + AVG(amount) as avg_amount + FROM payments + WHERE payment_date BETWEEN ? AND ? AND status = 'Completed' + GROUP BY payment_method + ORDER BY total_amount DESC + ''' + + return db.get_dataframe('payments', query, params=(start_date, end_date)) + + except Exception as e: + st.error(f"Error getting payment methods analysis: {e}") + return pd.DataFrame() + +def get_aging_analysis(db): + """Get accounts receivable aging analysis""" + try: + query = ''' + SELECT + s.invoice_no, + c.name as customer_name, + c.village, + s.sale_date, + s.total_amount, + COALESCE(SUM(p.amount), 0) as paid_amount, + (s.total_amount - COALESCE(SUM(p.amount), 0)) as pending_amount, + JULIANDAY('now') - JULIANDAY(s.sale_date) as days_pending, + CASE + WHEN JULIANDAY('now') - JULIANDAY(s.sale_date) <= 30 THEN '0-30 days' + WHEN JULIANDAY('now') - JULIANDAY(s.sale_date) <= 60 THEN '31-60 days' + WHEN JULIANDAY('now') - JULIANDAY(s.sale_date) <= 90 THEN '61-90 days' + ELSE 'Over 90 days' + END as aging_bucket + FROM sales s + JOIN customers c ON s.customer_id = c.customer_id + LEFT JOIN payments p ON s.sale_id = p.sale_id AND p.status = 'Completed' + WHERE s.payment_status IN ('Pending', 'Partial') + GROUP BY s.sale_id, s.invoice_no, c.name, c.village, s.sale_date, s.total_amount + HAVING pending_amount > 0 + ORDER BY days_pending DESC + ''' + + return db.get_dataframe('sales', query) + + except Exception as e: + st.error(f"Error getting aging analysis: {e}") + return pd.DataFrame() + +def show_performance_reports_tab(db): + """Show overall performance and KPI reports""" + st.subheader("๐ŸŽฏ Business Performance Dashboard") + + try: + # Key Performance Indicators + st.subheader("๐Ÿ“Š Key Performance Indicators (KPIs)") + + kpis = get_performance_kpis(db) + + if kpis: + col1, col2, col3, col4 = st.columns(4) + + with col1: + st.metric("Monthly Revenue", f"โ‚น{kpis.get('monthly_revenue', 0):,.0f}") + with col2: + st.metric("Customer Growth", f"+{kpis.get('customer_growth', 0)}") + with col3: + st.metric("Demo Conversion", f"{kpis.get('demo_conversion_rate', 0):.1f}%") + with col4: + st.metric("Payment Collection", f"{kpis.get('collection_rate', 0):.1f}%") + + # Performance Scorecard + st.subheader("๐Ÿ“‹ Performance Scorecard") + scorecard = get_performance_scorecard(db) + + if not scorecard.empty: + st.dataframe(scorecard, use_container_width=True) + + # Goal Tracking + st.subheader("๐ŸŽฏ Goal vs Actual Performance") + goals_vs_actual = get_goals_vs_actual(db) + + if not goals_vs_actual.empty: + for _, goal in goals_vs_actual.iterrows(): + progress = min((goal['actual'] / goal['target']) * 100, 100) if goal['target'] > 0 else 0 + st.write(f"**{goal['metric']}**") + st.progress(progress / 100) + st.write(f"Target: {goal['target']} | Actual: {goal['actual']} | Progress: {progress:.1f}%") + + # Export Comprehensive Report + st.subheader("๐Ÿ“ค Export Comprehensive Report") + + if st.button("๐Ÿ“„ Generate Full Business Report"): + generate_comprehensive_report(db) + + except Exception as e: + st.error(f"Error generating performance reports: {e}") + +def get_performance_kpis(db): + """Get key performance indicators""" + try: + # Monthly revenue (last 30 days) + monthly_revenue_result = db.execute_query( + "SELECT SUM(total_amount) FROM sales WHERE sale_date >= date('now', '-30 days')", + log_action=False + ) + monthly_revenue = monthly_revenue_result[0][0] or 0 if monthly_revenue_result else 0 + + # Customer growth (last 30 days) + customer_growth_result = db.execute_query( + "SELECT COUNT(*) FROM customers WHERE created_date >= date('now', '-30 days')", + log_action=False + ) + customer_growth = customer_growth_result[0][0] or 0 if customer_growth_result else 0 + + # Demo conversion rate + demos_result = db.execute_query( + "SELECT COUNT(*), SUM(CASE WHEN conversion_status = 'Converted' THEN 1 ELSE 0 END) FROM demos", + log_action=False + ) + if demos_result and demos_result[0][0] > 0: + demo_conversion_rate = (demos_result[0][1] / demos_result[0][0]) * 100 + else: + demo_conversion_rate = 0 + + # Collection rate + collection_result = db.execute_query( + "SELECT SUM(total_amount), SUM(COALESCE((SELECT SUM(amount) FROM payments WHERE payments.sale_id = sales.sale_id AND status = 'Completed'), 0)) FROM sales", + log_action=False + ) + if collection_result and collection_result[0][0] and collection_result[0][0] > 0: + collection_rate = (collection_result[0][1] / collection_result[0][0]) * 100 + else: + collection_rate = 0 + + return { + 'monthly_revenue': monthly_revenue, + 'customer_growth': customer_growth, + 'demo_conversion_rate': demo_conversion_rate, + 'collection_rate': collection_rate + } + + except Exception as e: + st.error(f"Error getting KPIs: {e}") + return {} + +def get_performance_scorecard(db): + """Get performance scorecard""" + try: + scorecard_data = [] + + # Sales performance + sales_data = db.execute_query( + "SELECT COUNT(*), SUM(total_amount), AVG(total_amount) FROM sales WHERE sale_date >= date('now', '-30 days')", + log_action=False + ) + if sales_data: + scorecard_data.append({ + 'Category': 'Sales', + 'Metric': 'Monthly Transactions', + 'Value': sales_data[0][0] or 0, + 'Target': 50, + 'Status': 'On Track' if (sales_data[0][0] or 0) >= 40 else 'Needs Attention' + }) + + scorecard_data.append({ + 'Category': 'Sales', + 'Metric': 'Monthly Revenue', + 'Value': f"โ‚น{sales_data[0][1] or 0:,.0f}", + 'Target': 'โ‚น50,000', + 'Status': 'On Track' if (sales_data[0][1] or 0) >= 40000 else 'Needs Attention' + }) + + # Customer performance + customer_data = db.execute_query( + "SELECT COUNT(*) FROM customers WHERE created_date >= date('now', '-30 days')", + log_action=False + ) + if customer_data: + scorecard_data.append({ + 'Category': 'Customers', + 'Metric': 'New Customers', + 'Value': customer_data[0][0] or 0, + 'Target': 20, + 'Status': 'On Track' if (customer_data[0][0] or 0) >= 15 else 'Needs Attention' + }) + + # Distributor performance + distributor_data = db.execute_query( + "SELECT COUNT(*), SUM(sabhasad_count) FROM distributors", + log_action=False + ) + if distributor_data: + scorecard_data.append({ + 'Category': 'Distribution', + 'Metric': 'Total Distributors', + 'Value': distributor_data[0][0] or 0, + 'Target': 10, + 'Status': 'On Track' if (distributor_data[0][0] or 0) >= 8 else 'Needs Attention' + }) + + scorecard_data.append({ + 'Category': 'Distribution', + 'Metric': 'Total Sabhasad', + 'Value': distributor_data[0][1] or 0, + 'Target': 100, + 'Status': 'On Track' if (distributor_data[0][1] or 0) >= 80 else 'Needs Attention' + }) + + return pd.DataFrame(scorecard_data) + + except Exception as e: + st.error(f"Error getting performance scorecard: {e}") + return pd.DataFrame() + +def get_goals_vs_actual(db): + """Get goals vs actual performance""" + try: + goals = [ + {'metric': 'Monthly Revenue', 'target': 50000, 'actual': 0}, + {'metric': 'New Customers', 'target': 20, 'actual': 0}, + {'metric': 'Demos Conducted', 'target': 15, 'actual': 0}, + {'metric': 'Payment Collection', 'target': 95, 'actual': 0} + ] + + # Get actual values + revenue_result = db.execute_query( + "SELECT SUM(total_amount) FROM sales WHERE sale_date >= date('now', '-30 days')", + log_action=False + ) + if revenue_result: + goals[0]['actual'] = revenue_result[0][0] or 0 + + customer_result = db.execute_query( + "SELECT COUNT(*) FROM customers WHERE created_date >= date('now', '-30 days')", + log_action=False + ) + if customer_result: + goals[1]['actual'] = customer_result[0][0] or 0 + + demo_result = db.execute_query( + "SELECT COUNT(*) FROM demos WHERE demo_date >= date('now', '-30 days')", + log_action=False + ) + if demo_result: + goals[2]['actual'] = demo_result[0][0] or 0 + + collection_result = db.execute_query( + "SELECT SUM(total_amount), SUM(COALESCE((SELECT SUM(amount) FROM payments WHERE payments.sale_id = sales.sale_id AND status = 'Completed'), 0)) FROM sales WHERE sale_date >= date('now', '-30 days')", + log_action=False + ) + if collection_result and collection_result[0][0] and collection_result[0][0] > 0: + goals[3]['actual'] = (collection_result[0][1] / collection_result[0][0]) * 100 + + return pd.DataFrame(goals) + + except Exception as e: + st.error(f"Error getting goals vs actual: {e}") + return pd.DataFrame() + +def export_sales_data(db, start_date, end_date): + """Export sales data to CSV""" + try: + sales_data = db.get_dataframe('sales', ''' + SELECT s.*, c.name as customer_name, c.village, c.taluka + FROM sales s + JOIN customers c ON s.customer_id = c.customer_id + WHERE s.sale_date BETWEEN ? AND ? + ORDER BY s.sale_date DESC + ''', params=(start_date, end_date)) + + if not sales_data.empty: + csv = sales_data.to_csv(index=False) + st.download_button( + label="๐Ÿ“ฅ Download Sales Data as CSV", + data=csv, + file_name=f"sales_report_{datetime.now().strftime('%Y%m%d')}.csv", + mime="text/csv" + ) + + except Exception as e: + st.error(f"Error exporting sales data: {e}") + +def generate_sales_pdf_report(db, start_date, end_date): + """Generate PDF sales report (placeholder)""" + st.info("๐Ÿ“„ PDF report generation feature will be implemented soon!") + st.info("This would generate a comprehensive PDF report with charts and analysis.") + +def generate_comprehensive_report(db): + """Generate comprehensive business report""" + st.success("๐ŸŽ‰ Comprehensive business report generated!") + st.info(""" + **Report Includes:** + - Executive Summary + - Sales Performance Analysis + - Customer Insights + - Distributor Network Performance + - Financial Overview + - Key Recommendations + + *Note: Full report generation with export features will be implemented in the next version.* + """) + +# Add this to your main file routing \ No newline at end of file diff --git a/pages/sales.py b/pages/sales.py new file mode 100644 index 0000000000000000000000000000000000000000..5a81d801cc326b4016f59d72d7bbf6e38f06f28d --- /dev/null +++ b/pages/sales.py @@ -0,0 +1,500 @@ +# pages/sales.py +import streamlit as st +import pandas as pd +from datetime import datetime, timedelta +import re + +def show_sales_page(db, whatsapp_manager=None): + """Show enhanced sales management page with quick customer creation and WhatsApp""" + st.title("๐Ÿ’ฐ Sales Management") + + if not db: + st.error("Database not available. Please check initialization.") + return + + # Tabs for different sales functions + tab1, tab2, tab3 = st.tabs(["โž• Quick Sale", "๐Ÿ“‹ Sales History", "๐Ÿ” Sales Analytics"]) + + with tab1: + show_quick_sale_tab(db, whatsapp_manager) + + with tab2: + show_sales_history_tab(db) + + with tab3: + show_sales_analytics_tab(db) + +def show_quick_sale_tab(db, whatsapp_manager): + """Show tab for quick sales with instant customer creation""" + st.subheader("๐Ÿš€ Quick Sale - Create Customer & Sale in One Go") + + with st.form("quick_sale_form"): + # Customer Section - Quick Create + st.markdown("### ๐Ÿ‘ฅ Customer Information") + + col1, col2 = st.columns(2) + + with col1: + # Option 1: Select existing customer + st.write("**Select Existing Customer**") + customers = db.get_dataframe('customers') + existing_customer_options = {f"{row['name']} ({row['mobile']})": row['customer_id'] + for _, row in customers.iterrows()} if not customers.empty else {} + + use_existing = st.selectbox("Choose Customer", + options=[""] + list(existing_customer_options.keys()), + key="existing_customer") + + if use_existing: + customer_id = existing_customer_options[use_existing] + # Get customer details for display + customer_details = customers[customers['customer_id'] == customer_id].iloc[0] + st.success(f"Selected: {customer_details['name']} - {customer_details['mobile']}") + else: + customer_id = None + + with col2: + # Option 2: Create new customer instantly + st.write("**Or Create New Customer**") + new_customer_name = st.text_input("Customer Name*", placeholder="Enter customer name") + new_customer_mobile = st.text_input("Mobile Number", placeholder="Enter mobile number") + new_customer_village = st.text_input("Village", placeholder="Enter village") + + if new_customer_name: + # Check if customer already exists + existing_customer = db.execute_query( + "SELECT customer_id FROM customers WHERE name = ? OR mobile = ?", + (new_customer_name, new_customer_mobile), + log_action=False + ) + + if existing_customer: + st.warning("โš ๏ธ Customer with same name/mobile already exists!") + customer_id = existing_customer[0][0] + else: + customer_id = None # Will create during sale submission + + # Sale Information + st.markdown("### ๐Ÿ“„ Sale Information") + col1, col2 = st.columns(2) + + with col1: + invoice_no = st.text_input("Invoice Number*", value=db.generate_invoice_number()) + with col2: + sale_date = st.date_input("Sale Date", datetime.now()) + + # Products Section with Smart Pricing + st.markdown("### ๐Ÿ“ฆ Add Products") + + products = db.get_dataframe('products') + if products.empty: + st.error("โŒ No products found in database. Please add products first.") + return + + product_options = {row['product_name']: { + 'product_id': row['product_id'], + 'standard_rate': row['standard_rate'], + 'packing_type': row['packing_type'], + 'capacity_ltr': row['capacity_ltr'] + } for _, row in products.iterrows()} + + sale_items = [] + total_amount = 0 + + # Create 3 product rows + for i in range(3): + st.markdown(f"**Product {i+1}**") + col1, col2, col3, col4, col5 = st.columns([3, 1, 2, 2, 1]) + + with col1: + selected_product = st.selectbox(f"Select Product", + options=[""] + list(product_options.keys()), + key=f"product_{i}") + + with col2: + quantity = st.number_input(f"Qty", min_value=0, value=0, key=f"qty_{i}") + + with col3: + if selected_product: + default_rate = product_options[selected_product]['standard_rate'] + rate = st.number_input(f"Rate (โ‚น)", min_value=0.0, value=float(default_rate), + step=1.0, key=f"rate_{i}") + # Show discount indicator if rate is changed + if rate < default_rate: + discount = ((default_rate - rate) / default_rate) * 100 + st.info(f"๐ŸŽฏ {discount:.1f}% off") + else: + rate = st.number_input(f"Rate (โ‚น)", min_value=0.0, value=0.0, key=f"rate_{i}") + + with col4: + if selected_product and quantity > 0: + amount = quantity * rate + st.metric("Amount", f"โ‚น{amount:,.2f}") + else: + amount = 0 + st.metric("Amount", "โ‚น0") + + with col5: + if selected_product and quantity > 0: + product_info = product_options[selected_product] + st.write(f"*{product_info['packing_type']}*") + if product_info['capacity_ltr'] > 0: + st.write(f"{product_info['capacity_ltr']}L") + + if selected_product and quantity > 0: + sale_items.append({ + 'product_id': product_options[selected_product]['product_id'], + 'product_name': selected_product, + 'quantity': quantity, + 'rate': rate, + 'amount': amount, + 'standard_rate': product_options[selected_product]['standard_rate'] + }) + total_amount += amount + + # Show running total + if total_amount > 0: + st.success(f"### ๐ŸŽฏ Running Total: โ‚น{total_amount:,.2f}") + + # Additional Options + st.markdown("### โš™๏ธ Additional Options") + + col1, col2 = st.columns(2) + + with col1: + notes = st.text_area("Sale Notes", placeholder="Any special notes about this sale...") + + with col2: + # WhatsApp Notification Options + st.write("**๐Ÿ“ฑ Customer Notification**") + send_whatsapp = st.checkbox("Send WhatsApp Notification", value=True) + if send_whatsapp and not whatsapp_manager: + st.warning("WhatsApp manager not available") + + # Payment options + payment_received = st.checkbox("Payment Received", value=False) + if payment_received: + payment_amount = st.number_input("Payment Amount", min_value=0.0, value=float(total_amount)) + payment_method = st.selectbox("Payment Method", ["Cash", "G-Pay", "Cheque", "Bank Transfer"]) + + # Submit Section + st.markdown("---") + submitted = st.form_submit_button("๐Ÿš€ Create Sale & Notify Customer", type="primary") + + if submitted: + # Validation + errors = [] + + if not customer_id and not new_customer_name: + errors.append("Please select a customer or enter new customer name") + if not invoice_no: + errors.append("Invoice number is required") + if not sale_items: + errors.append("Please add at least one product") + + if errors: + for error in errors: + st.error(error) + else: + try: + # Create customer if new + if not customer_id and new_customer_name: + customer_id = db.add_customer( + name=new_customer_name, + mobile=new_customer_mobile, + village=new_customer_village + ) + if customer_id and customer_id > 0: + st.success(f"โœ… New customer created: {new_customer_name}") + + if customer_id: + # Create sale + sale_id = db.add_sale( + invoice_no=invoice_no, + customer_id=customer_id, + sale_date=sale_date, + items=sale_items, + notes=notes + ) + + if sale_id and sale_id > 0: + st.success(f"โœ… Sale created successfully! Sale ID: {sale_id}") + + # Add payment if received + if payment_received: + db.execute_query(''' + INSERT INTO payments (sale_id, payment_date, payment_method, amount) + VALUES (?, ?, ?, ?) + ''', (sale_id, sale_date, payment_method, payment_amount)) + st.success(f"โœ… Payment recorded: โ‚น{payment_amount:,.2f}") + + # Send WhatsApp notification + if send_whatsapp and whatsapp_manager: + send_sale_notification(whatsapp_manager, db, sale_id, customer_id) + + # Show sale summary + show_quick_sale_summary(db, sale_id, sale_items, customer_id) + + # Clear form for next sale + if st.button("๐Ÿ”„ Create Another Sale"): + st.rerun() + else: + st.error("โŒ Failed to create sale.") + + except Exception as e: + st.error(f"Error creating sale: {e}") + +def send_sale_notification(whatsapp_manager, db, sale_id, customer_id): + """Send WhatsApp notification to customer about their sale""" + try: + # Get sale and customer details + sale_details = db.get_dataframe('sales', f"SELECT * FROM sales WHERE sale_id = {sale_id}") + customer_details = db.get_dataframe('customers', f"SELECT * FROM customers WHERE customer_id = {customer_id}") + + if sale_details.empty or customer_details.empty: + return False + + sale = sale_details.iloc[0] + customer = customer_details.iloc[0] + + # Get sale items + items_details = db.get_dataframe('sale_items', f''' + SELECT si.*, p.product_name + FROM sale_items si + JOIN products p ON si.product_id = p.product_id + WHERE si.sale_id = {sale_id} + ''') + + if customer.get('mobile'): + # Create notification message + message = f"""Hello {customer['name']}! ๐ŸŽ‰ + +Thank you for your purchase! + +๐Ÿ“„ Invoice: {sale['invoice_no']} +๐Ÿ“… Date: {sale['sale_date']} +๐Ÿ’ฐ Total Amount: โ‚น{sale['total_amount']:,.2f} + +๐Ÿ“ฆ Items Purchased: +""" + + # Add items to message + for _, item in items_details.iterrows(): + message += f"โ€ข {item['product_name']}: {item['quantity']} x โ‚น{item['rate']} = โ‚น{item['amount']}\n" + + message += f""" + +Payment Status: {sale['payment_status']} + +We appreciate your business! ๐Ÿ™ + +For any queries, contact us. + +Thank you!""" + + # Send message + success = whatsapp_manager.send_message(customer['mobile'], message) + if success: + st.success("๐Ÿ“ฑ WhatsApp notification sent to customer!") + else: + st.warning("โš ๏ธ Failed to send WhatsApp notification") + + return success + + except Exception as e: + st.warning(f"Could not send notification: {e}") + return False + +def show_quick_sale_summary(db, sale_id, sale_items, customer_id): + """Show comprehensive sale summary""" + st.markdown("## ๐ŸŽ‰ Sale Completed Successfully!") + + try: + # Get sale and customer details + sale_details = db.get_dataframe('sales', f"SELECT * FROM sales WHERE sale_id = {sale_id}") + customer_details = db.get_dataframe('customers', f"SELECT * FROM customers WHERE customer_id = {customer_id}") + + if sale_details.empty or customer_details.empty: + return + + sale = sale_details.iloc[0] + customer = customer_details.iloc[0] + + # Display in columns + col1, col2 = st.columns(2) + + with col1: + st.subheader("Customer Details") + st.write(f"**Name:** {customer['name']}") + if customer['mobile']: + st.write(f"**Mobile:** {customer['mobile']}") + if customer['village']: + st.write(f"**Village:** {customer['village']}") + + st.subheader("Sale Details") + st.write(f"**Invoice No:** {sale['invoice_no']}") + st.write(f"**Sale Date:** {sale['sale_date']}") + st.write(f"**Payment Status:** {sale['payment_status']}") + if sale['notes']: + st.write(f"**Notes:** {sale['notes']}") + + with col2: + st.subheader("Financial Summary") + st.metric("Total Amount", f"โ‚น{sale['total_amount']:,.2f}") + + # Get payment details + payment_details = db.get_dataframe('payments', f"SELECT * FROM payments WHERE sale_id = {sale_id}") + if not payment_details.empty: + total_paid = payment_details['amount'].sum() + pending = sale['total_amount'] - total_paid + st.metric("Amount Paid", f"โ‚น{total_paid:,.2f}") + st.metric("Pending Amount", f"โ‚น{pending:,.2f}") + + st.subheader("Items Summary") + for item in sale_items: + st.write(f"โ€ข {item['product_name']}: {item['quantity']} x โ‚น{item['rate']}") + + # Quick actions + st.markdown("### โšก Quick Actions") + col1, col2, col3 = st.columns(3) + + with col1: + if st.button("๐Ÿ“‹ View All Sales"): + # This would switch to sales history tab in a real implementation + st.info("Navigate to Sales History tab") + + with col2: + if st.button("๐Ÿ‘ฅ View Customer"): + st.info(f"Customer: {customer['name']}") + + with col3: + if st.button("๐Ÿ’ณ Record Payment"): + st.info("Use Payments page to record additional payments") + + except Exception as e: + st.error(f"Error displaying sale summary: {e}") + +def show_sales_history_tab(db): + """Show tab for sales history and management""" + st.subheader("Sales History & Management") + + try: + # Quick filters + col1, col2, col3, col4 = st.columns(4) + + with col1: + date_filter = st.selectbox("Date Filter", + ["All", "Today", "Last 7 days", "This month", "Custom"]) + + with col2: + status_filter = st.multiselect("Payment Status", + ["Pending", "Partial", "Paid"], + default=["Pending", "Partial", "Paid"]) + + with col3: + search_term = st.text_input("Search Invoice/Customer") + + with col4: + show_rows = st.selectbox("Show", [10, 25, 50, 100], index=0) + + # Build query + query = ''' + SELECT s.*, c.name as customer_name, c.village, c.mobile, + COALESCE(SUM(p.amount), 0) as paid_amount, + (s.total_amount - COALESCE(SUM(p.amount), 0)) as pending_amount + FROM sales s + LEFT JOIN customers c ON s.customer_id = c.customer_id + LEFT JOIN payments p ON s.sale_id = p.sale_id + ''' + + conditions = [] + if status_filter: + status_cond = " OR ".join([f"s.payment_status = '{status}'" for status in status_filter]) + conditions.append(f"({status_cond})") + + if search_term: + conditions.append(f"(s.invoice_no LIKE '%{search_term}%' OR c.name LIKE '%{search_term}%')") + + if conditions: + query += " WHERE " + " AND ".join(conditions) + + query += " GROUP BY s.sale_id ORDER BY s.sale_date DESC LIMIT " + str(show_rows) + + # Get sales data + sales_data = db.get_dataframe('sales', query) + + if not sales_data.empty: + st.write(f"**Showing {len(sales_data)} sales**") + + # Enhanced display + display_df = sales_data[['invoice_no', 'sale_date', 'customer_name', 'village', + 'total_amount', 'paid_amount', 'pending_amount', 'payment_status']].copy() + + # Formatting + display_df['total_amount'] = display_df['total_amount'].apply(lambda x: f"โ‚น{x:,.2f}") + display_df['paid_amount'] = display_df['paid_amount'].apply(lambda x: f"โ‚น{x:,.2f}") + display_df['pending_amount'] = display_df['pending_amount'].apply(lambda x: f"โ‚น{x:,.2f}") + + display_df.columns = ['Invoice', 'Date', 'Customer', 'Village', 'Total', 'Paid', 'Pending', 'Status'] + + st.dataframe(display_df, use_container_width=True) + + # Summary metrics + total_sales = sales_data['total_amount'].sum() + total_pending = sales_data['pending_amount'].sum() + + col1, col2, col3 = st.columns(3) + with col1: + st.metric("Total Sales Value", f"โ‚น{total_sales:,.2f}") + with col2: + st.metric("Total Pending", f"โ‚น{total_pending:,.2f}") + with col3: + if total_sales > 0: + collection_rate = ((total_sales - total_pending) / total_sales) * 100 + st.metric("Collection Rate", f"{collection_rate:.1f}%") + + else: + st.info("No sales found matching the current filters.") + + except Exception as e: + st.error(f"Error loading sales history: {e}") + +def show_sales_analytics_tab(db): + """Show tab for sales analytics""" + st.subheader("Sales Analytics & Insights") + + try: + # Date range + col1, col2 = st.columns(2) + with col1: + start_date = st.date_input("Start Date", datetime.now() - timedelta(days=30)) + with col2: + end_date = st.date_input("End Date", datetime.now()) + + if start_date > end_date: + st.error("Start date cannot be after end date") + return + + # Get analytics + analytics = db.get_sales_analytics(start_date.strftime('%Y-%m-%d'), + end_date.strftime('%Y-%m-%d')) + + if analytics: + # Key metrics + st.subheader("๐Ÿ“ˆ Performance Metrics") + cols = st.columns(4) + metrics = [ + ("Total Sales", analytics.get('total_sales', 0), "๐Ÿ’ฐ"), + ("Total Revenue", f"โ‚น{analytics.get('total_revenue', 0):,.2f}", "๐Ÿ’ต"), + ("Avg Sale", f"โ‚น{analytics.get('avg_sale_value', 0):,.2f}", "๐Ÿ“Š"), + ("Unique Customers", analytics.get('unique_customers', 0), "๐Ÿ‘ฅ") + ] + + for col, (label, value, icon) in zip(cols, metrics): + with col: + st.metric(label, value) + + # Additional analytics can be added here + + except Exception as e: + st.error(f"Error loading analytics: {e}") \ No newline at end of file diff --git a/pages/whatsapp.py b/pages/whatsapp.py new file mode 100644 index 0000000000000000000000000000000000000000..f7d987abd35eda471038e4b1dbb7767b5747ff0a --- /dev/null +++ b/pages/whatsapp.py @@ -0,0 +1,68 @@ +# pages/whatsapp.py +import streamlit as st +import pandas as pd + +def show_whatsapp_page(db, whatsapp_manager): + """Show WhatsApp messaging page""" + st.title("๐Ÿ’ฌ WhatsApp Messaging") + + if not whatsapp_manager: + st.error("WhatsApp manager not available. Please install pywhatkit: pip install pywhatkit") + st.info(""" + **To enable WhatsApp messaging:** + 1. Install: `pip install pywhatkit` + 2. Make sure you're logged into WhatsApp Web in your default browser + 3. Ensure phone numbers include country code (e.g., +91 for India) + """) + else: + tab1, tab2, tab3, tab4 = st.tabs(["Single Message", "Bulk Messages", "Templates", "Message History"]) + + with tab1: + show_single_message_tab(db, whatsapp_manager) + + with tab2: + show_bulk_messages_tab(db, whatsapp_manager) + + with tab3: + show_templates_tab() + + with tab4: + show_message_history_tab(db) + +def show_single_message_tab(db, whatsapp_manager): + """Show single message tab""" + st.subheader("๐Ÿ“ฑ Send Single Message") + + col1, col2 = st.columns(2) + + with col1: + # Option 1: Select from existing customers + st.write("**Select from Existing Customers**") + customers = db.get_dataframe('customers') + if not customers.empty: + customer_options = {f"{row['name']} ({row['mobile']}) - {row['village']}": row for _, row in customers.iterrows()} + selected_customer_key = st.selectbox("Choose Customer", options=[""] + list(customer_options.keys())) + + if selected_customer_key: + customer_data = customer_options[selected_customer_key] + st.write(f"**Selected:** {customer_data['name']}") + st.write(f"**Mobile:** {customer_data['mobile']}") + st.write(f"**Village:** {customer_data['village']}") + + # Pre-fill message with template + message_template = st.selectbox("Quick Template", [ + "Custom Message", + "Payment Reminder", + "Demo Follow-up", + "New Product Announcement", + "Festival Greeting" + ]) + + with col2: + # Option 2: Manual entry + st.write("**Or Enter Manually**") + manual_name = st.text_input("Recipient Name") + manual_mobile = st.text_input("Mobile Number (with country code)", placeholder="+91XXXXXXXXXX") + + # Message content and sending logic would continue here... + # (I'll show the rest in the next message due to length) \ No newline at end of file diff --git a/requirments.txt b/requirments.txt new file mode 100644 index 0000000000000000000000000000000000000000..2bd3ced5c85ab0875c6589ee7d6b77577e550130 --- /dev/null +++ b/requirments.txt @@ -0,0 +1,8 @@ +streamlit==1.28.0 +pandas==2.1.0 +plotly==5.15.0 +openpyxl==3.1.2 +pywhatkit==5.4 +schedule==1.2.0 +deep-translator==1.11.4 +numpy==1.24.0 diff --git a/sales_manager.py b/sales_manager.py new file mode 100644 index 0000000000000000000000000000000000000000..6901d20165e37a9f32e45f6f53ed7bf083bbbf98 --- /dev/null +++ b/sales_manager.py @@ -0,0 +1,92 @@ +# enhanced_sales_manager.py +from datetime import datetime, timedelta +import pandas as pd +import sqlite3 + +class EnhancedSalesManager: + def __init__(self, db_manager, data_processor): + self.db_manager = db_manager + self.data_processor = data_processor + + def batch_import_data(self, directory_path): + """Import all data from a directory""" + return self.data_processor.process_directory(directory_path) + + def get_customer_insights(self): + """Get comprehensive customer insights""" + conn = self.db_manager.get_connection() + + # Top customers by spending + top_customers = pd.read_sql(''' + SELECT c.name, c.village, SUM(s.total_amount) as total_spent, COUNT(s.sale_id) as purchases + FROM customers c + JOIN sales s ON c.customer_id = s.customer_id + GROUP BY c.customer_id + ORDER BY total_spent DESC + LIMIT 20 + ''', conn) + + # Village performance + village_performance = pd.read_sql(''' + SELECT village, COUNT(DISTINCT customer_id) as customers, + SUM(total_amount) as total_sales, AVG(total_amount) as avg_sale + FROM sales s + JOIN customers c ON s.customer_id = c.customer_id + GROUP BY village + ORDER BY total_sales DESC + ''', conn) + + return { + 'top_customers': top_customers, + 'village_performance': village_performance + } + + def generate_comprehensive_report(self, start_date=None, end_date=None): + """Generate detailed business intelligence report""" + if not start_date: + start_date = (datetime.now() - timedelta(days=30)).strftime('%Y-%m-%d') + if not end_date: + end_date = datetime.now().strftime('%Y-%m-%d') + + conn = self.db_manager.get_connection() + + reports = {} + + # Sales trends + reports['sales_trends'] = pd.read_sql(f''' + SELECT DATE(sale_date) as date, SUM(total_amount) as daily_sales, + SUM(total_liters) as daily_liters, COUNT(*) as transactions + FROM sales + WHERE sale_date BETWEEN '{start_date}' AND '{end_date}' + GROUP BY DATE(sale_date) + ORDER BY date + ''', conn) + + # Product performance + reports['product_performance'] = pd.read_sql(f''' + SELECT p.packing_type, p.capacity_ltr, SUM(si.quantity) as total_quantity, + SUM(si.amount) as total_revenue, COUNT(DISTINCT s.sale_id) as transactions + FROM sale_items si + JOIN products p ON si.product_id = p.product_id + JOIN sales s ON si.sale_id = s.sale_id + WHERE s.sale_date BETWEEN '{start_date}' AND '{end_date}' + GROUP BY p.product_id + ORDER BY total_revenue DESC + ''', conn) + + # Payment analysis + reports['payment_analysis'] = pd.read_sql(f''' + SELECT + CASE + WHEN payment_date IS NOT NULL THEN 'Paid' + ELSE 'Pending' + END as payment_status, + COUNT(*) as transactions, + SUM(total_amount) as amount, + AVG(total_amount) as avg_amount + FROM sales + WHERE sale_date BETWEEN '{start_date}' AND '{end_date}' + GROUP BY payment_status + ''', conn) + + return reports \ No newline at end of file diff --git a/streamlit/config.toml b/streamlit/config.toml new file mode 100644 index 0000000000000000000000000000000000000000..d6830d07ae766f2c7ed2441054bbe3f222790693 --- /dev/null +++ b/streamlit/config.toml @@ -0,0 +1,7 @@ +[server] +headless = true +address = "0.0.0.0" +port = 8501 + +[browser] +gatherUsageStats = false \ No newline at end of file diff --git a/streamlit/secrets.toml b/streamlit/secrets.toml new file mode 100644 index 0000000000000000000000000000000000000000..b2797d87e32e67dc1c6d5efd647e8826a1c2e9cb --- /dev/null +++ b/streamlit/secrets.toml @@ -0,0 +1,2 @@ +# .streamlit/secrets.toml +password = "Admin25k" \ No newline at end of file diff --git a/utils/__init__.py b/utils/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/utils/__pycache__/__init__.cpython-310.pyc b/utils/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..af1122f8539c24a2aba4b145383604da36e727f1 Binary files /dev/null and b/utils/__pycache__/__init__.cpython-310.pyc differ diff --git a/utils/__pycache__/helpers.cpython-310.pyc b/utils/__pycache__/helpers.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..45bc29ddb915ea2fd05dcd52d6c2658591d3877c Binary files /dev/null and b/utils/__pycache__/helpers.cpython-310.pyc differ diff --git a/utils/__pycache__/styling.cpython-310.pyc b/utils/__pycache__/styling.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f937b6a037f854c2bb34050d3f69d659b39d4728 Binary files /dev/null and b/utils/__pycache__/styling.cpython-310.pyc differ diff --git a/utils/helpers.py b/utils/helpers.py new file mode 100644 index 0000000000000000000000000000000000000000..bfc704ac8d9ed589ace94547804b11ed041f938e --- /dev/null +++ b/utils/helpers.py @@ -0,0 +1,50 @@ +# utils/helpers.py +import streamlit as st +import pandas as pd +import plotly.express as px + +def init_session_state(): + """Initialize session state variables""" + if 'db' not in st.session_state: + st.session_state.db = None + if 'data_processor' not in st.session_state: + st.session_state.data_processor = None + if 'analytics' not in st.session_state: + st.session_state.analytics = None + if 'whatsapp_manager' not in st.session_state: + st.session_state.whatsapp_manager = None + if 'files_processed' not in st.session_state: + st.session_state.files_processed = False + +def create_simple_chart(data, title, x_col, y_col): + """Create a simple chart using Streamlit's native charts or fallback to table""" + if not data.empty: + try: + fig = px.line(data, x=x_col, y=y_col, title=title) + return fig + except Exception: + # Fallback to table display + st.write(f"**{title}**") + st.dataframe(data[[x_col, y_col]]) + return None + else: + st.write(f"**{title}**") + return None + +def check_module_availability(): + """Check if all required modules are available""" + try: + from database import DatabaseManager + from data_processor import DataProcessor + from analytics import Analytics + try: + from whatsapp_manager import WhatsAppManager + WHATSAPP_AVAILABLE = True + except ImportError: + WHATSAPP_AVAILABLE = False + + return True, WHATSAPP_AVAILABLE + except ImportError as e: + st.error(f"Import Error: {e}") + st.info("Please make sure all required files are in the same directory.") + return False, False \ No newline at end of file diff --git a/utils/styling.py b/utils/styling.py new file mode 100644 index 0000000000000000000000000000000000000000..19f250acf380553661c8e093c41439f77a347447 --- /dev/null +++ b/utils/styling.py @@ -0,0 +1,70 @@ +# utils/styling.py +import streamlit as st + +def apply_custom_css(): + """Apply custom CSS styling""" + st.markdown(""" + + """, unsafe_allow_html=True) + +def create_metric_card(value, label, icon="๐Ÿ“Š", color="#1f77b4"): + """Create a styled metric card""" + return f""" +
+
+
+
{value}
+
{label}
+
+
{icon}
+
+
+ """ + +COLORS = { + 'primary': '#1f77b4', + 'secondary': '#ff7f0e', + 'success': '#2ca02c', + 'danger': '#d62728', + 'warning': '#ffbb78' +} \ No newline at end of file diff --git a/whatsapp_manager.py b/whatsapp_manager.py new file mode 100644 index 0000000000000000000000000000000000000000..a423650801c2594757302b97a71e63d228118bf8 --- /dev/null +++ b/whatsapp_manager.py @@ -0,0 +1,402 @@ +# whatsapp_manager.py +import pywhatkit +import logging +from datetime import datetime, timedelta +import time +import pandas as pd +import os +import streamlit as st + +class WhatsAppManager: + def __init__(self, db_manager): + self.db = db_manager + self.logger = logging.getLogger(__name__) + + def send_message(self, phone_number, message, image_path=None): + """Send WhatsApp message with error handling""" + try: + # Clean phone number + phone_number = self._clean_phone_number(phone_number) + if not phone_number: + self._log_message(phone_number, message, "failed", "Invalid phone number") + return False + + st.info(f"๐Ÿ“ฑ Preparing to send WhatsApp message to {phone_number}") + + # Schedule message (sends in 2 minutes) + send_time = datetime.now() + timedelta(minutes=2) + + try: + if image_path and os.path.exists(image_path): + pywhatkit.sendwhats_image( + phone_number, + image_path, + message, + wait_time=20, + tab_close=True + ) + else: + pywhatkit.sendwhatmsg( + phone_number, + message, + send_time.hour, + send_time.minute, + wait_time=20, + tab_close=True + ) + + # Log the message + self._log_message(phone_number, message, "sent") + st.success(f"โœ… Message sent successfully to {phone_number}") + return True + + except Exception as e: + error_msg = f"PyWhatKit error: {str(e)}" + st.error(f"โŒ {error_msg}") + self._log_message(phone_number, message, "failed", error_msg) + return False + + except Exception as e: + error_msg = f"Unexpected error: {str(e)}" + st.error(f"โŒ {error_msg}") + self._log_message(phone_number, message, "failed", error_msg) + return False + + def send_bulk_messages(self, customer_ids, message_template): + """Send messages to multiple customers""" + results = [] + total_customers = len(customer_ids) + + progress_bar = st.progress(0) + status_text = st.empty() + + for i, customer_id in enumerate(customer_ids): + try: + # Update progress + progress = (i + 1) / total_customers + progress_bar.progress(progress) + status_text.text(f"Processing {i+1}/{total_customers} customers...") + + customer = self.db.get_dataframe('customers', + f"SELECT * FROM customers WHERE customer_id = {customer_id}") + + if not customer.empty: + customer_data = customer.iloc[0] + phone = customer_data['mobile'] + + if phone and pd.notna(phone) and str(phone).strip(): + personalized_msg = self._personalize_message(message_template, customer_data) + success = self.send_message(phone, personalized_msg) + + results.append({ + 'customer_id': customer_id, + 'customer_name': customer_data['name'], + 'phone': phone, + 'status': 'sent' if success else 'failed', + 'message': personalized_msg[:50] + "..." if len(personalized_msg) > 50 else personalized_msg + }) + else: + results.append({ + 'customer_id': customer_id, + 'customer_name': customer_data['name'], + 'phone': phone, + 'status': 'failed', + 'message': 'No phone number available' + }) + else: + results.append({ + 'customer_id': customer_id, + 'customer_name': 'Unknown', + 'phone': 'N/A', + 'status': 'failed', + 'message': 'Customer not found' + }) + + # Small delay to avoid rate limiting + time.sleep(2) + + except Exception as e: + results.append({ + 'customer_id': customer_id, + 'customer_name': 'Error', + 'phone': 'N/A', + 'status': 'failed', + 'message': f'Error: {str(e)}' + }) + + progress_bar.empty() + status_text.empty() + + return results + + def send_distributor_message(self, distributor_id, message): + """Send message to distributor""" + try: + distributor = self.db.get_dataframe('distributors', + f"SELECT * FROM distributors WHERE distributor_id = {distributor_id}") + + if not distributor.empty: + distributor_data = distributor.iloc[0] + phone = distributor_data['mantri_mobile'] + + if phone and pd.notna(phone) and str(phone).strip(): + personalized_msg = self._personalize_distributor_message(message, distributor_data) + return self.send_message(phone, personalized_msg) + else: + st.warning(f"No mobile number found for distributor: {distributor_data['name']}") + return False + else: + st.error("Distributor not found") + return False + + except Exception as e: + st.error(f"Error sending distributor message: {e}") + return False + + def _personalize_distributor_message(self, template, distributor_data): + """Personalize message for distributor""" + message = template + message = message.replace('{name}', distributor_data.get('mantri_name', 'Distributor')) + message = message.replace('{distributor_name}', distributor_data.get('name', '')) + message = message.replace('{village}', distributor_data.get('village', '')) + message = message.replace('{taluka}', distributor_data.get('taluka', '')) + message = message.replace('{sabhasad_count}', str(distributor_data.get('sabhasad_count', 0))) + return message + + def _clean_phone_number(self, phone): + """Clean and validate phone number""" + if not phone or pd.isna(phone): + return None + + # Convert to string and remove spaces, hyphens, etc. + phone_str = str(phone).strip() + clean_phone = ''.join(filter(str.isdigit, phone_str)) + + # Validate length + if len(clean_phone) < 10: + return None + + # Add country code if missing (assuming India) + if len(clean_phone) == 10: + clean_phone = '91' + clean_phone + elif len(clean_phone) == 11 and clean_phone.startswith('0'): + clean_phone = '91' + clean_phone[1:] + elif len(clean_phone) == 12 and clean_phone.startswith('91'): + # Already correct format + pass + else: + # If longer than 12 digits, take last 12 + if len(clean_phone) > 12: + clean_phone = clean_phone[-12:] + + return '+' + clean_phone + + def _personalize_message(self, template, customer_data): + """Personalize message with customer data""" + message = template + message = message.replace('{name}', customer_data.get('name', 'Customer')) + message = message.replace('{village}', customer_data.get('village', '')) + message = message.replace('{taluka}', customer_data.get('taluka', '')) + message = message.replace('{district}', customer_data.get('district', '')) + + # Add current date + current_date = datetime.now().strftime('%d-%m-%Y') + message = message.replace('{date}', current_date) + + return message + + def _log_message(self, phone, message, status, error=None): + """Log WhatsApp message in database""" + try: + # Ensure whatsapp_logs table exists + self.db.execute_query(''' + CREATE TABLE IF NOT EXISTS whatsapp_logs ( + log_id INTEGER PRIMARY KEY AUTOINCREMENT, + customer_id INTEGER, + distributor_id INTEGER, + phone_number TEXT, + message_content TEXT, + message_type TEXT, + status TEXT, + error_message TEXT, + sent_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + FOREIGN KEY (customer_id) REFERENCES customers (customer_id) ON DELETE SET NULL, + FOREIGN KEY (distributor_id) REFERENCES distributors (distributor_id) ON DELETE SET NULL + ) + ''', log_action=False) + + # Find customer by phone (last 10 digits) + customer_result = self.db.execute_query( + 'SELECT customer_id FROM customers WHERE mobile LIKE ?', + (f'%{phone[-10:]}%',), + log_action=False + ) + + customer_id = customer_result[0][0] if customer_result else None + + # Find distributor by phone + distributor_result = self.db.execute_query( + 'SELECT distributor_id FROM distributors WHERE mantri_mobile LIKE ?', + (f'%{phone[-10:]}%',), + log_action=False + ) + + distributor_id = distributor_result[0][0] if distributor_result else None + + # Determine message type + message_type = 'customer' if customer_id else 'distributor' if distributor_id else 'general' + + self.db.execute_query(''' + INSERT INTO whatsapp_logs (customer_id, distributor_id, phone_number, message_content, message_type, status, error_message) + VALUES (?, ?, ?, ?, ?, ?, ?) + ''', (customer_id, distributor_id, phone, message, message_type, status, error), log_action=False) + + except Exception as e: + self.logger.error(f"Failed to log message: {e}") + + def get_message_stats(self): + """Get messaging statistics""" + try: + stats = self.db.execute_query(''' + SELECT + COUNT(*) as total_messages, + SUM(CASE WHEN status = 'sent' THEN 1 ELSE 0 END) as sent_messages, + SUM(CASE WHEN status = 'failed' THEN 1 ELSE 0 END) as failed_messages, + MAX(sent_date) as last_message_date + FROM whatsapp_logs + ''', log_action=False) + + if stats: + return { + 'total_messages': stats[0][0] or 0, + 'sent_messages': stats[0][1] or 0, + 'failed_messages': stats[0][2] or 0, + 'last_message_date': stats[0][3] + } + return {} + + except Exception as e: + self.logger.error(f"Error getting message stats: {e}") + return {} + + def get_recent_messages(self, limit=10): + """Get recent WhatsApp messages""" + try: + messages = self.db.get_dataframe('whatsapp_logs', f''' + SELECT wl.*, + c.name as customer_name, + d.name as distributor_name + FROM whatsapp_logs wl + LEFT JOIN customers c ON wl.customer_id = c.customer_id + LEFT JOIN distributors d ON wl.distributor_id = d.distributor_id + ORDER BY wl.sent_date DESC + LIMIT {limit} + ''') + return messages + except Exception as e: + self.logger.error(f"Error getting recent messages: {e}") + return pd.DataFrame() + + def send_welcome_message(self, phone_number, name, role="customer"): + """Send welcome message to new customers/distributors""" + if role == "distributor": + message = f"""Welcome {name}! ๐ŸŽ‰ + +Thank you for joining our distributor network! + +We're excited to have you on board and look forward to working together to grow your business. + +Our team will contact you shortly to discuss: +โ€ข Training schedule +โ€ข Product information +โ€ข Sales strategies +โ€ข Support systems + +For any immediate queries, feel free to contact us. + +Best regards, +Sales Team""" + else: + message = f"""Welcome {name}! ๐ŸŽ‰ + +Thank you for choosing us! + +We're delighted to have you as our customer and look forward to serving you with the best products and service. + +Feel free to reach out for any queries or support. + +Best regards, +Sales Team""" + + return self.send_message(phone_number, message) + + def send_payment_reminder(self, customer_id, invoice_no, pending_amount): + """Send payment reminder to customer""" + try: + customer = self.db.get_dataframe('customers', + f"SELECT * FROM customers WHERE customer_id = {customer_id}") + + if not customer.empty: + customer_data = customer.iloc[0] + phone = customer_data['mobile'] + + if phone and pd.notna(phone) and str(phone).strip(): + message = f"""Hello {customer_data['name']}, + +This is a friendly reminder regarding your pending payment. + +Invoice: {invoice_no} +Pending Amount: โ‚น{pending_amount:,.2f} + +Please make the payment at your earliest convenience. + +Thank you for your cooperation! + +Best regards, +Sales Team""" + + return self.send_message(phone, message) + else: + st.warning(f"No mobile number found for customer: {customer_data['name']}") + return False + else: + st.error("Customer not found") + return False + + except Exception as e: + st.error(f"Error sending payment reminder: {e}") + return False + +# Utility function to check WhatsApp availability +def check_whatsapp_availability(): + """Check if WhatsApp features are available""" + try: + import pywhatkit + return True + except ImportError: + return False + +# Example usage and test function +def test_whatsapp_manager(db): + """Test WhatsApp manager functionality""" + st.subheader("๐Ÿงช WhatsApp Manager Test") + + if st.button("Test WhatsApp Connection"): + try: + manager = WhatsAppManager(db) + + # Test phone number cleaning + test_numbers = ["9876543210", "09876543210", "919876543210"] + for num in test_numbers: + cleaned = manager._clean_phone_number(num) + st.write(f"Original: {num} โ†’ Cleaned: {cleaned}") + + # Test message personalization + test_customer = {'name': 'John Doe', 'village': 'Test Village'} + personalized = manager._personalize_message("Hello {name} from {village}!", test_customer) + st.write(f"Personalized message: {personalized}") + + st.success("โœ… WhatsApp manager test completed successfully!") + + except Exception as e: + st.error(f"โŒ WhatsApp manager test failed: {e}") \ No newline at end of file