File size: 16,774 Bytes
0ea575d
063f5af
40032c3
 
 
 
 
 
38c96d1
40032c3
 
 
 
14ee8e9
 
40032c3
 
 
 
4c1d2cd
 
 
 
 
 
40032c3
 
 
 
 
 
 
 
14ee8e9
40032c3
 
 
 
 
 
14ee8e9
40032c3
 
 
 
 
 
14ee8e9
40032c3
 
 
 
 
 
14ee8e9
40032c3
 
 
 
 
 
14ee8e9
40032c3
 
4c1d2cd
 
 
 
 
 
40032c3
 
 
 
 
 
 
 
14ee8e9
40032c3
 
 
 
 
 
14ee8e9
40032c3
 
 
 
 
 
14ee8e9
40032c3
 
 
 
 
 
14ee8e9
40032c3
 
 
 
 
 
14ee8e9
40032c3
 
4c1d2cd
 
 
 
 
 
40032c3
 
 
 
 
 
 
 
14ee8e9
40032c3
 
 
 
 
 
14ee8e9
40032c3
 
4c1d2cd
 
 
 
 
 
40032c3
 
 
4c1d2cd
40032c3
 
4c1d2cd
40032c3
 
4c1d2cd
 
40032c3
 
 
 
 
 
4c1d2cd
 
40032c3
 
 
 
 
 
 
 
 
 
 
 
 
 
4c1d2cd
 
 
 
 
 
 
 
 
14ee8e9
4c1d2cd
 
 
 
 
 
 
 
 
 
 
 
 
 
14ee8e9
40032c3
4c1d2cd
 
 
 
 
 
40032c3
 
 
 
 
 
 
 
 
14ee8e9
40032c3
 
 
 
 
 
 
 
14ee8e9
40032c3
 
4c1d2cd
 
 
 
 
 
40032c3
 
 
 
 
 
 
 
14ee8e9
40032c3
 
 
 
 
 
 
14ee8e9
40032c3
 
 
 
 
 
 
14ee8e9
40032c3
 
 
 
 
 
 
14ee8e9
40032c3
 
a40e4c4
 
 
14ee8e9
a40e4c4
 
 
a4c293a
 
 
 
 
 
 
a40e4c4
40032c3
 
f80fd9f
40032c3
 
 
 
 
 
 
 
 
b95deb6
 
4c1d2cd
 
 
 
14ee8e9
4c1d2cd
2639a2b
4c1d2cd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14ee8e9
 
 
 
 
 
a40e4c4
 
 
 
14ee8e9
a40e4c4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40032c3
 
