-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathinventurlager.php
134 lines (133 loc) · 4.93 KB
/
inventurlager.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
<?php
require_once("inc/stdLib.php");
include('inc/katalog.php');
$menu = $_SESSION['menu'];
$head = mkHeader();
?>
<html>
<head><title></title>
<?php echo $menu['stylesheets']; ?>
<?php echo $head['CRMCSS']; ?>
<?php echo $menu['javascripts']; ?>
<?php echo $head['THEME']; ?>
<script type='text/javascript'>
function getData() {
document.inventurs.comment.value = document.inventur.comment.value;
document.inventurs.budatum.value = document.inventur.budatum.value;
return true;
}
</script>
<script>
$(function() {
$( "#budatum" ).datepicker($.datepicker.regional[ "de" ]);
});
</script>
<body>
<?php
echo $menu['pre_content'];
echo $menu['start_content'];
if ($_POST) {
$comment = $_POST["comment"];
if ( $comment == '') $comment = 'Inventurbuchung';
if ($_POST['budatum'] != '') {
$now = $_POST['budatum'];
} else {
$now = date('d.m.Y');
}
$js = 'onSubmit="return getData();"';
}
if ($_POST['ok'] == 'sichern') {
$rc = updatePartBin($_POST);
echo $rc;
} else if ($_POST['ok'] == 'suchen') {
$tmp = explode(':',$_POST['lager']);
$wh = $tmp[0];
$bin = $tmp[1];
$artikel = getPartBin($_POST['pg'],$_POST['partnumber'],$_POST['obsolete'],$bin);
echo getLagername($wh,$bin);
if ($artikel) {
?>
<form name="inventur" action="inventurlager.php" method="post" onSubmit="return getData();">
<input type="hidden" name="warehouse" value="<?php echo $wh; ?>">
<input type="hidden" name="bin" value="<?php echo $bin; ?>">
Kommentar: <input type="text" name="comment" value="<?php echo $comment ?>">
Datum der Buchung: <input type="text" name="budatum" id="budatum" value="<?php echo $now; ?>" size="10" >
<br />
Transfertype:
<input type="radio" name="transtype" value="1" checked>Korrektur
<input type="radio" name="transtype" value="2">Einlagern / Entnahme
<input type="radio" name="transtype" value="3">Gefunden / Fehlbestand
<table>
<tr><td>Nummer</td><td>Artikel</td><td>Menge</td><td>Chargenumber</td><td>Bestbefore JJJJ-MM-DD</td></tr>
<?php $last = 0; foreach ($artikel as $part) {
if ( $last == $part['parts_id'] ) {
continue;
}
$last = $part['parts_id'];
echo "<tr><td>".$part['partnumber']."</td><td>".$part['partdescription']."</td><td nowrap>";
if ($part['qty'] == '') {
$qty = '';
} else {
$qty = abs($part['qty']);
if ($part['qty']<0) $qty *= -1;
};
$onhand = (abs($part['onhand']<0))?abs($part['onhand'])*-1:abs($part['onhand']);
$lager = '';
if ($part['bin_id']) $lager=' *';
echo '<input type="hidden" name="parts_id[]" value="'.$part['parts_id'].'">';
echo '<input type="hidden" name="oldqty[]" value="'.$part['qty'].'">';
echo '<input type="text" name="qty[]" value="'.$qty.'" size="5">'.$part['partunit'].' ('.$onhand.')</td><td>';
if ($lager=='') {
echo '<input type="type" name="chargenumber[]" value=""></td><td>';
} else {
echo '<input type="hidden" name="chargenumber[]" value="'.$part['chargenumber'].'">'.$part['chargenumber'].'</td><td>';
}
if ($lager=='') {
echo '<input type="text" name="bestfefore[]" value=""></td>';
} else {
echo '<input type="hidden" name="bestfefore[]" value="'.$part['bestbefore'].'">'.$part['bestbefore'].'</td>';
};
echo "<tr>";
};
?>
</table>
<input type="submit" name="ok" value="sichern">
</form>
<?php
} else {
echo "Artikel nicht gefunden: ".$_POST['partnumber'];
}
} // endif suche
$orte = getLagerOrte();
$pg = getPartsGroup();
$Ooptions = "";
if ($orte) foreach ($orte as $row) {
$Ooptions .= '<option value="'.$row['warehouse_id'].":".$row['id'].'">'.$row['ort'].' '.$row['platz'];
};
$Poptions = "";
if ($pg) foreach ($pg as $row) {
$Poptions .= '<option value="'.$row['id'].'">'.$row['partsgroup'];
};
?>
Inventurbuchung<br />
<form name="inventurs" action="inventurlager.php" method="post" <?php echo $js ?>>
<input type="hidden" name="comment" value="<?php echo $comment ?>">
<input type="hidden" name="budatum" value="<?php echo $now ?>">
Artikelnummer: <input type="text" size="20" name="partnumber"><br>
Warengruppe:
<select name="pg">
<option value="">Artikel ohne Warengruppe
<?php echo $Poptions; ?>
</select><br />
Lager:
<select name="lager">
<?php echo $Ooptions; ?>
</select><br />
<input type='radio' name='obsolete' value='f' checked>Nur gültige <input type='radio' name='obsolete' value='t'>Nur ungültige <input type='radio' name='obsolete' value=''>Alle Artikel<br/>
<input type="submit" name="ok" value="suchen">
</form>
<?php
echo $menu['end_content'];
?>
</body>
</html>