Subversion Repositories SmartDukaan

Rev

Rev 36641 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 36641 Rev 36668
Line 1... Line 1...
1
<section class="wrapper">
1
<section class="wrapper">
2
	<div class="row">
2
	<div class="row">
3
		<div class="col-lg-12">
3
		<div class="col-lg-12">
4
			<h3 class="page-header"><i class="icon_document_alt"></i> BEAT PLAN — BULK UPLOAD</h3>
4
			<h3 class="page-header"><i class="icon_document_alt"></i> BEAT PLAN - BULK UPLOAD</h3>
5
			<ol class="breadcrumb">
5
			<ol class="breadcrumb">
6
				<li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
6
				<li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
7
				<li><i class="icon_document_alt"></i>Beat Plan Bulk Upload</li>
7
				<li><i class="icon_document_alt"></i>Beat Plan Bulk Upload</li>
8
			</ol>
8
			</ol>
9
		</div>
9
		</div>
Line 11... Line 11...
11
 
11
 
12
	<div class="row">
12
	<div class="row">
13
		<div class="col-lg-8">
13
		<div class="col-lg-8">
14
			<div class="panel panel-default">
14
			<div class="panel panel-default">
15
				<div class="panel-heading">
15
				<div class="panel-heading">
16
					<strong>Upload Beat Plans CSV</strong>
16
					<strong>Upload Beat Plans (XLSX)</strong>
17
					<a href="${rc.contextPath}/beatPlan/downloadTemplate" class="btn btn-xs btn-info pull-right">Download
17
					<a href="${rc.contextPath}/beatPlan/downloadTemplate" class="btn btn-xs btn-info pull-right">Download
18
						Template</a>
18
						Template</a>
19
				</div>
19
				</div>
20
				<div class="panel-body">
20
				<div class="panel-body">
21
					<p style="margin-bottom:15px;color:#666;">
21
					<p style="margin-bottom:15px;color:#666;">
22
						Upload a CSV file to create beat plans and schedule them on the calendar in one go.<br>
22
						Upload an Excel file (.xlsx) to create beat plans and schedule them on the calendar in one
-
 
23
						go.<br>
23
						Each row defines one partner visit within a beat. Beats are grouped by <strong>beat_name +
24
						<strong>One partner per row.</strong> Beats are grouped by <strong>beat_name +
24
						auth_user_id</strong>.
25
						auth_user_id</strong>.
25
					</p>
26
					</p>
26
 
27
 
27
					<div class="well" style="background:#f9f9f9;">
28
					<div class="well" style="background:#f9f9f9;">
28
						<strong>CSV Format (one row = one day):</strong>
29
						<strong>XLSX Format (one row = one partner):</strong>
29
						<table class="table table-bordered table-condensed" style="margin-top:10px;font-size:12px;">
30
						<table class="table table-bordered table-condensed" style="margin-top:10px;font-size:12px;">
30
							<thead>
31
							<thead>
31
							<tr style="background:#eee;">
32
							<tr style="background:#eee;">
32
								<th>beat_name</th>
33
								<th>beat_name</th>
33
								<th>auth_user_id</th>
34
								<th>auth_user_id</th>
34
								<th>start_date</th>
35
								<th>start_date</th>
35
								<th>day_number</th>
36
								<th>day_number</th>
-
 
37
								<th>sequence_order</th>
36
								<th>partner_codes</th>
38
								<th>partner_code</th>
37
							</tr>
39
							</tr>
38
							</thead>
40
							</thead>
39
							<tbody>
41
							<tbody>
40
							<tr>
42
							<tr>
41
								<td>Jaipur East Route</td>
43
								<td>Jaipur East Route</td>
42
								<td>280</td>
44
								<td>280</td>
43
								<td>2026-06-02</td>
45
								<td>2026-06-02</td>
44
								<td>1</td>
46
								<td>1</td>
-
 
47
								<td>1</td>
45
								<td>RJKAI1478,RJBUN1449,RJDEG1443</td>
48
								<td>RJKAI1478</td>
46
							</tr>
49
							</tr>
47
							<tr>
50
							<tr>
48
								<td>Jaipur East Route</td>
-
 
49
								<td>280</td>
-
 
50
								<td></td>
51
								<td></td>
-
 
52
								<td></td>
-
 
53
								<td></td>
-
 
54
								<td>1</td>
51
								<td>2</td>
55
								<td>2</td>
52
								<td>RJALR1362,RJBTR1388</td>
56
								<td>RJBUN1449</td>
53
							</tr>
57
							</tr>
54
							<tr>
58
							<tr>
55
								<td>Jaipur East Route</td>
-
 
56
								<td>280</td>
-
 
57
								<td></td>
59
								<td></td>
-
 
60
								<td></td>
-
 
61
								<td></td>
-
 
62
								<td>1</td>
58
								<td>3</td>
63
								<td>3</td>
-
 
64
								<td>RJDEG1443</td>
-
 
65
							</tr>
-
 
66
							<tr>
-
 
67
								<td></td>
-
 
68
								<td></td>
-
 
69
								<td></td>
-
 
70
								<td>2</td>
-
 
71
								<td>1</td>
-
 
72
								<td>RJALR1362</td>
-
 
73
							</tr>
-
 
74
							<tr>
-
 
75
								<td></td>
-
 
76
								<td></td>
-
 
77
								<td></td>
-
 
78
								<td>2</td>
-
 
79
								<td>2</td>
-
 
80
								<td>RJBTR1388</td>
-
 
81
							</tr>