38c96d1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
<!doctype html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <title>Quotation Generator</title>
        <link rel="stylesheet" href="style.css" />
    </head>

    <body class="bg-gray-100">
        <h1 class="text-3xl font-bold text-center my-8" id="top-header">
            Quotation Generator
        </h1>
        <div class="flex flex-col lg:flex-row container mx-auto gap-4">
            <div id="form-container" class="w-full lg:w-1/2">
                <form
                    id="quotation-form"
                    class="bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4"
                >
                    <fieldset
                        class="border border-gray-300 p-4 mb-4 rounded-lg"
                    >
                        <legend
                            class="text-lg font-semibold mb-2 text-gray-700"
                        >
                            Your Company Details
                        </legend>
                        <input
                            type="text"
                            id="company-name"
                            name="company-name"
                            placeholder="Company Name"
                            required
                            class="w-full p-2 border border-gray-300 rounded mb-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
                        />
                        <textarea
                            id="company-address"
                            name="company-address"
                            placeholder="Address"
                            required
                            class="w-full p-2 border border-gray-300 rounded mb-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
                        ></textarea>
                        <input
                            type="text"
                            id="company-phone"
                            name="company-phone"
                            placeholder="Phone"
                            class="w-full p-2 border border-gray-300 rounded mb-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
                        />
                        <input
                            type="email"
                            id="company-email"
                            name="company-email"
                            placeholder="Email"
                            class="w-full p-2 border border-gray-300 rounded mb-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
                        />
                        <input
                            type="text"
                            id="company-gstin"
                            name="company-gstin"
                            placeholder="GSTIN"
                            class="w-full p-2 border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-blue-500"
                        />
                    </fieldset>
                    <fieldset
                        class="border border-gray-300 p-4 mb-4 rounded-lg"
                    >
                        <legend
                            class="text-lg font-semibold mb-2 text-gray-700"
                        >
                            Customer Company Details
                        </legend>
                        <input
                            type="text"
                            id="customer-name"
                            name="customer-name"
                            placeholder="Customer Name"
                            required
                            class="w-full p-2 border border-gray-300 rounded mb-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
                        />
                        <textarea
                            id="customer-address"
                            name="customer-address"
                            placeholder="Address"
                            required
                            class="w-full p-2 border border-gray-300 rounded mb-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
                        ></textarea>
                        <input
                            type="text"
                            id="customer-phone"
                            name="customer-phone"
                            placeholder="Phone"
                            class="w-full p-2 border border-gray-300 rounded mb-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
                        />
                        <input
                            type="email"
                            id="customer-email"
                            name="customer-email"
                            placeholder="Email"
                            class="w-full p-2 border border-gray-300 rounded mb-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
                        />
                        <input
                            type="text"
                            id="customer-gstin"
                            name="customer-gstin"
                            placeholder="GSTIN"
                            class="w-full p-2 border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-blue-500"
                        />
                    </fieldset>
                    <fieldset
                        class="border border-gray-300 p-4 mb-4 rounded-lg"
                    >
                        <legend
                            class="text-lg font-semibold mb-2 text-gray-700"
                        >
                            Quotation Details
                        </legend>
                        <input
                            type="text"
                            id="quotation-number"
                            name="quotation-number"
                            placeholder="Quotation Number"
                            required
                            class="w-full p-2 border border-gray-300 rounded mb-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
                        />
                        <input
                            type="date"
                            id="quotation-date"
                            name="quotation-date"
                            required
                            class="w-full p-2 border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-blue-500"
                        />
                    </fieldset>
                    <fieldset
                        class="border border-gray-300 p-4 mb-4 rounded-lg"
                    >
                        <legend
                            class="text-lg font-semibold mb-2 text-gray-700"
                        >
                            Items
                        </legend>
                        <div
                            class="bg-blue-50 border border-blue-200 rounded p-2 mb-3 text-xs text-blue-800"
                        >
                            <strong>💡 Tips:</strong>
                            <ul class="list-disc list-inside mt-1 space-y-0.5">
                                <li>
                                    Use
                                    <kbd
                                        class="bg-gray-200 px-1 rounded text-xs"
                                        >Enter</kbd
                                    >
                                    to move to the next field or add a new row
                                </li>
                                <li>
                                    Use
                                    <kbd
                                        class="bg-gray-200 px-1 rounded text-xs"
                                        >Ctrl+I</kbd
                                    >
                                    to quickly add a new item
                                </li>
                                <li>
                                    Amounts are calculated automatically as you
                                    type
                                </li>
                                <li>
                                    At least one item with description is
                                    required
                                </li>
                            </ul>
                        </div>
                        <!-- Items Container -->
                        <div id="items-container" class="space-y-4">
                            <!-- Items will be dynamically added here -->
                        </div>
                        <div class="flex justify-center mt-4">
                            <button
                                type="button"
                                id="add-item"
                                class="bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-4 rounded-md flex items-center gap-2 shadow-sm"
                            >
                                <svg
                                    xmlns="http://www.w3.org/2000/svg"
                                    class="h-4 w-4"
                                    viewBox="0 0 20 20"
                                    fill="currentColor"
                                >
                                    <path
                                        fill-rule="evenodd"
                                        d="M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z"
                                        clip-rule="evenodd"
                                    />
                                </svg>
                                Add Another Item
                            </button>
                        </div>
                    </fieldset>
                    <fieldset
                        class="border border-gray-300 p-4 mb-4 rounded-lg"
                    >
                        <legend
                            class="text-lg font-semibold mb-2 text-gray-700"
                        >
                            Additional Charges
                        </legend>
                        <label class="block mb-2"
                            >IGST (%)<input
                                type="number"
                                id="igst-rate"
                                name="igst-rate"
                                value="0"
                                min="0"
                                class="w-full p-2 border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-blue-500"
                        /></label>
                        <label class="block"
                            >Freight Charges<input
                                type="number"
                                id="freight-charges"
                                name="freight-charges"
                                value="0"
                                min="0"
                                class="w-full p-2 border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-blue-500"
                        /></label>
                    </fieldset>
                    <fieldset
                        class="border border-gray-300 p-4 mb-4 rounded-lg"
                    >
                        <legend
                            class="text-lg font-semibold mb-2 text-gray-700"
                        >
                            Bank Details
                        </legend>
                        <input
                            type="text"
                            id="bank-name"
                            name="bank-name"
                            placeholder="Bank Name"
                            required
                            class="w-full p-2 border border-gray-300 rounded mb-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
                        />
                        <input
                            type="text"
                            id="bank-account"
                            name="bank-account"
                            placeholder="Account Number"
                            required
                            class="w-full p-2 border border-gray-300 rounded mb-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
                        />
                        <input
                            type="text"
                            id="bank-ifsc"
                            name="bank-ifsc"
                            placeholder="IFSC Code"
                            required
                            class="w-full p-2 border border-gray-300 rounded mb-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
                        />
                        <input
                            type="text"
                            id="bank-branch"
                            name="bank-branch"
                            placeholder="Branch"
                            required
                            class="w-full p-2 border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-blue-500"
                        />
                    </fieldset>
                    <div class="flex justify-between items-center">
                        <button
                            type="submit"
                            class="bg-green-500 hover:bg-green-600 text-white font-bold py-2 px-4 rounded-lg shadow-md transition-all duration-200 ease-in-out transform hover:scale-105"
                        >
                            Generate Quotation
                        </button>
                        <button
                            type="button"
                            id="clear-data"
                            class="bg-red-500 hover:bg-red-600 text-white font-bold py-2 px-4 rounded-lg shadow-md transition-all duration-200 ease-in-out transform hover:scale-105"
                        >
                            Clear Saved Data
                        </button>
                    </div>
                </form>
            </div>
            <div id="preview-container" class="w-full lg:w-1/2 hidden lg:block">
                <div
                    id="quotation-preview"
                    class="bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4"
                >
                    <h2 class="text-2xl font-bold text-center mb-4">
                        Quotation Preview
                    </h2>
                    <div id="preview-content"></div>
                </div>
            </div>
        </div>
        <div
            id="quotation-output"
            class="hidden fixed inset-0 bg-gray-900 bg-opacity-75 z-50 overflow-y-auto"
        >
            <div class="flex items-center justify-center min-h-screen">
                <div
                    class="bg-white p-8 rounded-lg max-w-4xl w-full mx-auto my-8 relative"
                >
                    <button
                        id="close-quotation"
                        class="absolute top-4 right-4 text-gray-500 hover:text-gray-800"
                    >
                        <svg
                            xmlns="http://www.w3.org/2000/svg"
                            class="h-6 w-6"
                            fill="none"
                            viewBox="0 0 24 24"
                            stroke="currentColor"
                        >
                            <path
                                stroke-linecap="round"
                                stroke-linejoin="round"
                                stroke-width="2"
                                d="M6 18L18 6M6 6l12 12"
                            />
                        </svg>
                    </button>
                    <div id="quotation-content"></div>
                </div>
            </div>
        </div>

        <!-- Data Management Status Modal -->
        <div
            id="status-modal"
            class="fixed inset-0 bg-gray-600 bg-opacity-50 hidden items-center justify-center z-50"
        >
            <div class="bg-white p-6 rounded-lg shadow-lg max-w-sm mx-auto">
                <div id="modal-content" class="text-center">
                    <div id="modal-message" class="mb-4"></div>
                    <button
                        id="modal-close"
                        class="bg-blue-500 hover:bg-blue-600 text-white font-bold py-2 px-4 rounded-lg shadow-md transition-all duration-200 ease-in-out transform hover:scale-105"
                    >
                        OK
                    </button>
                </div>
            </div>
        </div>

        <script src="data-manager.js"></script>
        <script src="script.js"></script>
    </body>
</html>