-
Notifications
You must be signed in to change notification settings - Fork 0
/
edit_quickbook_invoice.php
297 lines (282 loc) · 12.2 KB
/
edit_quickbook_invoice.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
<?php
include("includes/config.inc.php");
include("includes/crosssite.inc.php");
if ( isset ( $_GET['logout'] ) && $_GET['logout'] ==1 ) {
session_destroy();
header("location: index.php?token=".$token);
}
if (isset($_SESSION) && $_SESSION['login']=='')
{
session_destroy();
header("location: index.php?token=".$token);
}
{
$paymentid = $_GET['paymentid'];
$chequeId = $_GET['paymentid'];
$onlinepaymentId = $_GET['onlinepaymentId'];
$userId = $_SESSION['user_id'];
$ticketId = mysql_real_escape_string($_POST['ticketId']);
$organizationName = mysql_real_escape_string($_POST['organizationName']);
$quickBookRefNo = mysql_real_escape_string($_POST['quickBookRefNo']);
/*Cash payment*/
$cashAmount = mysql_real_escape_string($_POST['cashAmount']);
/*Cheque*/
$chequeNo = mysql_real_escape_string($_POST['chequeNo']);
$chequeDate = mysql_real_escape_string($_POST['chequeDate']);
$bank = mysql_real_escape_string($_POST['bank']);
$amountCheque = mysql_real_escape_string($_POST['amountCheque']);
$depositDate = mysql_real_escape_string($_POST['depositDate']);
/*Online Tranfer*/
$onlineTransferAmount = mysql_real_escape_string($_POST['onlineTransferAmount']);
$refNo = mysql_real_escape_string($_POST['refNo']);
/*Other Details*/
$revievingDate = mysql_real_escape_string($_POST['revievingDate']);
$remarks = mysql_real_escape_string($_POST['remarks']);
$recievedby = mysql_real_escape_string($_POST['recievedby']);
$confirmby = mysql_real_escape_string($_POST['confirmby']);
if(isset($_POST['cash']) && ($_POST['cheque']) && ($_POST['onlineTransfer']))
{
//Update Data Online payement
$sql = "Update quickbookpaymentonlinetransfer Set customerId = '$organizationName',
quickBookRefNo = '$quickBookRefNo', RefNo = '$refNo',
onlineAmount = '$onlineTransferAmount' Where Id = '$onlinepaymentId'";
/*echo $sql;*/
$result = mysql_query($sql);
//Update Data Cheque
$sql = "Update quickbookpaymentcheque Set ChequeNo = '$chequeNo',
ChequeDate = '$chequeDate', Bank = '$bank', DepositDate = '$depositDate',
chequeAmount = '$amountCheque' where Id = '$chequeId'";
/*echo $sql;*/
$result = mysql_query($sql);
//Update Data Cash Payment
$sql = "Update quickbookpaymentmethoddetailsmaster Set ticketId = '$ticketId',
customerId = '$organizationName',
quickBookRefNo = '$quickBookRefNo', CashAmount = '$cashAmount',
userId = '$userId', RecivedDate = '$revievingDate',
Remarks = '$remarks' where PaymentID = '$paymentid'";
/*echo $sql;*/
$result = mysql_query($sql);
}
else if (isset($_POST['cash']))
{
$sql = "Update quickbookpaymentmethoddetailsmaster Set ticketId = '$ticketId',
customerId = '$organizationName', quickBookRefNo = '$quickBookRefNo',
CashAmount = '$cashAmount', userId = '$userId', RecivedDate = '$revievingDate',
Remarks = '$remarks' where PaymentID = '$paymentid'";
$result = mysql_query($sql);
/*echo $sql;*/
}
else if(isset($_POST['cheque']))
{
$sql = "Update quickbookpaymentcheque Set ChequeNo = '$chequeNo',
ChequeDate = '$chequeDate', Bank = '$bank', DepositDate = '$depositDate',
chequeAmount = '$amountCheque' where Id = '$chequeId'";
$result = mysql_query($sql);
/*echo $sql;*/
$sqlmaster = "Update quickbookpaymentmethoddetailsmaster Set ticketId = '$ticketId',
customerId = '$organizationName', quickBookRefNo = '$quickBookRefNo',
userId = '$userId', RecivedDate = '$revievingDate', Remarks = '$remarks'
where PaymentID = '$paymentid'";
$resultMaster = mysql_query($sqlmaster);
/*echo $sqlmaster;*/
}
else if(isset($_POST['onlineTransfer']))
{
$sql = "Update quickbookpaymentonlinetransfer Set customerId = '$organizationName',
quickBookRefNo = '$quickBookRefNo',RefNo = '$refNo', onlineAmount = '$onlineTransferAmount'
Where Id = '$onlinepaymentId'";
$result = mysql_query($sql);
/*echo $sql;*/
$sql = "Update quickbookpaymentmethoddetailsmaster Set ticketId = '$ticketId',
customerId = '$organizationName', quickBookRefNo = '$quickBookRefNo',
userId = '$userId', RecivedDate = '$revievingDate', Remarks = '$remarks',
where PaymentID = '$paymentid'";
$result = mysql_query($sql);
/*echo $sql;*/
}
}
if(isset($_REQUEST['paymentid']) && $_REQUEST['paymentid']){
$queryArr=mysql_query("SELECT * FROM quickbookpaymentcheque as A
LEFT OUTER JOIN quickbookpaymentmethoddetailsmaster as B
ON A.Id = B.ChequeID
LEFT OUTER JOIN quickbookpaymentonlinetransfer as C
ON B.OnlineTransferId = C.Id WHERE B.PaymentID =".$_REQUEST['paymentid']);
$result=mysql_fetch_assoc($queryArr);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="images/ico.png" type="image/x-icon">
<title><?=SITE_PAGE_TITLE?></title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-submenu.min.css">
<link rel="stylesheet" href="css/custom.css">
<script type="text/javascript" src="js/checkbox_validation.js"></script>
<script type="text/javascript" src="js/checkbox.js"></script>
<script src="js/ajax.js"></script>
<script type="text/javascript" src="js/device_branch_confirmation.js"></script>
<script type="text/javascript" src="https://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="js/textboxEnabled.js"></script>
<script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<script>
// Date
$(function() {
$( ".date" ).datepicker({dateFormat: 'yy-mm-dd'});
});
// End Date
// Select Organization when select ticket Id
$(document).ready(function(){
$("select.ticket").change(function(){
$.post("ajaxrequest/show_ticket_organization_quick_book.php?token=<?php echo $token;?>",
{
ticket : $(".ticket option:selected").val()
},
function( data ){
$("#divOrgranization").html(data);
});
});
});
// End
</script>
</head>
<body>
<!--open of the wraper-->
<div id="wraper">
<!--include header-->
<?php include_once('includes/header.php');?>
<!--end-->
<!--open of the content-->
<div class="row" id="content">
<div class="col-md-12">
<h3> Quick Book Invoice</h3>
<hr>
</div>
<div class="col-md-12">
<form name='fullform' class="form-horizontal" method='post' onSubmit="return validate(this)">
<div class="table-responsive">
<table class="formStyle table" border="0" width="100%">
<tr>
<td>Ticket Id</td>
<td>
<select name="ticketId" id="ticketId" class="form-control drop_down ticket">
<option value="">Select Ticket Id</option>
<?php $Country=mysql_query("select ticket_id from tblticket where organization_type='Existing Client' and ticket_status <> 1 order by ticket_id ASC");
while($resultCountry=mysql_fetch_assoc($Country)){
?>
<option value="<?php echo $resultCountry['ticket_id']; ?>"
<?php if(isset($result['ticketId']) && $resultCountry['ticket_id']==$result['ticketId']){ ?>selected
<?php } ?>><?php echo stripslashes(ucfirst($resultCountry['ticket_id'])); ?></option>
<?php } ?>
</select>
</td>
<td> </td>
<td> </td>
</tr>
<tr>
<td width="16%">Organization</td>
<td width="33%">
<div id="divOrgranization">
<select name="organizationName" id="organizationName" class="form-control drop_down">
<option value="">Select Organization</option>
</select>
</div>
</td>
<td width="20%">Quick Book Ref. No.</td>
<td width="31%"><input type="text" name="quickBookRefNo" id="quickBookRefNo" Value="<?php echo $result['quickBookRefNo']; ?>" class="form-control text_box"> </td>
</tr>
<tr>
<th colspan="4">Cash <input type="checkbox" name="cash" id="cash"></th>
</tr>
<tr>
<td width="16%">Amount</td>
<td width="33%"><input type="text" name="cashAmount" id="cashAmount" Value="<?php echo $result['CashAmount']; ?>" class="form-control text_box" disabled></td>
<td width="20%"></td>
<td width="31%"></td>
</tr>
<tr>
<th colspan="4">Cheque <input type="checkbox" name="cheque" id="cheque"></th>
</tr>
<tr>
<td width="16%">Cheque No.</td>
<td width="33%"><input type="text" name="chequeNo" id="chequeNo" Value="<?php echo $result['ChequeNo']; ?>" class="form-control text_box" disabled></td>
<td width="20%">Cheque Date</td>
<td width="31%"><input type="text" name="chequeDate" id="chequeDate" Value="<?php echo $result['ChequeDate']; ?>" class="date form-control text_box" disabled></td>
</tr>
<tr>
<td width="16%">Bank</td>
<td width="33%">
<select name="bank" id="bank" class="form-control drop_down ddlCountry" disabled>
<option value="">Select Plan Category</option>
<?php $Country=mysql_query("select * from tblbank");
while($resultCountry=mysql_fetch_assoc($Country)){
?>
<option value="<?php echo $resultCountry['bankId']; ?>"
<?php if(isset($result['Bank']) && $resultCountry['bankId']==$result['Bank']){ ?>selected<?php } ?>>
<?php echo stripslashes(ucfirst($resultCountry['bankName'])); ?></option>
<?php } ?>
</select> </td>
<td width="20%">Amount</td>
<td width="31%"><input type="text" name="amountCheque" id="amountCheque" Value="<?php echo $result['chequeAmount']; ?>" class="form-control text_box" disabled></td>
</tr>
<tr>
<td width="16%">Bank Deposit Date</td>
<td width="33%"><input type="text" name="depositDate" id="depositDate" Value="<?php echo $result['DepositDate']; ?>" class="date form-control text_box" disabled></td>
<td width="20%"></td>
<td width="31%"></td>
</tr>
<tr>
<th colspan="4">Online Transfer <input type="checkbox" name="onlineTransfer" id="onlineTransfer"></th>
</tr>
<tr>
<td width="16%">Amount </td>
<td width="33%"><input type="text" name="onlineTransferAmount" id="onlineTransferAmount" Value="<?php echo $result['onlineAmount']; ?>" class="form-control text_box" disabled></td>
<td width="20%">Reference No.</td>
<td width="31%"><input type="text" name="refNo" id="refNo" Value="<?php echo $result['RefNo']; ?>" class="form-control text_box" disabled></td>
</tr>
<tr>
<th colspan="4">Other Details</th>
</tr>
<tr>
<td width="16%">Date of Recieving</td>
<td width="33%"><input type="text" name="revievingDate" id="revievingDate" Value="<?php echo $result['RecivedDate']; ?>" class="date form-control text_box" ></td>
<td width="20%">Remarks</td>
<td width="31%"><input type="text" name="remarks" id="remarks" Value="<?php echo $result['Remarks']; ?>" class="form-control text_box" ></td>
</tr>
<tr>
<td width="16%"> </td>
<td width="33%"> </td>
<td width="20%"> </td>
<td width="31%"> </td>
</tr>
<tr>
<td width="16%"> </td>
<td width="33%">
<input type="submit" name="submit" id="submit" class="btn btn-primary btn-sm" value="Submit">
<input type="reset" name="reset" id="reset" class="btn btn-primary btn-sm" value="Reset"> </td>
<td width="20%"> </td>
<td width="31%"> </td>
</tr>
</table>
</div>
</form>
</div>
</div>
<!--end of the content-->
<!--open of the footer-->
<div class="row" id="footer">
<div class="col-md-12">
<p>Copyright © 2015 INDIAN TRUCKERS, All rights reserved.</p>
</div>
</div>
<!--end footer-->
</div>
<!--end wraper-->
<!-------Javascript------->
<script src="js/bootstrap.min.js"></script>
</body>
</html>