-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinvoiceDetails.php
executable file
·364 lines (336 loc) · 22.2 KB
/
invoiceDetails.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
<?php
require_once './include/MainConfig.php';
include './config/dbc.php';
?>
<!DOCTYPE html>
<html>
<head>
<?php require_once './include/systemHeader.php'; ?>
</head>
<body>
<input type="hidden" value="<?php echo $_SESSION['user_id']; ?>" id="systemUser">
<input type="hidden" value="<?php echo date("h:i:s a"); ?>" id="systemTime">
<input type="hidden" value="" id="discountTot">
<div id="wrap"><!-- class="bgCustome"-->
<?php require_once './include/navBar.php'; ?>
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="page-header">
<h3>Invoice Data</h3>
</div>
<div class="row" style="margin-top: -10px;">
<div class="col-md-5">
<div class="form-horizontal">
<input type="hidden" id="cushiddenid">
<div class="form-group hidden">
<label for="branch" class="col-md-4 control-label">Branch:</label>
<div class="col-md-6 branchcomboDiv">
<input class="branchComboBox" readonly="" id="branchComboBox" value="<?php echo $_SESSION['branch']; ?>">
</div>
</div>
<div class="form-group">
<label for="customer_reg_no" class="col-lg-4 control-label">Customer:</label>
<div class="col-lg-4">
<select class="customer" id="customer"></select>
</div>
<div class="col-lg-2">
<input class="form-control" id="cusID" readonly="">
</div>
</div>
<div class="form-group">
<label for="customer_name" class="col-lg-4 control-label">Invoice No:</label>
<div class="col-lg-6">
<input type="text" id="invoNo" class="form-control" placeholder="Invoice No" readonly="">
</div>
</div>
<div class="form-group">
<label for="inv_po_number" class="col-lg-4 control-label">Production No:</label>
<div class="col-lg-6">
<input type="text" id="inv_po_number" class="form-control" placeholder="PO Number">
</div>
</div>
<div class="form-group">
<label for="customer_name" class="col-lg-4 control-label">Invoice Date:</label>
<div class="col-lg-6">
<input type="text" id="date" class="form-control" placeholder="Date" value="<?php echo date('Y-m-d'); ?>" data-date-format="yyyy-mm-dd">
</div>
</div>
<div class="form-group">
<label for="customer_adress" class="col-lg-4 control-label">Job No:</label>
<div class="col-lg-6">
<input type="text" id="jobNo" class="form-control" placeholder="Job No" readonly="">
</div>
</div>
<div class="form-group">
<label for="contact_person" class="col-lg-4 control-label">Price:</label>
<div class="col-lg-6">
<input type="text" id="price" class="form-control" placeholder="Price" readonly="">
</div>
</div>
<div class="form-group">
<label for="customer_reg_no" class="col-lg-4 control-label">Payment Type:</label>
<div class="col-lg-6">
<select class="payType" id="payType"></select>
</div>
</div>
<div class="form-group" id="cashAmountsection">
<label for="contact_person" class="col-lg-4 control-label">Cash Amount:</label>
<div class="col-lg-6">
<input style="background-color: #d9edf7; font-weight: bold;" type="text" id="cashAmount" class="form-control" placeholder="Cash Amount" onkeypress="return isNumberKey(event)" >
<h6 id="cashValidatMsg" style="color: red;"></h6>
</div>
</div>
<div class="form-group hidden" id="chequeAmountSection">
<label for="contact_person" class="col-lg-4 control-label">Cheque Amount:</label>
<div class="col-lg-6">
<input style="background-color: #d9edf7; font-weight: bold;" type="text" id="chequeAmount" class="form-control" placeholder="Cheque Amount" onkeypress="return isNumberKey(event)" >
</div>
</div>
<div class="form-group hidden" id="cheqNoSection">
<label for="contact_person" class="col-lg-4 control-label">Cheque No:</label>
<div class="col-lg-6">
<input type="text" id="chequeNo" class="form-control" placeholder="Cheque No">
</div>
</div>
<div class="form-group hidden" id="bankSection">
<label for="contact_person" class="col-lg-4 control-label">Bank:</label>
<div class="col-lg-6">
<select id="bank" class="form-control bank" placeholder="Discount" ></select>
</div>
</div>
<div class="form-group">
<label for="contact_person" class="col-lg-4 control-label">Discount:</label>
<div class="col-lg-6 form-inline">
<input type="text" id="discount" class="form-control col-lg-2" placeholder="Discount" readonly="">
<button type="button" id="addDiscount" class="btn btn-info col-lg-4" style="font-size: 10px;">Add Discount</button>
<button type="button" id="removediscount" class="btn btn-danger col-lg-4 hidden" style="font-size: 10px;">Remove</button>
</div>
</div>
<!-- Multiple Radios (inline) -->
<div class="form-group">
<label class="col-md-4 control-label" for="radios">VAT :</label>
<div class="col-md-4">
<label class="radio-inline" for="radios-0">
<input name="radios" id="radios-0" value="1" class="vat_radio" checked="checked" type="radio">
Yes
</label>
<label class="radio-inline" for="radios-1">
<input name="radios" id="radios-1" value="0" class="vat_radio" type="radio">
No
</label>
</div>
</div>
<div class="form-group">
<div class="col-lg-offset-4 col-lg-10">
<span id="customerregSaveActionBtn" class="">
<button class="btn btn-success col-lg-7" id="copleatInvo" disabled="" style="height: 40px;"><i class="fa fa-save fa-lg"></i> Compleat Invoice</button>
</span>
<span id="cust_reg_ActionBtn" class="hidden">
<button class="btn btn-warning" id="updateInvo"><i class="fa fa-edit fa-lg"></i> Update</button>
</span>
<span id="reset_cust" class="hidden">
<button class="btn btn-primary" id="resetInvo"><i class="fa fa-edit fa-lg"></i> Reset</button>
</span>
</div>
</div>
</div>
</div>
<div class="col-md-7">
<div class="panel panel-primary" style="background-color: #f0f7fd">
<h3 class="panel-title" style="color: black; height: 25px; padding: 5px; font-weight: bold;">Available Jobs</h3>
<input type="text" class="form-control" id="dev-table-filter" data-action="filter" data-filters=".jobDataTble" placeholder="Search Jobs" style="background-color: #f0f0f0;" />
<div class="scrollable" style="height: 200px; overflow-y: auto">
<table class="table table-bordered table-striped table-hover datable jobDataTble">
<thead>
<tr>
<th>#</th>
<th>Job ID</th>
<th>Job Date</th>
<th>Action</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<input type="hidden" id="system_id">
</div>
</div>
<div class="panel panel-primary" id="completedInvoSection">
<div class="col-md-6" style="padding-top: 10px;">
<div class="col-md-6">
<div class="input-group input-group-sm">
<span class="input-group-addon">From:</span>
<input type="text" style="background-color: #d9edf7;" id="date_tbl_from" class="datepicker form-control" placeholder="Date" value="<?php echo date('Y-m-d'); ?>" data-date-format="yyyy-mm-dd">
</div>
</div>
<div class="col-md-6">
<div class="input-group input-group-sm">
<span class="input-group-addon">To:</span>
<input type="text" style="background-color: #d9edf7;" id="date_tbl_to" class="datepicker form-control" value="<?php echo date('Y-m-d'); ?>" data-date-format="yyyy-mm-dd">
<span class="input-group-btn">
<button class="btn btn-danger" id="table_refresh_btn" type="button"><i class="fa fa-refresh"></i></button>
</span>
</div>
</div>
</div>
<div class="panel-heading">
<h3 class="panel-title">Completed Invoices</h3>
<div class="pull-right">
<span class="clickable filter" data-toggle="tooltip" title="Toggle table filter" data-container="body">
<i class="glyphicon glyphicon-filter"></i>
</span>
</div>
</div>
<div class="panel-body filterTableSearch">
<input type="text" class="form-control" id="dev-table-filter" data-action="filter" data-filters=".copletedJobs"/>
</div>
<div class="scrollable" style="height: 300px; overflow-y: auto">
<table class="table table-bordered table-striped table-hover datable copletedJobs">
<thead>
<tr>
<th>#</th>
<th>Invoice No.</th>
<th>Customer</th>
<th>Date</th>
<th>Total Amount</th>
<th>Action</th>
</tr>
</thead>
<tbody></tbody>
</table>
<input type="hidden" id="system_id">
</div>
</div>
<div class="hidden" id="underItems">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title" id="itemTblSelected">Available Items</h3>
<div class="pull-right">
<span class="clickable filter" data-toggle="tooltip" title="Toggle table filter" data-container="body">
<i class="glyphicon glyphicon-filter"></i>
</span>
</div>
</div>
<div class="panel-body filterTableSearch">
<input type="text" class="form-control" id="dev-table-filter" data-action="filter" data-filters=".delivery_table"/>
</div>
<div class="scrollable" style="height: 200px; overflow-y: auto">
<table class="table table-bordered table-striped table-hover datable itemLastStsus">
<thead>
<tr>
<th>#</th>
<th>Description</th>
<th>Ordered QTY</th>
<th>Delivered QTY</th>
<th>Total Amount</th>
<th>Total Discount</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<input type="hidden" id="system_id">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php // require_once './include/footerBar.php'; ?>
<?php require_once './include/systemFooter.php'; ?>
</body>
<script type="text/javascript">
$(function() {
pageProtect();
checkurl();
$('#logout').click(function() {
logout();
});
$(window).load(function() {
getPayTypeCombo();
getBanks();
getInvoID();
getCompletedInvoices();
customer_ComboBox(null, $('.branchComboBox').val(), function() {
getUserRelatedJobs();
});
});
$('select').chosen({width: "100%"});
$('#date').datepicker();
$('.payType').change(function() {
var payType = $(this).val();
if (payType == '1') {
$('#cashAmountsection').removeClass("hidden");
$('#chequeAmountSection').addClass("hidden");
$('#cheqNoSection').addClass("hidden");
$('#bankSection').addClass("hidden");
} else {
$('#cashAmountsection').addClass("hidden");
$('#chequeAmountSection').removeClass("hidden");
$('#cheqNoSection').removeClass("hidden");
$('#bankSection').removeClass("hidden");
}
});
$('#customer').change(function() {
getUserRelatedJobs();
});
$('#table_refresh_btn').click(function() {
getCompletedInvoices();
});
$('#addDiscount').click(function() {
var cashAmount = $('#cashAmount').val();
var chequeAmount = $('#chequeAmount').val();
var discount = $('#discount').val();
$('#discountTot').val(discount);
var cashtot = parseFloat(cashAmount) - parseFloat(discount);
var chequetot = parseFloat(chequeAmount) - parseFloat(discount);
$('#cashAmount').val(cashtot.toFixed(2));
$('#chequeAmount').val(chequetot.toFixed(2));
$('#addDiscount').addClass("hidden");
$('#removediscount').removeClass("hidden");
});
$('#removediscount').click(function() {
var cashAmount = $('#cashAmount').val();
var chequeAmount = $('#chequeAmount').val();
var discount = $('#discount').val();
$('#discountTot').val('0');
var cashtot = parseFloat(cashAmount) + parseFloat(discount);
var chequetot = parseFloat(chequeAmount) + parseFloat(discount);
$('#cashAmount').val(cashtot.toFixed(2));
$('#chequeAmount').val(chequetot.toFixed(2));
$('#addDiscount').removeClass("hidden");
$('#removediscount').addClass("hidden");
});
$('#copleatInvo').click(function() {
document.getElementById("copleatInvo").disabled = true;
compleatInvoice();
});
$('#customer').change(function() {
$('#cusID').val($(this).val());
});
$('#cashAmount').keyup(function() {
var typVal = $(this).val();
var price = $('#price').val();
if (parseFloat(typVal) > parseFloat(price)) {
$('#cashValidatMsg').html('Entered Amount Greater Than to Total Price');
$('#copleatInvo').addClass("hidden");
} else {
$('#cashValidatMsg').html('');
$('#copleatInvo').removeClass("hidden");
}
});
$('.datepicker').datepicker();
$(document).ready(function()
{
$(document).bind("contextmenu", function(e) {
alert('Sorry! right click option disabled in this system');
return false;
});
});
});
</script>
</html>