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
|
<?php $formid = "Order"; require_once "inc/configure.php"; $refid = (int)setDefaultReqVar("refid", '');
if($refid){ $sql = "SELECT * from ivc_fty WHERE refid = :refid"; $sth = $dbh->prepare($sql); $sth->execute( array(':refid' => $refid) ); } else { //vdump($_REQUEST); myerror(INVALID.WS.REQUESET); exit; } $row = $sth->fetch(); //vdump($row, $row['status']); $sth=null;
if( empty($row) ){ myerror(INVALID.WS.REQUESET); exit; } if( !havePermission("RCu")){ myerror(INVALID.WS.PERMISSION); exit; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>ENZA</title> <link rel="stylesheet" type="text/css" href="css/style.css" /> <?php require_once "inc/jsheader.php"; ?>
<script src="SpryAssets/SpryValidationSelect.js" type="text/javascript"></script> <script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script> <script> $(document).ready(function() { $(".focus").focus(); /* $( "#launch_date" ).datepicker({ dateFormat: "yy-mm-dd", defaultDate: "<?=date("Y-m-d")?>" }); $( "#del_date" ).datepicker({ dateFormat: "yy-mm-dd", defaultDate: "<?=datef($row['due_date'])?>" });*/ $(".submitform").on("click", function(e) { //$( "#tabs" ).tabs('select', 0); //goto first tab }); $("input.invoice_checkall").on('change', function(){ //console.log('checkall'); var c = this.checked; $("input.iv_check").each(function(){ $(this).prop("checked", c); //apply to all child $(this).change(); }); });
$("input#quick_rcpt").on("change blur", function(e) { //alert($("input#quick_rcpt").val()); var sn = $("input#quick_rcpt").val(); if(!sn || 0 === sn.length){ } else{ var selector = "input#"+sn+".iv_check"; //alert(selector); var result = $(selector).prop('checked', true); if(result.length){ //alert('ADDED'); } else { alert('<?=NOT_FOUND?>: ' + sn); } e.preventDefault(); $("input#quick_rcpt").val(''); setTimeout(function() { $("input#quick_rcpt").focus(); }, 100); } }) });
function localbind(){} </script> <link href="SpryAssets/SpryValidationSelect.css" rel="stylesheet" type="text/css" /> <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" /> </head> <body> <form action="ivc_ftyrcpt_modify.php" name="myform" id="myform" method="post" enctype="multipart/form-data"> <input type="hidden" name="action" value="ivc_ftyrcpt_modifyform" /> <input type="hidden" name="refid" value="<?=$refid?>" /> <input type="hidden" name="last_status" value="<?=$row['status']?>" /> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td valign="top" class="top"><?php require"mod_webhead.php"; ?></td> </tr> <tr> <td><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td valign="top" class="menu_bg"><?php require"mod_menu.php"; ?></td> <td valign="top" class="padding1"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr></tr> <tr> <td class="c3_bg"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr>
<td width="20" class="separator"><input type="image" src="image/icon_save.jpg" class="submitform" width="20" height="20" /></td> <td width="20" class="separator"><a href="<?=basename($_SERVER['REQUEST_URI'])?>"><img src="image/icon_undo.jpg" width="20" height="20" /></a></td>
<!--<td width="20" class="separator"><img src="image/icon_redo.jpg" width="20" height="20" /></td> <td width="20" class="separator"><img src="image/icon_delete.jpg" width="20" height="20" /></td>--> <td width="20" class="separator"><a href="pdf_ivc_fty.php?refid=<?=$refid?>" id="print_trig" target="_blank"><span class="ui-icon0 ui-icon-print" ><?=PRINT_?></span></a></td> <!--<td width="20" class="separator"><a href="#" id="download_trig"><span class="ui-icon0 ui-icon-circle-triangle-s" ></span> <?=FILES?> </a></td>--> <!--<td width="20" class="separator"><a href="dgn_drawing_print.php?refid=<?=$row['refid']?>" target="_new"><?=PRINT_?></a></td>--> <td class="separator stext1"><?=FACTORY?><?=WS?><?=INVOICE?> - <span> <?=CONFIRM?> </span></td> <td class="separator etext1"><?=$row['ivc_customer']?> - <span> <?=$row['ivc_nbr']?> </span></td> <td width="200" align="right" class="separator etext2"><?=LAST_MODIFY?>: <?=lastUpdate($row)?></td> <td width="80" align="right" class="separator etext2"><a href="ivc_ftyrcpt_index.php?act=resume" onclick="return ConfirmSave('myform')" class="closebtn"><?=CLOSE?></a> <input type="hidden" name="godest" id="godest" /> <input type="hidden" name="formdest" value="ivc_ftyrcpt_index.php?act=resume" /></td> </tr> </table></td> </tr> <tr> <td valign="top" class="c2_bg"><!--main form--> <!--editable--> <div id="tabs" class="ui-tabs"> <ul> <li><a href="#tabs-2"> <?=GENERAL?> </a></li> <li><a href="#tabs-4"> <?=DETAIL?> </a></li> </ul> <div id="scontent"> <div id="tabs-2"> <p> <table> <tr> <td ><?=CUSTOMER?></td> <td ><?=resolveCode_master_type_code("COMPANY", $row['ivc_customer'], true)?></td> </tr> <tr> <td ><?=STATUS?></td> <td ><?=resolveCode_master_type_code("INVOICE_STATUS", $row['status'], true)?></td> </tr> <tr> <td ><?=LAUNCH_DATE?></td> <td ><input type="text" name="launch_date" id="launch_date_d" value="<?=date("Y-m-d")?>" readonly="readonly" /></td> </tr> <tr> <td ><?=DUE?><?=WS?><?=DATE?></td> <td ><span id="sprytextfield1"> <input name="due_date" value="<?=datef($row['due_date'])?>" id="del_date" readonly="readonly" /> </span></td> </tr> </table> </p> </div>
<div id="tabs-4"> S/N: <input type="text" id="quick_rcpt" class="shortfield focus" /> <p><table width="100%" id="product_table" border="0" cellpadding="0" cellspacing="0" class="jexpand0 tablelist nocss0">
<tr> <th><?=RECEIVED?><input type="checkbox" name="invoice_checkall" class="invoice_checkall" /></th> <th><?=ORDER?><?=WS?><?=NUMBER?></th> <th><?=ITEMNO?></th> <th>S/N</th> <th><?=WEIGHT?></th> <th><?=METAL?><?=WS?><?=WEIGHT?></th> <th><?=DIAMOND?><?=WS?><?=WEIGHT?></th> <th><?=STONE?><?=WS?><?=WEIGHT?></th> <th><?=QTY?></th> <?php if(havePermission("DCr")){ //DC-------------------------------?> <th><?=UNIT?><?=WS?><?=COST?></th> <th><?=FACTORY?><?=WS?><?=COST?></th> <?php } //end of DC-------------------------------------------------?> <?php if(havePermission("DPr")){ //DP-------------------------------?> <th><?=PRICE?></th> <?php } //end of DP-------------------------------------------------?> <?php if(havePermission("DCr") && havePermission("DPr")){ //DC DP--------------------------?> <th><?=COEF?></th> <?php } //end of DC DP----------------------------------------------?> <!-- <th> </th> <th> </th>--> </tr> <?php // product items===================================================== $sql2 = "SELECT dbo.ord_txpako.*, dbo.ord_main.order_nbr, dbo.ord_main.refid as ordmainrefid, dbo.ord_dtl.itemno
FROM dbo.ivc_fty INNER JOIN dbo.ord_txpako ON dbo.ord_txpako.ivcfty_refid = dbo.ivc_fty.refid INNER JOIN dbo.ord_dtl ON dbo.ord_dtl.refid = dbo.ord_txpako.orddtl_refid INNER JOIN dbo.ord_main ON dbo.ord_dtl.main_refid = dbo.ord_main.refid WHERE dbo.ivc_fty.refid = :ivcfty_refid"; $sth2 = $dbh->prepare($sql2); $q = $sth2->execute( array(':ivcfty_refid' => $refid) ); //echo $sth2->getSQL( array(':ivcfty_refid' => $refid) ); while( $row2 = $sth2->fetch() ) { $discount_price = discountPrice($row2['unitprice'], $row2['discount']); //$attr = ($row2['status']=='RECEIVED') ? 'class="iv_checked" checked="checked" onclick="return false;"' : 'class="iv_check"'; ?> <tr> <?php if( !empty($row2['received_time']) ) { ?> <td class="tdalignmid"><input type="checkbox" name="invoice_checked[<?=$row2['refid']?>]" id="<?=generateSN($row2['refid'])?>" class="iv_checked" checked="checked" onclick="return false;" /></td> <?php } else { ?> <td class="tdalignmid"><input type="checkbox" name="invoice_check[<?=$row2['refid']?>]" class="iv_check" id="<?=generateSN($row2['refid'])?>" /></td> <?php } ?> <td class="code"><a href="ord_dtl_modifyform.php?refid=<?=$row2['ordmainrefid']?>#tabs-4" class="fbox" ><?=$row2['order_nbr']?></a></td> <td class="code"><?=ord_htmllink_jobcard($row2['orddtl_refid'], $row2['itemno'], 'class="ctip fbox" ctip="ajax_thumb_inv_product.php?itemno='.$row2['itemno'].'&formid='.$formid.'"')?></td> <td class="code"><?=generateSN($row2['refid'])?></a></td> <td align="right"><?=numf($row2['product_wt'])?>gr</td> <td align="right"><?=numf($row2['metal_wt'])?>gr</td> <td align="right"><?=numf($row2['dia_wt'])?><?=$row2['uom_stonewt']?></td> <td align="right"><?=numf($row2['stone_wt'])?><?=$row2['uom_stonewt']?></td> <td align="right"><?=numf($row2['txqty'])?></td> <?php if(havePermission("DCr")){ //DC-------------------------------?> <td align="right"><?=numfs($row2['unitcost'])?></td> <td align="right"><?=numfs($row2['unitfactcost'])?></td> <?php } //end of DC-------------------------------------------------?> <?php if(havePermission("DPr")){ //DP-------------------------------?> <td align="right" style="color:#636"><b><?=numfs($discount_price)?></b></td> <?php } //end of DP-------------------------------------------------?> <?php if(havePermission("DCr") && havePermission("DPr")){ //DC DP-----------------------?> <td align="right"><?=numfs(calcMarginNew($discount_price, $row2['unitcost']))?></td> <?php } //end of DC DP---------------------------------------------?> </tr> <?php } ?>
<?php //raw material ====================================================== $sql2 = "SELECT dbo.ord_main.order_nbr, dbo.ord_main.refid AS ordmainrefid, dbo.ord_dtl_rm.bomcategory AS bomcategy, dbo.ord_dtl_rm.itemno, dbo.ord_dtl_rm.itemnoid, dbo.ord_txpako_rm.qtyofprice, dbo.ord_txpako_rm.txqty, dbo.ord_txpako_rm.rm_wt, dbo.ord_txpako_rm.* FROM dbo.ord_dtl_rm INNER JOIN dbo.ord_main ON dbo.ord_dtl_rm.main_refid = dbo.ord_main.refid INNER JOIN dbo.ord_txpako_rm ON dbo.ord_txpako_rm.orddtlrm_refid = dbo.ord_dtl_rm.refid WHERE dbo.ord_txpako_rm.ivcfty_refid = :ivcfty_refid"; $sth2 = $dbh->prepare($sql2); $q = $sth2->execute( array(':ivcfty_refid' => $refid) ); //echo $sth2->getSQL( array(':ivcfty_refid' => $refid) ); while( $row2 = $sth2->fetch() ) { $discount_price = discountPrice($row2['unitprice'], $row2['discount']); $table = inv_getBomcategyTablename($row2['bomcategy']); $item = getDB($table, $row2['itemnoid']); $row2['qty'] = $row2['qtyofprice']; //$attr = ($row2['status']=='RECEIVED') ? 'class="iv_checked" checked="checked" onclick="return false;"' : 'class="iv_check"'; ?> <tr> <?php if( !empty($row2['received_time']) ) { ?> <td class="tdalignmid"><input type="checkbox" name="material_checked[<?=$row2['refid']?>]" id="<?=generateRMSN($row2['refid'])?>" class="iv_checked" checked="checked" onclick="return false;" /></td> <?php } else { ?> <td class="tdalignmid"><input type="checkbox" name="material_check[<?=$row2['refid']?>]" class="iv_check" id="<?=generateRMSN($row2['refid'])?>" /></td> <?php } ?> <td class="code"><a href="ord_dtl_modifyform.php?refid=<?=$row2['ordmainrefid']?>#tabs-4" class="fbox" ><?=$row2['order_nbr']?></a></td> <td class="code"><?=$row2['itemno']?></td> <!--<td class="code"><?=resolveCode_master_type_code("BOMCATEGY", $row2['bomcategy'])?></td>--> <td class="code"><?=generateRMSN($row2['refid'])?></a></td> <td><?=numf($row2['rm_wt'] ,3)?> <?=$row2['uom_wt']?></td> <td colspan="3"><?=$item['name_'.SYS_LANG]?></td> <td align="right"><?=numf($row2['qty'])?></td> <?php if(havePermission("DCr")){ //DC-------------------------------?> <td align="right"><?=numfs($row2['unitcost'])?></td> <td align="right"><?=numfs($row2['unitfactcost'])?></td> <?php } //end of DC-------------------------------------------------?> <?php if(havePermission("DPr")){ //DP-------------------------------?> <td align="right" style="color:#636"><b><?=numfs($row2['unitfactcost']*$row2['qty'])?></b></td> <?php } //end of DP-------------------------------------------------?> <?php if(havePermission("DCr") && havePermission("DPr")){ //DC DP-----------------------?> <td align="right"><?=numfs(calcMarginNew($row2['unitfactcost'], $row2['unitcost']))?></td> <?php } //end of DC DP---------------------------------------------?> </tr> <?php } ?> <?php //extra items========================================================= $sql2 = "SELECT dbo.ord_dtl_extra.*, dbo.ord_main.order_nbr, dbo.ord_main.refid as ordmainrefid
FROM dbo.ord_dtl_extra INNER JOIN dbo.ord_main ON dbo.ord_dtl_extra.main_refid = dbo.ord_main.refid WHERE dbo.ord_dtl_extra.ivcfty_refid = :ivcfty_refid"; $sth2 = $dbh->prepare($sql2); $q = $sth2->execute( array(':ivcfty_refid' => $refid) ); //echo $sth2->getSQL( array(':ivcfty_refid' => $refid) ); while( $row2 = $sth2->fetch() ) { $discount_price = discountPrice($row2['unitprice'], $row2['discount']); //$attr = ($row2['status']=='RECEIVED') ? 'class="iv_checked" checked="checked" onclick="return false;"' : 'class="iv_check"'; ?> <tr> <?php if( !empty($row2['received_time']) ) { ?> <td class="tdalignmid"><input type="checkbox" name="extra_checked[<?=$row2['refid']?>]" id="<?=generateExtraSN($row2['refid'])?>" class="iv_checked" checked="checked" onclick="return false;" /></td> <?php } else { ?> <td class="tdalignmid"><input type="checkbox" name="extra_check[<?=$row2['refid']?>]" class="iv_check" id="<?=generateExtraSN($row2['refid'])?>" /></td> <?php } ?> <td class="code"><a href="ord_dtl_modifyform.php?refid=<?=$row2['ordmainrefid']?>#tabs-4" class="fbox" ><?=$row2['order_nbr']?></a></td> <td class="code"><?=OTHER?></td> <td class="code"><?=generateExtraSN($row2['refid'])?></a></td> <td colspan="4"><?=$row2['desc']?></td> <td align="right"><?=numf($row2['qty'])?></td> <?php if(havePermission("DCr")){ //DC-------------------------------?> <td align="right"><?=numfs($row2['unitcost'])?></td> <td align="right"><?=numfs($row2['unitfactcost'])?></td> <?php } //end of DC-------------------------------------------------?> <?php if(havePermission("DPr")){ //DP-------------------------------?> <td align="right" style="color:#636"><b><?=numfs($discount_price)?></b></td> <?php } //end of DP-------------------------------------------------?> <?php if(havePermission("DCr") && havePermission("DPr")){ //DC DP-----------------------?> <td align="right"><?=numfs(calcMarginNew($discount_price, $row2['unitcost']))?></td> <?php } //end of DC DP---------------------------------------------?> </tr> <?php } ?> </table> </p> </div>
</div> <!--end scontent--> <input type="hidden" name="refid" value="<?=$refid?>" id="refid" /> </div> <!--end of readonly--> <!-- end of mainform--></td> <td valign="top"></td> </tr> </table></td> </tr> </table></td> </tr> </table> </form>
</body> </html>
|