forked from codepoetIn/POSNIC-1.02
-
Notifications
You must be signed in to change notification settings - Fork 0
/
add_sales.php
740 lines (575 loc) · 31.6 KB
/
add_sales.php
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
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
<?php
include_once("init.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>POSNIC - Add Stock Category</title>
<!-- Stylesheets -->
<link href='http://fonts.googleapis.com/css?family=Droid+Sans:400,700' rel='stylesheet'>
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="js/date_pic/date_input.css">
<link rel="stylesheet" href="lib/auto/css/jquery.autocomplete.css">
<!-- Optimize for mobile devices -->
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<!-- jQuery & JS files -->
<?php include_once("tpl/common_js.php"); ?>
<script src="js/script.js"></script>
<script src="js/date_pic/jquery.date_input.js"></script>
<script src="lib/auto/js/jquery.autocomplete.js "></script>
<script type="text/javascript">
$(function() {
$("#supplier").autocomplete("customer1.php", {
width: 160,
autoFill: true,
selectFirst: true
});
$("#item").autocomplete("stock.php", {
width: 160,
autoFill: true,
mustMatch: true,
selectFirst: true
});
$("#item").blur(function()
{
document.getElementById('total').value=document.getElementById('sell').value * document.getElementById('quty').value
});
$("#item").blur(function()
{
$.post('check_item_details.php', {stock_name1: $(this).val() },
function(data){
$("#sell").val(data.sell);
$("#stock").val(data.stock);
$('#guid').val(data.guid);
if(data.sell!=undefined)
$("#0").focus();
}, 'json');
});
$("#supplier").blur(function()
{
$.post('check_customer_details.php', {stock_name1: $(this).val() },
function(data){
$("#address").val(data.address);
$("#contact1").val(data.contact1);
if(data.address!=undefined)
$("#0").focus();
}, 'json');
});
$('#test1').jdPicker();
$('#test2').jdPicker();
var hauteur=0;
$('.code').each(function(){
if($(this).height()>hauteur) hauteur = $(this).height();
});
$('.code').each(function(){ $(this).height(hauteur); });
});
</script>
<script>
/*$.validator.setDefaults({
submitHandler: function() { alert("submitted!"); }
});*/
$(document).ready(function() {
document.getElementById('bill_no').focus();
// validate signup form on keyup and submit
$("#form1").validate({
rules: {
bill_no: {
required: true,
minlength: 3,
maxlength: 200
},
stockid: {
required: true
},
grand_total: {
required: true
},
supplier: {
required: true,
},
payment: {
required: true,
}
},
messages: {
supplier: {
required: "Please Enter Supplier"
},
stockid: {
required: "Please Enter Stock ID"
},
payment: {
required: "Please Enter Payment"
},
grand_total: {
required: "Add Stock Items"
},
bill_no: {
required: "Please Enter Bill Number",
minlength: "Bill Number must consist of at least 3 characters"
}
}
});
});
function numbersonly(e){
var unicode=e.charCode? e.charCode : e.keyCode
if (unicode!=8 && unicode!=46 && unicode!=37 && unicode!=27 && unicode!=38 && unicode!=39 && unicode!=40 && unicode!=9){ //if the key isn't the backspace key (which we should allow)
if (unicode<48||unicode>57)
return false
}
}
</script>
<script type="text/javascript">
function remove_row(o) {
var p=o.parentNode.parentNode;
p.parentNode.removeChild(p);
}
function add_values(){
if(unique_check()){
if(document.getElementById('edit_guid').value==""){
if(document.getElementById('item').value!="" && document.getElementById('quty').value!="" && document.getElementById('total').value!="" ){
if(document.getElementById('quty').value!=0){
code=document.getElementById('item').value;
quty=document.getElementById('quty').value;
sell=document.getElementById('sell').value;
disc=document.getElementById('stock').value;
total=document.getElementById('total').value;
item=document.getElementById('guid').value;
main_total=document.getElementById('posnic_total').value;
$('<tr id='+item+'><td><input type=hidden value='+item+' id='+item+'id ><input type=text name="stock_name[]" id='+item+'st style="width: 150px" class="round my_with" ></td><td><input type=text name=quty[] readonly="readonly" value='+quty+' id='+item+'q class="round my_with" style="text-align:right;" ></td><td><input type=text name=sell[] readonly="readonly" value='+sell+' id='+item+'s class="round my_with" style="text-align:right;" ></td><td><input type=text name=stock[] readonly="readonly" value='+disc+' id='+item+'p class="round my_with" style="text-align:right;" ></td><td><input type=text name=jibi[] readonly="readonly" value='+total+' id='+item+'to class="round my_with" style="width: 120px;margin-left:20px;text-align:right;" ><input type=hidden name=total[] id='+item+'my_tot value='+main_total+'> </td><td><input type=button value="" id='+item+' style="width:30px;border:none;height:30px;background:url(images/edit_new.png)" class="round" onclick="edit_stock_details(this.id)" ></td><td><input type=button value="" id='+item+' style="width:30px;border:none;height:30px;background:url(images/close_new.png)" class="round" onclick=reduce_balance("'+item+'");$(this).closest("tr").remove(); ></td></tr>').fadeIn("slow").appendTo('#item_copy_final');
document.getElementById('quty').value="";
document.getElementById('sell').value="";
document.getElementById('stock').value="";
document.getElementById('total').value="";
document.getElementById('item').value="";
document.getElementById('guid').value="";
if(document.getElementById('grand_total').value==""){
document.getElementById('grand_total').value=main_total;
}else{
document.getElementById('grand_total').value=parseFloat(document.getElementById('grand_total').value)+parseFloat(main_total);
}
document.getElementById('main_grand_total').value=parseFloat(document.getElementById('grand_total').value);
document.getElementById(item+'st').value=code;
document.getElementById(item+'to').value=total;
}else{
alert('No Stock Available For This Item');
}
}else{
alert('Please Select An Item');
}
}else{
id=document.getElementById('edit_guid').value;
document.getElementById(id+'st').value=document.getElementById('item').value;
document.getElementById(id+'q').value=document.getElementById('quty').value;
document.getElementById(id+'s').value=document.getElementById('sell').value;
document.getElementById(id+'p').value=document.getElementById('stock').value;
document.getElementById('grand_total').value=parseFloat(document.getElementById('grand_total').value)+parseFloat(document.getElementById('posnic_total').value)-parseFloat(document.getElementById(id+'my_tot').value);
document.getElementById('main_grand_total').value=parseFloat(document.getElementById('grand_total').value);
document.getElementById(id+'to').value=document.getElementById('total').value;
document.getElementById(id+'id').value=id;
document.getElementById(id+'my_tot').value=document.getElementById('posnic_total').value
document.getElementById('quty').value="";
document.getElementById('sell').value="";
document.getElementById('stock').value="";
document.getElementById('total').value="";
document.getElementById('item').value="";
document.getElementById('guid').value="";
document.getElementById('edit_guid').value="";
}
}
discount_amount();
}
function total_amount(){
balance_amount();
document.getElementById('total').value=document.getElementById('sell').value * document.getElementById('quty').value
document.getElementById('posnic_total').value=document.getElementById('total').value;
// document.getElementById('total').value = '$ ' + parseFloat(document.getElementById('total').value).toFixed(2);
if(document.getElementById('item').value===""){
document.getElementById('item').focus();
}
}
function edit_stock_details(id) {
document.getElementById('item').value=document.getElementById(id+'st').value;
document.getElementById('quty').value=document.getElementById(id+'q').value;
document.getElementById('sell').value=document.getElementById(id+'s').value;
document.getElementById('stock').value=document.getElementById(id+'p').value;
document.getElementById('total').value=document.getElementById(id+'to').value;
document.getElementById('guid').value=id;
document.getElementById('edit_guid').value=id;
}
function unique_check(){
if(!document.getElementById(document.getElementById('guid').value) || document.getElementById('edit_guid').value==document.getElementById('guid').value){
return true;
}else{
alert("This Item is already added In This Purchase");
document.getElementById('item').focus();
document.getElementById('quty').value="";
document.getElementById('sell').value="";
document.getElementById('stock').value="";
document.getElementById('total').value="";
document.getElementById('item').value="";
document.getElementById('guid').value="";
document.getElementById('edit_guid').value="";
return false;
}
}
function quantity_chnage(e){
var unicode=e.charCode? e.charCode : e.keyCode
if (unicode!=13 && unicode!=9){
}
else{
add_values();
document.getElementById("item").focus();
}
if (unicode!=27){
}
else{
document.getElementById("item").focus();
}
}
function formatCurrency(fieldObj)
{
if (isNaN(fieldObj.value)) { return false; }
fieldObj.value = '$ ' + parseFloat(fieldObj.value).toFixed(2);
return true;
}
function balance_amount(){
if(document.getElementById('payable_amount').value!="" && document.getElementById('payment').value!=""){
data=parseFloat(document.getElementById('payable_amount').value);
document.getElementById('balance').value=data-parseFloat(document.getElementById('payment').value);
if(parseFloat(document.getElementById('payable_amount').value) >= parseFloat(document.getElementById('payment').value)){
}else{
if(document.getElementById('payable_amount').value!=""){
document.getElementById('balance').value='000.00';
document.getElementById('payment').value=parseFloat(document.getElementById('payable_amount').value);
}else{
document.getElementById('balance').value='000.00';
document.getElementById('payment').value="";
}
}
}else{
document.getElementById('balance').value="";
}
}
function stock_size(){
if(parseFloat(document.getElementById('quty').value) > parseFloat(document.getElementById('stock').value)){
document.getElementById('quty').value=parseFloat(document.getElementById('stock').value);
console.log();
}
}
function discount_amount(){
if(document.getElementById('grand_total').value!=""){
document.getElementById('disacount_amount').value=parseFloat(document.getElementById('grand_total').value)*(parseFloat(document.getElementById('discount').value))/100;
}
if(document.getElementById('discount').value==""){
document.getElementById('disacount_amount').value="";
}
discont=parseFloat(document.getElementById('disacount_amount').value);
if(document.getElementById('disacount_amount').value==""){
discont=0;
}
document.getElementById('payable_amount').value=parseFloat(document.getElementById('grand_total').value)-discont;
if(parseFloat(document.getElementById('payment').value)>parseFloat(document.getElementById('payable_amount').value)){
document.getElementById('payment').value=parseFloat(document.getElementById('payable_amount').value);
}
}
function discount_as_amount(){
if(parseFloat(document.getElementById('disacount_amount').value) > parseFloat(document.getElementById('grand_total').value))
document.getElementById('disacount_amount').value="";
if(document.getElementById('grand_total').value!=""){
if(parseFloat(document.getElementById('disacount_amount').value) < parseFloat(document.getElementById('grand_total').value))
{ discont=parseFloat(document.getElementById('disacount_amount').value);
document.getElementById('payable_amount').value=parseFloat(document.getElementById('grand_total').value)-discont;
if(parseFloat(document.getElementById('payment').value)>parseFloat(document.getElementById('payable_amount').value)){
document.getElementById('payment').value=parseFloat(document.getElementById('payable_amount').value);
}
}else{
// document.getElementById('disacount_amount').value=parseFloat(document.getElementById('grand_total').value)-1;
}
}
}
function reduce_balance(id){
var minus=parseFloat(document.getElementById(id+"my_tot").value);
document.getElementById('grand_total').value=parseFloat(document.getElementById('grand_total').value)-minus;
document.getElementById('main_grand_total').value=parseFloat(document.getElementById('grand_total').value);
discount_amount();
//console.log(id);
}
function discount_type(){
if(document.getElementById('round').checked){
document.getElementById("discount").readOnly=true;
document.getElementById("disacount_amount").readOnly=false;
if(parseFloat(document.getElementById('grand_total'))!=""){
document.getElementById('disacount_amount').value="";
document.getElementById('discount').value="";
discount_amount();
}
}else{
document.getElementById("discount").readOnly=false;
document.getElementById("disacount_amount").readOnly=true;
}
}
</script>
</head>
<body>
<!-- TOP BAR -->
<?php include_once("tpl/top_bar.php"); ?>
<!-- end top-bar -->
<!-- HEADER -->
<div id="header-with-tabs">
<div class="page-full-width cf">
<ul id="tabs" class="fl">
<li><a href="dashboard.php" class="dashboard-tab">Dashboard</a></li>
<li><a href="view_sales.php" class="active-tab sales-tab">Sales</a></li>
<li><a href="view_customers.php" class=" customers-tab">Customers</a></li>
<li><a href="view_purchase.php" class="purchase-tab">Purchase</a></li>
<li><a href="view_supplier.php" class=" supplier-tab">Supplier</a></li>
<li><a href="view_product.php" class="stock-tab">Stocks / Products</a></li>
<li><a href="view_payments.php" class="payment-tab">Payments / Outstandings</a></li>
<li><a href="view_report.php" class="report-tab">Reports</a></li>
</ul> <!-- end tabs -->
<!-- Change this image to your own company's logo -->
<!-- The logo will automatically be resized to 30px height. -->
<a href="#" id="company-branding-small" class="fr"><img src="<?php if(isset($_SESSION['logo'])) { echo "upload/".$_SESSION['logo'];}else{ echo "upload/posnic.png"; } ?>" alt="Point of Sale" /></a>
</div> <!-- end full-width -->
</div> <!-- end header -->
<!-- MAIN CONTENT -->
<div id="content">
<div class="page-full-width cf">
<div class="side-menu fl">
<h3>Sales Management</h3>
<ul>
<li><a href="add_sales.php">Add Sales</a></li>
<li><a href="view_sales.php">View Sales</a></li>
</ul>
</div> <!-- end side-menu -->
<div class="side-content fr">
<div class="content-module">
<div class="content-module-heading cf">
<h3 class="fl">Add Sales</h3>
<span class="fr expand-collapse-text">Click to collapse</span>
<span class="fr expand-collapse-text initial-expand">Click to expand</span>
</div> <!-- end content-module-heading -->
<div class="content-module-main cf">
<?php
//Gump is libarary for Validatoin
if(isset($_GET['msg'])){
echo $_GET['msg'];
}
if(isset($_POST['payment'])){
$_POST = $gump->sanitize($_POST);
$gump->validation_rules(array(
'payment'=> 'required|max_len,100|min_len,1'
));
$gump->filter_rules(array(
'payment' => 'trim|sanitize_string|mysql_escape'
));
$validated_data = $gump->run($_POST);
$stock_name = "";
$stockid = "";
$payment = "";
$bill_no = "";
if($validated_data === false) {
echo $gump->get_readable_errors(true);
} else {
$username = $_SESSION['username'];
$stockid=mysql_real_escape_string($_POST['stockid']);
$bill_no =mysql_real_escape_string($_POST['bill_no']);
$customer=mysql_real_escape_string($_POST['supplier']);
$address=mysql_real_escape_string($_POST['address']);
$contact=mysql_real_escape_string($_POST['contact']);
$count = $db->countOf("customer_details", "customer_name='$customer'");
if($count==0)
{
$db->query("insert into customer_details(customer_name,customer_address,customer_contact1) values('$customer','$address','$contact')");
}
$stock_name=$_POST['stock_name'];
$quty=$_POST['quty'];
$date=mysql_real_escape_string($_POST['date']);
$sell=$_POST['sell'];
$total=$_POST['total'];
$payable=$_POST['subtotal'];
$description=mysql_real_escape_string($_POST['description']);
$due=mysql_real_escape_string($_POST['duedate']);
$payment=mysql_real_escape_string($_POST['payment']);
$discount=mysql_real_escape_string($_POST['discount']);
if($discount==""){
$discount=00;
}
$dis_amount=mysql_real_escape_string($_POST['dis_amount']);
if($dis_amount==""){
$dis_amount=00;
}
$subtotal=mysql_real_escape_string($_POST['payable']);
$balance=mysql_real_escape_string($_POST['balance']);
$mode=mysql_real_escape_string($_POST['mode']);
$tax=mysql_real_escape_string($_POST['tax']);
if($tax==""){
$tax=00;
}
$tax_dis=mysql_real_escape_string($_POST['tax_dis']);
$temp_balance = $db->queryUniqueValue("SELECT balance FROM customer_details WHERE customer_name='$customer'");
$temp_balance = (int) $temp_balance + (int) $balance;
$db->execute("UPDATE customer_details SET balance=$temp_balance WHERE customer_name='$customer'");
$selected_date=$_POST['due'];
$selected_date=strtotime( $selected_date );
$mysqldate = date( 'Y-m-d H:i:s', $selected_date );
$due=$mysqldate;
$max = $db->maxOfAll("id", "stock_entries");
$max=$max+1;
$autoid="SD".$max."";
for($i=0;$i<count($stock_name);$i++)
{
$name1=$stock_name[$i];
$quantity=$_POST['quty'][$i];
$rate=$_POST['sell'][$i];
$total=$_POST['total'][$i];
$selected_date=$_POST['date'];
$selected_date=strtotime( $selected_date );
$mysqldate = date( 'Y-m-d H:i:s', $selected_date );
$username = $_SESSION['username'];
$count = $db->queryUniqueValue("SELECT quantity FROM stock_avail WHERE name='$name1'");
if($count >= 1)
{
$db->query("insert into stock_sales (tax,tax_dis,discount,dis_amount,grand_total,transactionid,stock_name,selling_price,quantity,amount,date,username,customer_id,subtotal,payment,balance,due,mode,description,count1,billnumber)
values($tax,'$tax_dis',$discount,$dis_amount,$payable,'$autoid','$name1',$rate,$quantity,$total,'$mysqldate','$username','$customer',$subtotal,$payment,$balance,'$due','$mode','$description',$i+1,'$bill_no')");
$amount = $db->queryUniqueValue("SELECT quantity FROM stock_avail WHERE name='$name1'");
$amount1 = $amount - $quantity;
$db->query("insert into stock_entries (stock_id,stock_name,quantity,opening_stock,closing_stock,date,username,type,salesid,total,selling_price,count1,billnumber) values('$autoid','$name1',$quantity,$amount,$amount1,'$mysqldate','$username','sales','$autoid',$total,$rate,$i+1,'$bill_no')");
//echo "<br><font color=green size=+1 >New Sales Added ! Transaction ID [ $autoid ]</font>" ;
$amount = $db->queryUniqueValue("SELECT quantity FROM stock_avail WHERE name='$name1'");
$amount1 = $amount - $quantity;
$db->execute("UPDATE stock_avail SET quantity=$amount1 WHERE name='$name1'");
}
else
{
echo "<br><font color=green size=+1 >There is no enough stock deliver for $name1! Please add stock !</font>" ;
}
}
$msg="<br><font color=green size=6px >Sales Added successfully Ref: [". $_POST['stockid']."] !</font>" ;
header("Location: add_sales.php?msg=$msg");
echo "<script>window.open('add_sales_print.php?sid=$autoid','myNewWinsr','width=620,height=800,toolbar=0,menubar=no,status=no,resizable=yes,location=no,directories=no');</script>";
//echo "<script>window.open('add_sales_print.php?sid=$autoid','myNewWinsr','width=620,height=800,toolbar=0,menubar=no,status=no,resizable=yes,location=no,directories=no');</script>";
//$msg="<br><font color=green size=6px >Parchase order Added successfully Ref: [". $_POST['stockid']."] !</font>" ;
//header("Location: add_purchase.php?msg=$msg");
}
}
?>
<form name="form1" method="post" id="form1" action="">
<input type="hidden" id="posnic_total" >
<p><strong>Add Stock/Product </strong> - Add New ( Control +2)</p>
<table class="form" border="0" cellspacing="0" cellpadding="0">
<tr>
<?php
$max = $db->maxOfAll("id","stock_entries");
$max=$max+3;
$autoid="PR".$max."";
?>
<td>Stock ID:</td>
<td><input name="stockid" type="text" id="stockid" readonly="readonly" maxlength="200" class="round default-width-input" style="width:130px " value="<?php echo $autoid ?>" /></td>
<td>Date:</td>
<td><input name="date" id="test1" placeholder="" value="<?php echo date('d-m-Y');?>" type="text" id="name" maxlength="200" class="round default-width-input" /></td>
<td><span class="man">*</span>Bill No:</td>
<td><input name="bill_no" placeholder="ENTER BILL NO" type="text" id="bill_no" maxlength="200" class="round default-width-input" style="width:120px " /></td>
</tr>
<tr>
<td><span class="man">*</span>Customer:</td>
<td><input name="supplier" placeholder="ENTER CUSTOMER" type="text" id="supplier" maxlength="200" class="round default-width-input" style="width:130px " /></td>
<td>Address:</td>
<td><input name="address" placeholder="ENTER ADDRESS" type="text" id="address" maxlength="200" class="round default-width-input" /></td>
<td>contact:</td>
<td><input name="contact" placeholder="ENTER CONTACT" type="text" id="contact1" maxlength="200" class="round default-width-input" onkeypress="return numbersonly(event)" style="width:120px " /></td>
</tr>
</table>
<input type="hidden" id="guid">
<input type="hidden" id="edit_guid">
<table class="form" >
<tr>
<td>Item:</td>
<td>Quantity:</td>
<td>Price:</td>
<td>Available Stock:</td>
<td> Total</td>
<td> </td>
</tr>
<tr>
<td><input name="" type="text" id="item" maxlength="200" class="round default-width-input " style="width: 150px" /></td>
<td><input name="" type="text" id="quty" maxlength="200" class="round default-width-input my_with" onKeyPress="quantity_chnage(event);return numbersonly(event)" onkeyup="total_amount();unique_check();stock_size();" /></td>
<td><input name="" type="text" id="sell" readonly="readonly" maxlength="200" class="round default-width-input my_with" /></td>
<td><input name="" type="text" id="stock" readonly="readonly" maxlength="200" class="round my_with" /></td>
<td><input name="" type="text" id="total" maxlength="200" class="round default-width-input " style="width:120px; margin-left: 20px" /></td>
<td><input type="button" onclick="add_values()" onkeyup=" balance_amount();" id="add_new_code" style="margin-left:30px; width:30px;height:30px;border:none;background:url(images/add_new.png)" class="round"> </td>
</tr>
</table>
<div style="overflow:auto ;max-height:300px; ">
<table class="form" id="item_copy_final">
</table>
</div>
<table class="form">
<tr>
<td> </td> <td> </td>
<td><input type="checkbox" id="round" onclick="discount_type()" >Discount As Amount</td> </tr>
<tr>
<td> </td>
<td>Discount %<input type="text" maxlength="3" class="round" onkeyup=" discount_amount(); " onkeypress="return numbersonly(event);" name="discount" id="discount" >
</td>
<td>Discount Amount:<input type="text" readonly="readonly" onkeypress="return numbersonly(event);" onkeyup=" discount_as_amount(); " class="round" id="disacount_amount" name="dis_amount" >
</td>
<td> </td>
<td> </td><td> </td>
<td>Grand Total:<input type="hidden" readonly="readonly" id="grand_total" name="subtotal" >
<input type="text" id="main_grand_total" readonly="readonly" class="round default-width-input" style="text-align:right;width: 120px" >
</td> <td> </td>
<td>Description</td>
<td><textarea name="description"></textarea></td>
</tr>
<tr>
<td> </td>
<td>Payment:<input type="text" class="round" onkeyup=" balance_amount(); " onkeypress="return numbersonly(event);" name="payment" id="payment" >
</td>
<td>Balance:<input type="text" class="round" readonly="readonly" id="balance" name="balance" >
</td>
<td> </td>
<td> </td><td> </td>
<td>Payable Amount:<input type="hidden" readonly="readonly" id="grand_total" >
<input type="text" id="payable_amount" readonly="readonly" name="payable" class="round default-width-input" style="text-align:right;width: 120px" >
</td> <td> </td> <td> </td> <td> </td>
</tr> </table>
<table>
<tr> <td>Mode </td><td>
<select name="mode">
<option value="cash">Cash</option>
<option value="cheque">Cheque</option>
<option value="other">Other</option>
</select>
</td>
<td>
Due Date:<input type="text" name="duedate" id="test2" value="<?php echo date('d-m-Y');?>" class="round">
</td>
<td> Tax:<input type="text" name="tax" onkeypress="return numbersonly(event);"></td>
<td>Tax Description:<input type="text" name="tax_dis"> </td>
<td> </td>
<td> </td>
</tr>
</table>
<table class="form">
<tr>
<td>
<input class="button round blue image-right ic-add text-upper" type="submit" name="Submit" value="Add">
</td><td> (Control + S)
<input class="button round red text-upper" type="reset" name="Reset" value="Reset"> </td>
<td> </td> <td> </td>
</tr>
</table>
</form>
</div> <!-- end content-module-main -->
</div> <!-- end content-module -->
</div></div> <!-- end full-width -->
</div> <!-- end content -->
<!-- FOOTER -->
<div id="footer">
<p>Any Queries email to <a href="mailto:[email protected]?subject=Stock%20Management%20System">[email protected]</a>.</p>
</div> <!-- end footer -->
</body>
</html>