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
|
<? require("inc/configure.php"); require("inc/global.php"); require("inc/checklogin.php"); if ($logged_in == 0) { //echo 'Not logged in. <a href="login.php">Login</a>'; header('Window-target: _parent'); header('Location: login.php'); exit(); } if (checkObject(16) <> 1){ die("Unauthorized Access"); exit(); } ?> <? $invoiceno = $_GET['invoiceno']; $lineno = $_GET['lineno'];
$sql = " delete from OM_INVOICE_DTL where invoiceno = $invoiceno and lineno = $lineno "; $result = mysql_query($sql);
if (!$result) { die('Invalid query: ' . mysql_error()); }
$sql = " update OM_INVOICE_DTL set lineno = lineno - 1 where invoiceno = $invoiceno and lineno > $lineno "; $result = mysql_query($sql);
if (!$result) { die('Invalid query: ' . mysql_error()); }
$sql = "delete from INV_STOCK_TRANSACTION where docno = '$invoiceno' and lineno = $lineno"; $result = mysql_query($sql); if (!$result) { die('Invalid query: ' . mysql_error()); }
$sql = " update INV_STOCK_TRANSACTION set lineno = lineno - 1 where docno = '$invoiceno' and lineno > $lineno "; $result = mysql_query($sql); if (!$result) { die('Invalid query: ' . mysql_error()); }
header("Location: invoicedetail.php?invoiceno=$invoiceno"); ?>
|