-
 
82
							<tr>
-
 
83
								<td></td>
-
 
84
								<td></td>
-
 
85
								<td></td>
-
 
86
								<td>3</td>
-
 
87
								<td>1</td>
59
								<td>RJRSD1518,RJSML356</td>
88
								<td>RJRSD1518</td>
-
 
89
							</tr>
-
 
90
							<tr>
-
 
91
								<td></td>
-
 
92
								<td></td>
-
 
93
								<td></td>
-
 
94
								<td>3</td>
-
 
95
								<td>2</td>
-
 
96
								<td>RJSML356</td>
60
							</tr>
97
							</tr>
61
							<tr style="border-top:2px solid #ccc;">
98
							<tr style="border-top:2px solid #ccc;">
62
								<td>Agra Circuit</td>
99
								<td>Agra Circuit</td>
63
								<td>145</td>
100
								<td>145</td>
64
								<td>2026-06-05</td>
101
								<td>2026-06-05</td>
65
								<td>1</td>
102
								<td>1</td>
-
 
103
								<td>1</td>
66
								<td>UPAGR101,UPAGR102,UPAGR103</td>
104
								<td>UPAGR101</td>
-
 
105
							</tr>
-
 
106
							<tr>
-
 
107
								<td></td>
-
 
108
								<td></td>
-
 
109
								<td></td>
-
 
110
								<td>1</td>
-
 
111
								<td>2</td>
-
 
112
								<td>UPAGR102</td>
67
							</tr>
113
							</tr>
68
							</tbody>
114
							</tbody>
69
						</table>
115
						</table>
70
						<p style="font-size:11px;color:#888;">
116
						<p style="font-size:11px;color:#888;">
71
							<strong>beat_name</strong>: Name for the beat — <strong>only needed on day 1</strong>. Leave
117
							<strong>beat_name</strong>: Name for the beat - <strong>only on the first row of the
-
 
118
							beat</strong>.
72
							blank for day 2, 3 etc (auto-uses day 1's name). Extra spaces are normalized
119
							Leave blank for subsequent rows of the same beat. Extra spaces are normalized automatically.<br>
-
 
120
							<strong>auth_user_id</strong>: Sales user ID - <strong>only on the first row of the
73
							automatically.<br>
121
							beat</strong>.<br>
74
							<strong>auth_user_id</strong>: ID of the sales user<br>
-
 
75
							<strong>start_date</strong>: Start date (YYYY-MM-DD) — <strong>only needed on day 1</strong>.
122
							<strong>start_date</strong>: Start date (YYYY-MM-DD) - <strong>only on the first row of the
-
 
123
							beat</strong>.
76
							System auto-calculates day 2, 3 etc skipping holidays. Leave empty for unscheduled beat.<br>
124
							System auto-calculates remaining days, skipping holidays. Leave empty for unscheduled
-
 
125
							beat.<br>
77
							<strong>day_number</strong>: Day within the beat (1, 2, 3...)<br>
126
							<strong>day_number</strong>: Day within the beat (1, 2, 3...) - required on every row.<br>
78
							<strong>partner_codes</strong>: Comma-separated partner codes for this day (in visit
127
							<strong>sequence_order</strong>: Visit order within the day (1, 2, 3...). Optional - row
79
							order)<br><br>
128
							order is used if blank.<br>
-
 
129
							<strong>partner_code</strong>: Single partner code for this row.<br><br>
80
							Multiple users &amp; beats in one file — just use different auth_user_id.
130
							Multiple beats in one file - just start a new beat row (non-blank beat_name) wherever you
-
 
131
							want to switch.
81
						</p>
132
						</p>
82
					</div>
133
					</div>
83
 
134
 
84
					<form id="beat-bulk-form" enctype="multipart/form-data" style="margin-top:15px;">
135
					<form id="beat-bulk-form" enctype="multipart/form-data" style="margin-top:15px;">
85
						<div class="form-group">
136
						<div class="form-group">
86
							<label>Select CSV File</label>
137
							<label>Select XLSX File</label>
87
							<input type="file" id="beat-bulk-file" name="file" accept=".csv" class="form-control">
138
							<input type="file" id="beat-bulk-file" name="file" accept=".xlsx" class="form-control">
88
						</div>
139
						</div>
89
						<div class="checkbox" style="margin-bottom:10px;">
140
						<div class="checkbox" style="margin-bottom:10px;">
90
							<label><input type="checkbox" id="beat-bulk-include-sundays"> Include Sundays (don't skip
141
							<label><input type="checkbox" id="beat-bulk-include-sundays"> Include Sundays (don't skip
91
								Sundays when scheduling)</label>
142
								Sundays when scheduling)</label>
92
						</div>
143
						</div>
Line 102... Line 153...
102
 
153
 
103
<script>
154
<script>
104
	$(document).on('click', '.beat-bulk-submit', function () {
155
	$(document).on('click', '.beat-bulk-submit', function () {
105
		var fileInput = document.getElementById('beat-bulk-file');
156
		var fileInput = document.getElementById('beat-bulk-file');
106
		if (!fileInput.files || !fileInput.files[0]) {
157
		if (!fileInput.files || !fileInput.files[0]) {
107
			alert('Please select a CSV file');
158
			alert('Please select an XLSX file');
108
			return;
159
			return;
109
		}
160
		}
110
 
161
 
111
		var formData = new FormData();
162
		var formData = new FormData();
112
		formData.append('file', fileInput.files[0]);
163
		formData.append('file', fileInput.files[0]);