Changeset 9cbd158
- Timestamp:
- Jun 24, 2011, 1:30:37 AM (12 years ago)
- Branches:
- master
- Children:
- ec0d8d6
- Parents:
- cf69520
- Location:
- web/include
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
web/include/doc.nulltype.php
rcf69520 r9cbd158 80 80 public function Create($doc_data, $from='') 81 81 { 82 //var_dump($doc_data); 82 83 global $uid, $CONFIG; 83 84 if(!isAccess('doc_'.$this->doc_name,'create')) throw new AccessException(""); … … 89 90 $col_array=array(); 90 91 for ($i = 0; $i < $columns; $i++) $col_array[mysql_field_name($fields, $i)]=mysql_field_name($fields, $i); 91 unset($col_array['id'],$col_array['date'],$col_array['type'],$col_array['user'] );92 $ col_array['altnum']=GetNextAltNum($this->doc_type ,$col_array['subtype']);92 unset($col_array['id'],$col_array['date'],$col_array['type'],$col_array['user'],$col_array['ok']); 93 $doc_data['altnum']=GetNextAltNum($this->doc_type ,$col_array['subtype']); 93 94 $sqlinsert_keys="`date`, `type`, `user`"; 94 95 $sqlinsert_value="'$date', '".$this->doc_type."', '$uid'"; 95 96 // echo"<br>"; 97 // var_dump($col_array); 96 98 foreach($col_array as $key) 97 99 { -
web/include/doc.postuplenie.php
rcf69520 r9cbd158 369 369 VALUES ('$r_id','cena','{$this->dop_data['cena']}')"); 370 370 371 $res=mysql_query("SELECT `tovar`, `cnt`, ` sn`, `comm`, `cost` FROM `doc_list_pos`371 $res=mysql_query("SELECT `tovar`, `cnt`, `comm`, `cost` FROM `doc_list_pos` 372 372 WHERE `doc_list_pos`.`doc`='{$this->doc}'"); 373 373 while($nxt=mysql_fetch_row($res)) 374 374 { 375 mysql_query("INSERT INTO `doc_list_pos` (`doc`, `tovar`, `cnt`, ` sn`, `comm`, `cost`)376 VALUES ('$r_id', '$nxt[0]', '$nxt[1]', '$nxt[2]', '$nxt[3]' , '$nxt[4]')");375 mysql_query("INSERT INTO `doc_list_pos` (`doc`, `tovar`, `cnt`, `comm`, `cost`) 376 VALUES ('$r_id', '$nxt[0]', '$nxt[1]', '$nxt[2]', '$nxt[3]' )"); 377 377 } 378 378 } … … 380 380 { 381 381 $new_id=0; 382 $res=mysql_query("SELECT `a`.`tovar`, `a`.`cnt`, `a`.` sn`, `a`.`comm`, `a`.`cost`,382 $res=mysql_query("SELECT `a`.`tovar`, `a`.`cnt`, `a`.`comm`, `a`.`cost`, 383 383 ( SELECT SUM(`b`.`cnt`) FROM `doc_list_pos` AS `b` 384 384 INNER JOIN `doc_list` ON `b`.`doc`=`doc_list`.`id` AND `doc_list`.`p_doc`='{$this->doc}' AND `doc_list`.`mark_del`='0' … … 407 407 } 408 408 $n_cnt=$nxt[1]-$nxt[5]; 409 mysql_query("INSERT INTO `doc_list_pos` (`doc`, `tovar`, `cnt`, ` sn`, `comm`, `cost`)410 VALUES ('$new_id', '$nxt[0]', '$n_cnt', '$nxt[2]', '$nxt[3]' , '$nxt[4]')");409 mysql_query("INSERT INTO `doc_list_pos` (`doc`, `tovar`, `cnt`, `comm`, `cost`) 410 VALUES ('$new_id', '$nxt[0]', '$n_cnt', '$nxt[2]', '$nxt[3]' )"); 411 411 } 412 412 } -
web/include/doc.zayavka.php
rcf69520 r9cbd158 315 315 VALUES ('$r_id','cena','{$this->dop_data['cena']}')"); 316 316 317 $res=mysql_query("SELECT `tovar`, `cnt`, ` sn`, `comm`, `cost` FROM `doc_list_pos`317 $res=mysql_query("SELECT `tovar`, `cnt`, `comm`, `cost` FROM `doc_list_pos` 318 318 WHERE `doc_list_pos`.`doc`='{$this->doc}'"); 319 319 while($nxt=mysql_fetch_row($res)) 320 320 { 321 mysql_query("INSERT INTO `doc_list_pos` (`doc`, `tovar`, `cnt`, ` sn`, `comm`, `cost`)322 VALUES ('$r_id', '$nxt[0]', '$nxt[1]', '$nxt[2]', '$nxt[3]' , '$nxt[4]')");321 mysql_query("INSERT INTO `doc_list_pos` (`doc`, `tovar`, `cnt`, `comm`, `cost`) 322 VALUES ('$r_id', '$nxt[0]', '$nxt[1]', '$nxt[2]', '$nxt[3]')"); 323 323 } 324 324 } … … 326 326 { 327 327 $new_id=0; 328 $res=mysql_query("SELECT `a`.`tovar`, `a`.`cnt`, `a`.` sn`, `a`.`comm`, `a`.`cost`,328 $res=mysql_query("SELECT `a`.`tovar`, `a`.`cnt`, `a`.`comm`, `a`.`cost`, 329 329 ( SELECT SUM(`b`.`cnt`) FROM `doc_list_pos` AS `b` 330 330 INNER JOIN `doc_list` ON `b`.`doc`=`doc_list`.`id` AND `doc_list`.`p_doc`='{$this->doc}' AND `doc_list`.`mark_del`='0' … … 336 336 { 337 337 //echo"$nxt[5] - $nxt[1]<br>"; 338 if($nxt[ 5]<$nxt[1])338 if($nxt[4]<$nxt[1]) 339 339 { 340 340 … … 352 352 VALUES ('$new_id','cena','{$this->dop_data['cena']}')"); 353 353 } 354 $n_cnt=$nxt[1]-$nxt[ 5];355 mysql_query("INSERT INTO `doc_list_pos` (`doc`, `tovar`, `cnt`, ` sn`, `comm`, `cost`)356 VALUES ('$new_id', '$nxt[0]', '$n_cnt', '$nxt[2]', '$nxt[3]' , '$nxt[4]')");354 $n_cnt=$nxt[1]-$nxt[4]; 355 mysql_query("INSERT INTO `doc_list_pos` (`doc`, `tovar`, `cnt`, `comm`, `cost`) 356 VALUES ('$new_id', '$nxt[0]', '$n_cnt', '$nxt[2]', '$nxt[3]' )"); 357 357 } 358 358 }
Note: See TracChangeset
for help on using the changeset viewer.