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
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
|
<!DOCTYPE html> <html lang="en-HK" prefix="og: http://ogp.me/ns#">
<head> <!-- Required meta tags --> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /> <title>Invoice Recurring Create</title>
<!-- css --> <?php include 'inc/headlinks.php'; ?> <?php include 'inc/link-js.php'; ?> <!-- End layout styles -->
</head>
<body> <div class="container-scroller"> <!-- partial:partials/_sidebar.html -->
<?php include 'inc/sidebar.php'; ?> <!-- partial -->
<div class="container-fluid page-body-wrapper">
<!-- partial:partials/_navbar.html --> <?php include 'inc/navbar.php'; ?> <!-- partial -->
<div class="main-panel"> <!-- breadcrumb --> <div class="page-title-box d-flex align-items-center justify-content-between"> <ol class="breadcrumb m-0 p-0">
<li class="breadcrumb-item"><a href="invoice_recurring.php">Invoice Recurring</a></li>
<li class="breadcrumb-item active">Invoice Recurring Create</li> </ol>
</div> <!-- breadcrumb end --> <div class="content-wrapper pb-0">
<!-- Form --> <div class="card-body boxShadow whiteBg mb-3">
<form> <div class="row">
<div class="col-md-12"> <div class="row mb-4 w-100"> <div class="col-6 col-lg-3 small"> <span class="bold"> Created At :</span><br> 30 Jan 2020 05:50:00 </div> <div class="col-6 col-lg-3 small"> <span class="bold"> Created By :</span><br> May Chan </div> <div class="col-6 col-lg-3 small"> <span class="bold"> Last Update At :</span><br> 30 Jan 2020 05:50:00 </div> <div class="col-6 col-lg-3 small"> <span class="bold"> Last Update By :</span><br> May Chan </div> </div> <p> Invoice Recurring <span class="small text-muted">(Auto Generate)</span>: <span class="text-danger h3">IC-200001</span> </p>
</div> <div class="col-md-4"> <div class="form-group"> <label for="CustomerName">Customer Name </label>
<input type="text" class="form-control mainSearchInput normalSearch" aria-describedby="search" value="" placeholder="" autocomplete="nope"> </div> </div>
<div class="col-md-4"> <div class="form-group">
<label for="Salesman">Salesman </label> <select class="form-control" id="Salesman"> <option value=""></option> <option value="Amy">Amy Wong</option> <option value="Jackie">Jackie Wong</option>
</select> </div> </div>
<div class="col-md-4"> <div class="form-group">
<label for="Currency">Currency </label> <select class="form-control" id="Currency"> <option value=""></option> <option value="HKD">HKD</option> <option value="USD">USD</option>
</select> </div> </div> <div class="col-md-3"> <div class="form-group"> <label for="StartDate">Start Date</label> <input type="text" class="form-control date" id="StartDate" value=""> </div> </div> <div class="col-md-3"> <div class="form-group"> <label for="EndDate">End Date</label> <input type="text" class="form-control date" id="EndDate" value=""> </div> </div> <div class="col-md-3"> <div class="form-group"> <label>Repeat every</label> <div class="d-flex"> <input type="text" class="form-control" value=""> <select class="form-control" id="QuotationNo">
<option value="Month">Month</option> <option value="Year">Year</option>
</select> </div> </div> </div>
<div class="col-md-3"> <div class="form-group"> <label for="Cycles">Remaining Cycles</label> <div class="d-flex"> <input type="text" class="form-control" id="Cycles" value=""> <div class="form-check"> <input class="form-check-input" type="radio" name="Neverexpires" id="Neverexpires" value=""> <label class="form-check-label nowrap" for="Neverexpires"> Never expires
</label> </div> </div> </div> </div>
<div class="col-md-6">
<div class="boxShadow whiteBg mt-3 mb-3"> <!-- bill Form --> <?php include 'component/billaddress.php'; ?>
<!-- bill Form END --> </div> </div> <div class="col-md-6">
<div class="boxShadow whiteBg mt-3 mb-3"> <!-- ship Form --> <?php include 'component/shippingaddress.php'; ?>
<!-- ship Form END --> </div> </div>
<div class="col-md-12"> <div id="grid" class="newGrid"></div>
</div> <div class="col-md-12"> <hr> <div class="d-flex justify-content-between"> <p class="small">Subtotal <span class="text-muted">(Discount Included)</span> </p> <p class="text-secondary">$0.00 </p> </div>
<div class="d-flex justify-content-between"> <p class="small">Total Cost </p> <p class="text-secondary">$0.00 </p> </div> <div class="d-flex justify-content-between double_border_bottom mb-4"> <p class="h1">Total Amount </p> <p class="h1">$0.00 </p> </div> </div> <div class="col-md-6"> <div class="form-group row align-items-center"> <label class="col-sm-4 text-muted mb-3" for="PaymentTerms">Payment Terms : </label> <div class="col-sm-8"> <div class="form-group"> <select class="form-control">
<option value="Default" Selected>Default</option> <option value="Template01">Template01</option> <option value="Template01">Template01</option> <option value="Template01">Template01</option> </select> </div> </div> </div>
<textarea class="form-control" id="Remarks" rows="4" id="PaymentTerms"></textarea> </div> <div class="col-md-6"> <div class="form-group"> <label for="Remarks">Invoice Remarks</label> <textarea class="form-control" id="Remarks" rows="2"></textarea> </div> <div class="form-group"> <label for="Remarks ">Remarks <span class="text-muted">(For Internal Use)</span></label> <textarea class="form-control" id="Remarks" rows="2"></textarea> </div> </div> <div class="col-md-12 text-right"> <hr> <button type="button" class="btn btn-secondary" onclick="location.href='invoice_recurring.php';">Back</button>
<button type="button" class="btn btn-primary submitDate shadow_blue">Create</button>
</div>
</div>
</div> </form> <!-- content-wrapper ends --> <!-- partial:partials/_footer.html --> <?php include 'inc/footer.php'; ?> <!-- partial --> </div> <!-- main-panel ends --> </div> <!-- page-body-wrapper ends --> </div>
<!-- Modal Customer--> <?php include 'component/add_customer.php'; ?>
<script src="../assets/datatables/buttons/1.1.2/js/dataTables.buttons.min.js?<?= rand(1, 10000) / 7; ?>"></script> <script src="../assets/datatables/select/1.1.2/js/dataTables.select.min.js?<?= rand(1, 10000) / 7; ?>"></script> <script src="../assets/js/bootstrap-datepicker.js?<?= rand(1, 10000) / 7; ?>"></script> <script src="../assets/js/jsgrid.js?<?= rand(1, 10000) / 7; ?>"></script> <script> $(function() { //sidebar active $('.nav .nav-item:nth-child(7)').addClass('active'); $('.nav .nav-item .collapse .nav-item').removeClass('active');
$('#Cycles').keyup(function() {
if ($(this).val() != "") { $(this).parent().find("#Neverexpires").attr("disabled", true); $(this).parent().find("#Neverexpires").prop('checked', false); } else {
$(this).parent().find("#Neverexpires").attr("disabled", false); } })
$('#StartDate').datepicker({ format: 'dd M, yyyy'
}); $('#EndDate').datepicker({ format: 'dd M, yyyy'
}); //customer Search ajaxSearchDetail();
function ajaxSearchDetail() { $.ajax({ url: "../assets/json/mainsearch.json", type: "get",
data: {}, contentType: "application/json; charset=utf-8", dataType: "json", cache: false,
success: function(data) { var recent = data.recentSearch;
$('.mainSearchInput').wrap(`<div class="mainSearchWrap">`);
$(`<div class="mainSearchDetail noborder shadow"><ul class="mainSearchGroup"></ul><button type="button" class="small sbtn btn-inverse-primary btn-fw mt-2" data-toggle="modal" data-target="#addNew">Add New</button></div>`) .appendTo(".mainSearchWrap");
$.each(recent, function(index, item) { //$("<option >").append(item.eng_desc).appendTo("#loanPurpose"); $('<li class="mainSearchItems"><div class="mainSearchItem"><input class="form-check-input radioSearch" type="radio" name="mainSearch" value="' + item.val + '" id="mainSearchItem' + item.id + '"><label class="form-check-label fullWidth" for="mainSearchItem' + item .id + '">' + item.val + '</label></div></li>' ).appendTo(".mainSearchGroup"); });
function checkMainSearch(val) {
$(".mainSearchItems").filter(function() { $(this).toggle($(this).text().toLowerCase().indexOf( val) > -1) console.log($(this).val);
});
};
$(".mainSearchInput").on("keyup change", function() { let val = $(this).val().toLowerCase(); checkMainSearch(val); });
}, error: function(xhr, status, errorThrown) { console.log(errorThrown + "\n" + status + "\n" + xhr.statusTex); },
}); };
$(document).on("click", "input[type='radio'][name='mainSearch']:checked", function() {
$(this).closest(".mainSearchWrap").find(".mainSearchInput").val($( this) .val()); $(this).closest(".mainSearchWrap").removeClass('active'); });
var NewData = [{ Item_Code: "", Description: "", Qty: "", Unit_Price: "", 'Disc%': "", Amount: "" }, { Item_Code: "", Description: "", Qty: "", Unit_Price: "", 'Disc%': "", Amount: "" }, { Item_Code: "", Description: "", Qty: "", Unit_Price: "", 'Disc%': "", Amount: "" }, { Item_Code: "", Description: "", Qty: "", Unit_Price: "", 'Disc%': "", Amount: "" }, { Item_Code: "", Description: "", Qty: "", Unit_Price: "", 'Disc%': "", Amount: "" }]; var IconField = function(config) { jsGrid.Field.call(this, config); }; IconField.prototype = new jsGrid.Field({
itemTemplate: function(value) { var insertValue = this._insertValue = $( `<i class="mdi mdi-select-all"></i>`); return insertValue; }, insertTemplate: function(value) {
return this._insertInput = $( `<i class="mdi mdi-select-all"></i>` ); }, editTemplate: function(value) {
return this._editInput = $( `<i class="mdi mdi-select-all"></i>` );
}, insertValue: function() { return this._insertInput.val(); },
editValue: function() {
return this._editInput.val(); } }); jsGrid.fields.iconField = IconField;
var RemarkField = function(config) { jsGrid.Field.call(this, config); }; RemarkField.prototype = new jsGrid.Field({
itemTemplate: function(value) { var insertValue = this._insertValue = $( `<span class="textareaText" >${value}</span>`); return insertValue; }, insertTemplate: function(value) {
return this._insertInput = $( `<textarea class="textareaRow" rows="1"></textarea>` ); }, editTemplate: function(value) {
return this._editInput = $( `<textarea class="textareaRow" rows="1">${value}</textarea>` );
}, insertValue: function() { return this._insertInput.val(); },
editValue: function() {
return this._editInput.val(); } });
jsGrid.fields.remarkField = RemarkField;
const SelectField = jsGrid.SelectField;
function Select2Field(config) { SelectField.call(this, config); }
Select2Field.prototype = new SelectField({ itemTemplate: function(value) { var insertValue = this._insertValue = value; return insertValue; }, insertValue: function() { return this._insertInput.val(); },
_createSelect() { const el = SelectField.prototype._createSelect.call(this); setTimeout(() => el.select2({ placeholder: '' }), 100); return el; } });
jsGrid.fields.select2 = jsGrid.Select2Field = Select2Field;
$("#grid").jsGrid({ height: "auto", width: "100%", inserting: true, editing: true, sorting: true, paging: true, data: NewData, rowClass: function(item, itemIndex) { return "client-" + itemIndex; },
controller: { loadData: function() { return NewData.slice(0, 15); } },
fields: [{ name: "#", type: "iconField", width: 30, align: "left" }, { name: "Item_Code", type: "select2", items: [{ value: '12323213', text: '12323213' }],
textField: 'text', valueField: 'value', width: 100, align: "left" }, { name: "Description", type: "remarkField", width: 150, sorting: false }, { name: "Qty", type: "number", width: 80, align: "left" },
{ name: "Unit_Price", type: "text", align: "right", width: 80 }, { name: "Disc%", type: "text", align: "right", width: 50 }, { name: "Amount", type: "text", align: "right", width: 80 },
{ type: "control", width: 50, editButton: false } ], onRefreshed: function() { var $gridData = $("#grid .jsgrid-grid-body tbody");
$gridData.sortable({ update: function(e, ui) { // array of indexes var clientIndexRegExp = /\s*client-(\d+)\s*/; var indexes = $.map($gridData.sortable("toArray", { attribute: "class" }), function(classes) { return clientIndexRegExp.exec(classes)[1]; }); alert("Reordered indexes: " + indexes.join(", "));
// arrays of items var items = $.map($gridData.find("tr"), function(row) { return $(row).data("JSGridItem"); }); console && console.log("Reordered items", items); } }); }, rowClick: function(args) {
var $row = $(args.event.target).closest("tr"); var $cell = $(args.event.target).closest(".jsgrid-cell"); cellIndex = $($row.find("td")).index($cell); if (this._editingRow) { this.updateItem(); } if (this.editing) { this.editItem($row); } }
});
}); </script>
</body>
</html>
|