"") { $sw = trim($_POST[searchword]); $strsqlwhere = " and sm.searchword like '%".$sw."%'"; $strsqlwordwhere = $strsqlwhere; $strsqlorderby = "shu.shozokuid,shu.shohincd,shu.shomi,shu.stockdate"; } elseif ( $_POST[shohincd] <> "") { $strsqlwhere = " and sm.shohincd = '".$_POST[shohincd]."'"; $shohincd = $_POST[shohincd]; $strsqlorderby = "shu.route,shu.shozokuid,shu.shomi,shu.stockdate"; } else { $strsqlorderby = "shu.shozokuid,shu.shohincd,shu.shomi,shu.stockdate"; } //センター if ($_POST[center]<>""){ $centerid = $_POST[center]; } elseif ($_GET[center]<>""){ $centerid = $_GET[center]; } else { $centerid = $centerdata[0][1]; } //出荷確定 //確定、未確定 $codedata2[] = array('全て',-1); $codedata2[] = array('未確定',1); $codedata2[] = array('確定済',2); if ($_POST["intordercartflg"] == "") { $intordercartflg = -1; } elseif ($_POST["intordercartflg"] == "-1") { $intordercartflg = $_POST["intordercartflg"]; } elseif ($_POST["intordercartflg"] == "1") { $intordercartflg = $_POST["intordercartflg"]; $strwhereflg = " AND shukkaflg < 2 "; } else { $intordercartflg = $_POST["intordercartflg"]; $strwhereflg = " AND shukkaflg >= 2 "; } //1ページ数 $pageset = 50; //注文日 if (($_GET[chgday] =="") and ($_POST[chgday] =="")){ $orderdate = 0; } elseif ($_GET[chgday] <> ""){ $orderdate = $_GET[chgday]; } else { $orderdate = $_POST[chgday]; //出荷作業日 } //作業日 $operatedate = $orderdate; //オプション $codedata104 = dbselect("cname,code","`".$company."code`","codekind = 104 and code > 0","codeid",-1); //店舗データ入れ替え if($userdata[brand] <> "") { $strsqlbrand = " and sho.brand in(".$userdata[brand].")"; $strsqlshozoku = dbselectin("SELECT shozokuid FROM `".$company."shozokumaster` as sho WHERE 1 $strsqlbrand"," and shu.shozokuid in "); //業態料率 $codedata120 = dbselect("cname,code","`".$company."code`","codekind = 120 and code in (".$userdata[brand].")","codeid",-1); } else { //業態料率 $codedata120 = dbselect("cname,code","`".$company."code`","codekind = 120","codeid",-1); } //商品データ if ($userdata["supplyerid2"]<> ""){ // $strsql = "SELECT shohincd FROM `".$company."shohinmaster` WHERE makercode in (".$userdata["supplyerid2"].") "; // $strsqlsm = dbselectin($strsql," and shohincd in "); } //サプライヤー if ($_POST[maker] <> "") { $strsqmaker = " and sm.makercode = '$_POST[maker]'"; } if ($userdata["supplyerid2"] <> ""){ $strsqmaker .= " and sm.makercode in (".$userdata["supplyerid2"].") "; } //店舗・商品データ $tenpodata = dbselect("shozokuname,shu.shozokuid","`".$company."shozokumaster` as sho INNER JOIN `".$company."shukka` as shu using (shozokuid)","shu.operatedate = DATE_ADD(CURDATE(),INTERVAL $orderdate DAY) $strsqlbrand $strsqlsm GROUP BY shu.shozokuid ","shu.shozokuid",-1); Testecho($strsqldbselect); $tenpodataall = dbselect("shozokuname,shozokuid","`".$company."shozokumaster` as sho","1 $strsqlbrand",-1,-1); $shohindata = dbselect("concat(shohinmei,(case when zaiko < 1 then ' 【非公開中】' else '' end)),shu.shohincd","`".$company."shohinmaster` as sm INNER JOIN `".$company."shukka` as shu using (shohincd)","shu.operatedate = DATE_ADD(CURDATE(),INTERVAL $orderdate DAY) $strsqlshozoku $strsqmaker GROUP BY shu.shohincd ","sm.makercode,sm.category,sm.shohinmei,sm.shohincd",-1); $shohindataall = dbselect("concat('',companyname,'',(case when ryutu_type < 2 then '[在庫]' else '[通過]' end),(case when makercode = 'waka' then ' 【一幸】' else '' end),cname,' ',shohinmei,(case when zaiko < 1 then ' 【非公開中】' else '' end),(case when makercode = 'waka' then ' 【一幸】' else '' end)),shohincd","`".$company."shohinmaster` as sm INNER JOIN `".$company."code` as cd,company as co","co.companyid = sm.makercode and sm.code = cd.code and sm.ryutu_type < 3 and codekind = 1 $strsqlwordwhere $strsqmaker","sm.makercode,sm.ryutu_type,sm.shohincd,zaiko desc,shohincd",-1); //不定貫 if($_POST[futeikan] == "") { $futeikan = 1; } else { $futeikan = $_POST[futeikan]; } //業態 if ($_POST[gyotai]<>""){ $gyotaiid = $_POST[gyotai]; } else { $gyotaiid = $gyotaidata[0][1]; } //$strsqlwhere .= "and shu.gyotaiid= '".$gyotaiid ."'"; //納品先 if ($_POST[tenpo]<>""){ $shozokuid = $_POST[tenpo]; $strsqlwhere .= " and shu.shozokuid = '$shozokuid'"; } elseif ($_GET[shotenp] <> "") { $shozokuid = $_GET[shotenp]; $strsqlwhere .= " and shu.shozokuid = '$shozokuid'"; } //変更処理 if (($_POST[allsubmit] == "update") or ($_POST[allsubmit] == "kakutei")){ if($_POST[allsubmit] == "kakutei") { $flg = 2; } else { $flg = 1; } For ($y=0;$y< $_POST[row];$y++) { $totalgram = 0; if((int)$_POST{"fix".$y} == 1) { //確定済みはメモのみ更新 $strsql = "UPDATE `".$company."shukka` set memoadd='".sqlinjection($_POST{"memoadd".$y},-1)."',updater='".$userdata["tid"]."' "; $strsql .= " WHERE shukkaid = '".$_POST{"id".$y}."' limit 1"; Testecho ($y." ROW:".mysql_affected_rows()." ".$strsql); //debug $result=@mysql_query($strsql,$my_con); mysql_sql_log($strsql,mysql_affected_rows(),$_SERVER['SCRIPT_NAME'].":".__LINE__); } else { //更新(出荷数量) if ((Numchecker6403($_POST{"amount".$y})=="CHR") or (Numchecker6403($_POST{"price".$y})=="CHR")) { //0.数値欄に文字が入れられたら何も更新しない。 $errmsg .= "数値以外の入力値がありましたので、更新できない商品がありました。No.".($y + 1)." [".$_POST{"shohincd".$y}."]
";$errcount++; } elseif(($_POST{"lotnum".$y} > 0) and (($_POST{"lotqty".$y} + $_POST{"amountold".$y} - $_POST{"amount".$y}) < 0)) { //LOT番号があり、LOT + 現在数以上の出荷は不可にして何もしない $errmsg .= "同一のロットを超える入力値がありましたので、更新できない商品がありました。No.".($y + 1)." [".$_POST{"shohincd".$y}."]
";$errcount++; } else { $strsql = "UPDATE `".$company."shukka` set shukkaqty='".$_POST{"amount".$y}."',memo3='".sqlinjection($_POST{"shohinname".$y},-1)."',memoadd='".sqlinjection($_POST{"memoadd".$y},-1)."',price_piece = '".$_POST{"price".$y}."',shukkaflg =".$flg.", updater='".$userdata["tid"]."' ";$okcount++; $strsql .= " WHERE shukkaid = '".$_POST{"id".$y}."' limit 1"; Testecho ($y." ROW:".mysql_affected_rows()." ".$strsql); //debug $result=@mysql_query($strsql,$my_con); mysql_sql_log($strsql,mysql_affected_rows(),$_SERVER['SCRIPT_NAME'].":".__LINE__); //在庫品 引当 if($_POST{"lotnum".$y} > 0) { $lotqty = $_POST{"amountold".$y} - $_POST{"amount".$y}; $strsql = "UPDATE `".$company."stockdata` SET nonreserveqty = nonreserveqty +".$lotqty.",updater ='".$userdata["tid"]."' WHERE lotnum ='".$_POST{"lotnum".$y}."'"; Testecho ($y." ROW:".mysql_affected_rows()." ".$strsql); //debug $result=@mysql_query($strsql,$my_con); mysql_sql_log($strsql,mysql_affected_rows(),$_SERVER['SCRIPT_NAME'].":".__LINE__); } } //更新(重量) if (sizeof($_POST{"gram".$y} > 0) and ($futeikan == 1)) { $strsql = "DELETE FROM `".$company."shukkafuteikan` WHERE shukkaid='".$_POST{"id".$y}."'"; $result=@mysql_query($strsql,$my_con); mysql_sql_log($strsql,mysql_affected_rows(),$_SERVER['SCRIPT_NAME'].":".__LINE__); for ($pi = 0; $pi < sizeof($_POST{"gram".$y}); $pi++) { if (($_POST{"gram".$y}[$pi] <> "") and (Numchecker6403($_POST{"gram".$y}[$pi]) == "CHR")) { //0.数値欄に文字が入れられたら何も更新しない。 $errmsg .= "数値以外の入力値がありましたので、更新できない商品がありました。No.".($y + 1)." [".$_POST{"shohincd".$y}."]
";$errcount++; } elseif(Numchecker2($_POST{"gram".$y}[$pi]) > 0) { $strsql = "INSERT INTO `".$company."shukkafuteikan`(shukkaid,gram,creater,createdate) VALUES('".$_POST{"id".$y}."','".$_POST{"gram".$y}[$pi]."','".$userdata["tid"]."',now())";$okcount++; $result=mysql_query($strsql,$my_con); $errcode =@mysql_errno(); $totalgram += $_POST{"gram".$y}[$pi]; Testecho ($y." ROW:".mysql_affected_rows()." ".$strsql."
"); #debug mysql_sql_log($strsql,mysql_affected_rows(),$_SERVER['SCRIPT_NAME'].":".__LINE__); } } } //出荷実績の不定貫合計重量TOTALGRAM更新、合計金額計算 $strsql = "UPDATE `".$company."shukka` as shu,`".$company."shohinmaster` as sm SET totalgram = '".$totalgram."',shukkaflg =".$flg." ,price_total = truncate(".($totalgram * $_POST{"price".$y}).",0) WHERE shohin_kubun3 >= 0 and shukkaid= '".$_POST{"id".$y}."' and shu.shohincd = sm.shohincd "; $result=mysql_query($strsql,$my_con); $errcode =@mysql_errno(); Testecho ($y." ROW:".mysql_affected_rows()." ".$strsql."
"); #debug mysql_sql_log($strsql,mysql_affected_rows(),$_SERVER['SCRIPT_NAME'].":".__LINE__); //直送の実績の数量更新 $strsql = "UPDATE `".$company."shukka` as shu,`".$company."directsupply` AS ds SET ds.shukkaqty = '".$_POST{"amount".$y}."',ds.price_piece = '".$_POST{"price".$y}."',ds.price_total = truncate('".$_POST{"price".$y}."' * ".$_POST{"amount".$y}.",0) WHERE ds.orderid = shu.orderid and shu.shukkaid= '".$_POST{"id".$y}."'"; $result=mysql_query($strsql,$my_con); $errcode =@mysql_errno(); Testecho ($y." ROW:".mysql_affected_rows()." ".$strsql."
"); #debug mysql_sql_log($strsql,mysql_affected_rows(),$_SERVER['SCRIPT_NAME'].":".__LINE__); //直送の実績の不定貫更新 $strsql = "UPDATE `".$company."shukka` as shu,`".$company."shohinmaster` as sm,`".$company."directsupply` AS ds SET ds.totalgram = '".$totalgram."',ds.price_total = truncate(".$totalgram." * ".$_POST{"price".$y}.",0) WHERE sm.shohin_kubun3 >= 0 and ds.orderid = shu.orderid and DC_TC = 3 and shukkaid= '".$_POST{"id".$y}."' and shu.shohincd = sm.shohincd "; $result=mysql_query($strsql,$my_con); $errcode =@mysql_errno(); Testecho ($y." ROW:".mysql_affected_rows()." ".$strsql."
"); #debug mysql_sql_log($strsql,mysql_affected_rows(),$_SERVER['SCRIPT_NAME'].":".__LINE__); //出荷実績の不定貫だが、合計重量0は、確定できない $strsql = "UPDATE `".$company."shukka` as shu,`".$company."shohinmaster` as sm SET shukkaflg = 1 WHERE shukkaflg = 2 and shu.shohincd = sm.shohincd and sm.shohin_kubun3 = 1 and totalgram = 0 and shukkaid= '".$_POST{"id".$y}."'"; $result=mysql_query($strsql,$my_con); mysql_sql_log($strsql,mysql_affected_rows(),$_SERVER['SCRIPT_NAME'].":".__LINE__); Testecho ($y." ROW:".mysql_affected_rows()." ".$strsql."
"); #debug if(mysql_affected_rows() == 1) { $errmsg .= "重量入力がないため、確定できない不定貫商品がありました。No.".($y + 1)." [".$_POST{"shohincd".$y}."]
";$errcount++; } //合計金額を計算(個数) $strsql = "UPDATE `".$company."shukka` as shu,`".$company."shohinmaster` as sm SET price_total = truncate(".($_POST{"amount".$y} * $_POST{"price".$y}).",0) WHERE shu.shohincd = sm.shohincd and ((sm.shohin_kubun3 = 0) or (sm.shohincd ='0' and totalgram = 0)) and shukkaid= '".$_POST{"id".$y}."'"; $result=mysql_query($strsql,$my_con); mysql_sql_log($strsql,mysql_affected_rows(),$_SERVER['SCRIPT_NAME'].":".__LINE__); Testecho ($y." ROW:".mysql_affected_rows()." ".$strsql."
"); #debug //業態料率計算 brand /* for ($i = 0; $i < sizeof($codedata120); $i++) { //不定貫 $strsql ="update cool_shukka as a , cool_shohinmaster as b , cool_shozokumaster as c set price_piece2 = truncate(price_piece * ".$codedata120[$i][0].",0), price_total2 = truncate(truncate(price_piece * ".$codedata120[$i][0].",0) * totalgram,0) where a.shohincd = b.shohincd and shohin_kubun3 = 1 and a.shozokuid = c.shozokuid and a.operatedate = DATE_ADD(CURDATE(),INTERVAL $operatedate DAY) and c.brand = ".$codedata120[$i][1]." and shukkaid= '".$_POST{"id".$y}."'"; $result=mysql_query($strsql,$my_con); $errcode =@mysql_errno(); Testecho ($y." ROW:".mysql_affected_rows()." ".$strsql."
"); #debug mysql_sql_log($strsql,mysql_affected_rows(),$_SERVER['SCRIPT_NAME'].":".__LINE__); //定貫 $strsql ="update cool_shukka as a , cool_shohinmaster as b , cool_shozokumaster as c set price_piece2 = truncate(price_piece * ".$codedata120[$i][0].",0), price_total2 = truncate(truncate(price_piece * ".$codedata120[$i][0].",0) * shukkaqty,0) where a.shohincd = b.shohincd and shohin_kubun3 = 0 and a.shozokuid = c.shozokuid and a.operatedate = DATE_ADD(CURDATE(),INTERVAL $operatedate DAY) and c.brand = ".$codedata120[$i][1]." and shukkaid= '".$_POST{"id".$y}."'"; $result=mysql_query($strsql,$my_con); $errcode =@mysql_errno(); Testecho ($y." ROW:".mysql_affected_rows()." ".$strsql."
"); #debug mysql_sql_log($strsql,mysql_affected_rows(),$_SERVER['SCRIPT_NAME'].":".__LINE__); } */ } } //出荷数ゼロは削除 $strsql = "DELETE FROM `".$company."shukka` WHERE shukkaqty = 0"; // $result=mysql_query($strsql,$my_con); mysql_sql_log($strsql,mysql_affected_rows(),$_SERVER['SCRIPT_NAME'].":".__LINE__); Testecho ($y." ROW:".mysql_affected_rows()." ".$strsql."
"); #debug //アイテム追加 if($_POST["newitem"] <> "") { $strsql = "INSERT INTO `".$company."shukka` (`orderid`, `shozokuid`, `shohincd`, `centerid`,`picktimes`, `loccode`,`gyotaiid`, `stockdate`, `shomi`,`lotzan`, `waitingflg`, `orderqty`,`shukkaqty`, totalgram, `operatedate`, `shukkadate`, `deliverdate`, `creater`,createdate, `lotnum`,`price_piece`,`price_total`,memo,memo2) values( 0, '".$_POST["newshozokuid"]."', '".$_POST["newitem"]."', '".$_POST["center"]."',1, null,'".$_POST["gyotai"]."', null, null,null, 0,0, '".$_POST["amountnew"]."','".$_POST["gramnew"][0]."', DATE_ADD(CURDATE(),INTERVAL $operatedate DAY), DATE_ADD(CURDATE(),INTERVAL $operatedate DAY), DATE_ADD(CURDATE(),INTERVAL $operatedate DAY), '".$userdata["tid"]."', now(),0,'".$_POST["pricenew"]."',truncate(".($_POST["pricenew"] * $_POST["amountnew"]).",0) ,'', '".$_POST["option"]."')"; $result=mysql_query($strsql,$my_con); $errcode =@mysql_errno(); $totalgram += $_POST{"gram".$y}[$pi]; Testecho ($y." ROW:".mysql_affected_rows()." ".$strsql."
"); #debug mysql_sql_log($strsql,mysql_affected_rows(),$_SERVER['SCRIPT_NAME'].":".__LINE__); $data = dbselect("max(shukkaid)","`".$company."shukka`","orderid = 0 and shozokuid ='".$_POST["newshozokuid"]."' and operatedate = DATE_ADD(CURDATE(),INTERVAL $orderdate DAY) ",-1,-1); //価格更新・定かん $strsql = "UPDATE `".$company."shukka` as shu,`".$company."shozokushohin` as ss SET cominprice_piece = nohinprice,price_piece = nohinprice,price_total = truncate(shukkaqty * nohinprice,0) WHERE shu.shohincd = ss.shohincd and shu.shozokuid = ss.shozokuid and shu.shukkaid = '".$data[0][0]."'"; $result=mysql_query($strsql,$my_con); $errcode =@mysql_errno(); Testecho ($y." ROW:".mysql_affected_rows()." ".$strsql."
"); #debug mysql_sql_log($strsql,mysql_affected_rows(),$_SERVER['SCRIPT_NAME'].":".__LINE__); //紐付けにない場合はマスター価格から更新する if (mysql_affected_rows() == 0) { $strsql = "UPDATE `".$company."shukka` as shu,`".$company."shohinmaster` as ss SET cominprice_piece = price_sell,price_piece = price_sell,price_total = truncate(shukkaqty * price_sell,0) WHERE shu.shohincd = ss.shohincd and shu.shukkaid = '".$data[0][0]."'"; $result=mysql_query($strsql,$my_con); $errcode =@mysql_errno(); Testecho ($y." ROW:".mysql_affected_rows()." ".$strsql."
"); #debug mysql_sql_log($strsql,mysql_affected_rows(),$_SERVER['SCRIPT_NAME'].":".__LINE__); } //不定貫 $totalgram = 0; for ($pi = 0; $pi < 5; $pi++) { if (($_POST{"gramnew"}[$pi] <> "") and (Numchecker6403($_POST{"gramnew"}[$pi]) == "CHR")) { //0.数値欄に文字が入れられたら何も更新しない。 $errmsg .= "数値以外の入力値がありましたので、更新できない商品がありました。No.".($y + 1)." [".$_POST{"newitem".$y}."]
";$errcount++; } elseif(Numchecker2($_POST{"gramnew"}[$pi]) > 0) { $strsql = "INSERT INTO `".$company."shukkafuteikan`(shukkaid,gram,creater,createdate) VALUES('".$data[0][0]."','".$_POST{"gramnew"}[$pi]."','".$userdata["tid"]."',now())";$okcount++; $result=mysql_query($strsql,$my_con); $errcode =@mysql_errno(); $totalgram += $_POST{"gramnew"}[$pi]; Testecho ($y." ROW:".mysql_affected_rows()." ".$strsql."
"); #debug mysql_sql_log($strsql,mysql_affected_rows(),$_SERVER['SCRIPT_NAME'].":".__LINE__); } } //出荷実績の不定貫合計重量TOTALGRAM更新、合計金額計算 if($totalgram > 0) { $strsql = "UPDATE `".$company."shukka` SET totalgram = '".$totalgram."' ,price_total = truncate(".$totalgram." * price_piece,0) WHERE shukkaid= '".$data[0][0]."'"; $result=mysql_query($strsql,$my_con); $errcode =@mysql_errno(); Testecho ($y." ROW:".mysql_affected_rows()." ".$strsql."
"); #debug mysql_sql_log($strsql,mysql_affected_rows(),$_SERVER['SCRIPT_NAME'].":".__LINE__); } } } //全更新処理 if ($_POST[allsubmit] == "cancel") { //フラグを処理解除へ For ($y=0;$y< $_POST[row];$y++) { $strsql = "UPDATE `".$company."shukka` set shukkaflg=1, updater='".$userdata["tid"]."' WHERE shukkaflg in(2,3,4) and shukkaid= '".$_POST{"id".$y}."' LIMIT 1"; $result=@mysql_query($strsql,$my_con); mysql_sql_log($strsql,mysql_affected_rows(),$_SERVER['SCRIPT_NAME'].":".__LINE__); } //注文メモ更新 $strsql = "SELECT shozokuid,sum(case when shukkaflg>=2 then 1 else 0 end) as fixqty, count(shukkaid) as cnt FROM `".$company."shukka` as shu WHERE operatedate= DATE_ADD(CURDATE(),INTERVAL $orderdate DAY) and shukkaqty <>0 GROUP BY shozokuid having fixqty <> cnt"; $strsql = "UPDATE `".$company."ordermemo` SET kakutei = '0' WHERE operatedate= DATE_ADD(CURDATE(),INTERVAL $orderdate DAY) and ".dbselectin($strsql," shozokuid in "); $result=@mysql_query($strsql,$my_con); Testecho ($y." ROW:".mysql_affected_rows()." ".$strsql."
"); #debug mysql_sql_log($strsql,mysql_affected_rows(),$_SERVER['SCRIPT_NAME'].":".__LINE__); } else { //注文メモ更新 全部完了したらフラグを更新する $strsql = "SELECT shozokuid,sum(case when shukkaflg>=2 then 1 else 0 end) as fixqty, count(shukkaid) as cnt FROM `".$company."shukka` as shu WHERE operatedate= DATE_ADD(CURDATE(),INTERVAL $orderdate DAY) and shukkaqty <>0 GROUP BY shozokuid having fixqty = cnt";$strsql = "UPDATE `".$company."ordermemo` SET kakutei = '1' WHERE operatedate= DATE_ADD(CURDATE(),INTERVAL $orderdate DAY) and ".dbselectin($strsql," shozokuid in "); $result=@mysql_query($strsql,$my_con); Testecho ($y." ROW:".mysql_affected_rows()." ".$strsql."
"); #debug mysql_sql_log($strsql,mysql_affected_rows(),$_SERVER['SCRIPT_NAME'].":".__LINE__); } if (($_POST[allsubmit] == "update") or ($_POST[allsubmit] == "kakutei")){ //出荷実績の定貫の合計金額計算 $strsql = "UPDATE `".$company."shukka` as shu,`".$company."shohinmaster` as sm SET price_total = truncate(shukkaqty * price_piece,0) ,`price_piece2`=price_buy,price_total2 = truncate(shukkaqty * price_buy,0) WHERE shohin_kubun3 = 0 and operatedate = DATE_ADD(CURDATE(),INTERVAL $operatedate DAY) and shu.shohincd = sm.shohincd"; $result=mysql_query($strsql,$my_con); $errcode =@mysql_errno(); Testecho ($y." ROW:".mysql_affected_rows()." ".$strsql."
"); #debug mysql_sql_log($strsql,mysql_affected_rows(),$_SERVER['SCRIPT_NAME'].":".__LINE__); //出荷実績の不定貫合計金額計算 $strsql = "UPDATE `".$company."shukka` as shu,`".$company."shohinmaster` as sm SET price_total = truncate(totalgram * price_piece,0),`price_piece2`=price_buy,price_total2 = truncate(totalgram * price_buy,0) WHERE shohin_kubun3 = 1 and operatedate = DATE_ADD(CURDATE(),INTERVAL $operatedate DAY) and shu.shohincd = sm.shohincd and shu.shukkaflg in (1,2)"; $result=mysql_query($strsql,$my_con); $errcode =@mysql_errno(); Testecho ($y." ROW:".mysql_affected_rows()." ".$strsql."
"); #debug mysql_sql_log($strsql,mysql_affected_rows(),$_SERVER['SCRIPT_NAME'].":".__LINE__); //オプション加工 $strsql = "UPDATE `".$company."shukka` as shu,`".$company."shohinmaster` as sm SET price_piece3 = 100, price_total3 = truncate(100 * totalgram,0) WHERE operatedate = DATE_ADD(CURDATE(),INTERVAL $operatedate DAY) and shu.shohincd = sm.shohincd and shu.memo2 in (3,4) and shu.shukkaflg in (1,2)"; $result=mysql_query($strsql,$my_con); $errcode =@mysql_errno(); Testecho ($y." ROW:".mysql_affected_rows()." ".$strsql."
"); #debug mysql_sql_log($strsql,mysql_affected_rows(),$_SERVER['SCRIPT_NAME'].":".__LINE__); $strsql = "UPDATE `".$company."shukka` as shu,`".$company."shohinmaster` as sm SET price_piece3 = 200, price_total3 = truncate(200 * totalgram,0) WHERE operatedate = DATE_ADD(CURDATE(),INTERVAL $operatedate DAY) and shu.shohincd = sm.shohincd and shu.memo2 in (1,5) and shu.shukkaflg in (1,2)"; $result=mysql_query($strsql,$my_con); $errcode =@mysql_errno(); Testecho ($y." ROW:".mysql_affected_rows()." ".$strsql."
"); #debug mysql_sql_log($strsql,mysql_affected_rows(),$_SERVER['SCRIPT_NAME'].":".__LINE__); $strsql = "UPDATE `".$company."shukka` as shu,`".$company."shohinmaster` as sm SET price_piece3 = 150, price_total3 = truncate(150 * totalgram,0) WHERE operatedate = DATE_ADD(CURDATE(),INTERVAL $operatedate DAY) and shu.shohincd = sm.shohincd and shu.memo2 in (2) and shu.shukkaflg in (1,2)"; $result=mysql_query($strsql,$my_con); $errcode =@mysql_errno(); Testecho ($y." ROW:".mysql_affected_rows()." ".$strsql."
"); #debug mysql_sql_log($strsql,mysql_affected_rows(),$_SERVER['SCRIPT_NAME'].":".__LINE__); //業態料率計算 brand 価格2 for ($i = 0; $i < sizeof($codedata120); $i++) { //不定貫hohin_kubun3 = 1 //定貫shohin_kubun3 = 0 $strsql ="update cool_shukka as a , cool_shohinmaster as b , cool_shozokumaster as c set price_piece2 = truncate(price_piece * ".$codedata120[$i][0].",0), price_total2 = truncate(truncate(price_piece * ".$codedata120[$i][0].",0) * totalgram,0) where a.shohincd = b.shohincd and shohin_kubun3 = 1 and a.shozokuid = c.shozokuid and a.operatedate = DATE_ADD(CURDATE(),INTERVAL $operatedate DAY) and c.brand = ".$codedata120[$i][1]." and a.shukkaflg in (1,2)"; $result=mysql_query($strsql,$my_con); $errcode =@mysql_errno(); Testecho ($y." ROW:".mysql_affected_rows()." ".$strsql."
"); #debug mysql_sql_log($strsql,mysql_affected_rows(),$_SERVER['SCRIPT_NAME'].":".__LINE__); //定貫 $strsql ="update cool_shukka as a , cool_shohinmaster as b , cool_shozokumaster as c set price_piece2 = truncate(price_piece * ".$codedata120[$i][0].",0), price_total2 = truncate(truncate(price_piece * ".$codedata120[$i][0].",0) * shukkaqty,0) where a.shohincd = b.shohincd and shohin_kubun3 = 0 and a.shozokuid = c.shozokuid and a.operatedate = DATE_ADD(CURDATE(),INTERVAL $operatedate DAY) and c.brand = ".$codedata120[$i][1]." and a.shukkaflg in (1,2)"; $result=mysql_query($strsql,$my_con); $errcode =@mysql_errno(); Testecho ($y." ROW:".mysql_affected_rows()." ".$strsql."
"); #debug mysql_sql_log($strsql,mysql_affected_rows(),$_SERVER['SCRIPT_NAME'].":".__LINE__); } //鮮魚の一幸はリクエスト商品は0ではなくて199001に更新する $strsql ="update cool_shukka set memoadd = concat(memo3,ifnull(memoadd ,'')) ,shohincd='199001' where shohincd='0' and brand in (30,31) and operatedate = curdate()"; $result=mysql_query($strsql,$my_con); $errcode =@mysql_errno(); Testecho ($y." ROW:".mysql_affected_rows()." ".$strsql."
"); #debug mysql_sql_log($strsql,mysql_affected_rows(),$_SERVER['SCRIPT_NAME'].":".__LINE__); //送料は同じ $strsql ="update cool_shukka as a set price_piece2 = price_piece, price_total2 = price_total where a.shohincd = 99999 and a.shukkaflg in (1,2)"; $result=mysql_query($strsql,$my_con); $errcode =@mysql_errno(); Testecho ($y." ROW:".mysql_affected_rows()." ".$strsql."
"); #debug mysql_sql_log($strsql,mysql_affected_rows(),$_SERVER['SCRIPT_NAME'].":".__LINE__); //ブランドとセンター $strsql ="UPDATE `cool_shukka` as shu,cool_shozokumaster as sho set shu.brand=sho.brand,shu.centerid=sho.centerid where shu.shozokuid=sho.shozokuid and shu.operatedate >=curdate()"; $result=mysql_query($strsql,$my_con); $errcode =@mysql_errno(); Testecho ($y." ROW:".mysql_affected_rows()." ".$strsql."
"); #debug mysql_sql_log($strsql,mysql_affected_rows(),$_SERVER['SCRIPT_NAME'].":".__LINE__); } //レコードの指定 if ($_POST[pagenum] == "") { $page = 1; } else { $page = (int)$_POST[pagenum]; } //表示順の指定 if ($_POST[order] == "") { $order = 1; } else { $order = (int)$_POST[order]; } //データ取得数 $limit = " LIMIT ".($pageset*($page - 1)).",$pageset"; //検索用語 /*if ($shohincd <> "") { $strsqlwhere .= " and shu.shohincd = '".$shohincd."'"; $strsqlorderby = "shu.route,shu.shozokuid,shu.shomi,shu.stockdate"; } else { $strsqlorderby = "shu.shozokuid,shu.shohincd,shu.shomi,shu.stockdate"; } */ $strsqlwhere .= " and shu.centerid = '".$centerid."'"; $strsqlwhere .= " and ((shu.shukkaqty <> 0 ) or (shu.shohincd = '0')) "; //出荷データをメインに、外部接続でリストを取り出す $strsql = "SELECT shukkaid,shukkaflg,shu.shohincd,shu.shozokuid,shu.shukkaqty,shu.centerid,shu.operatedate,shu.operatedate,makercode,shohinmei,sheet.orderqty,totalgram,shu.shomi,shu.stockdate,shu.lotnum,sm.shohin_kubun3,sm.kikaku,shu.cominprice_piece,shu.price_piece,shu.price_total,shu.price_piece2,shu.price_total2,shu.price_piece3,shu.price_total3,shu.memo2,shu.memo3,shu.memo,shu.memoadd ,shu.route,shu.stockdate,shu.shomi,lotnum,sm.ryutu_type FROM ( `".$company."shukka` AS shu INNER JOIN `".$company."shohinmaster` AS sm USING (shohincd)) LEFT JOIN `".$company."ordersheet` AS sheet on (shu.orderid=sheet.orderid) WHERE shu.operatedate=DATE_ADD(CURDATE(),INTERVAL $orderdate DAY) $strsqlwhere $strsqmaker $strsqlshozoku $strwhereflg ORDER BY ".$strsqlorderby; //全数 $result=@mysql_query($strsql,$my_con); $maxrow=@mysql_num_rows($result); $data=@mysql_fetch_array($result); $updateflg = $data[shukkaflg]; //1:更新可 2:確定済み更新可 3:締め済み更新不可 //1ページ分 $strsql .= $limit; $result=@mysql_query($strsql,$my_con); $row=@mysql_num_rows($result); ?>
出荷作業日
区分
センター
納品先
商品
不定貫
onclick="document.sww.Submit.disabled=true;submitALL2();return false;">有り
確定区分


0) { if ($okcount > 0 ){ PrintMsg("","$okcount 件のデータを更新しました。",700); } if ($errcount > 0 ){ PrintMsg("登録エラーが $errcount 件有りました。","",700); } PrintMsg($errmsg,"",700); } ?>
出荷作業日:  "") { echo " 商品検索:$sw"; } echo " 該当件数:".$maxrow."件 "; ?>


""){ $center_sql = "centerid = '".$_POST[center]."' and "; } while ($i<$row) { $data=@mysql_fetch_array($result); //表示だけ //0センター名、1サプライヤー名、2商品コード、3商品名、4注文数、5注文日、6発送数、7チェックフラグ、8センターコード、9納品先名、10納品先コード、11発送日 if ($futeikan==1) { //不定貫データ //$strsql2 = "SELECT gram FROM `".$company."shukkafuteikan` WHERE shukkaid = '".$data[shukkaid]."' ORDER BY shukkafuteikanid"; $strsql2 = "SELECT gram FROM `".$company."shukkafuteikan` WHERE shukkaid = '".$data[shukkaid]."' ORDER BY shukkafuteikanid limit 1"; //入力箇所を1つに $result2=@mysql_query($strsql2,$my_con); // Testecho ($y." $errcode ".$strsql2); #debug mysql_sql_log2($strsql2,$_SERVER['SCRIPT_NAME'].":".__LINE__); } ?> ">
No ルート [CODE]
納品先
商品コード 商品名 備考 注文数 在庫情報 出荷数 合計
重量
重量(Kg) 設定
店着単価
変更
店着単価
店着
小計
仕入
単価2
仕入
小計2
加工
単価
加工
小計
特記
検索結果はゼロ件でした。

"0") { //発送確定締め済みでないなら変更可能 echo $data[shohinmei]; //商品名 } elseif ((int)$data[shukkaflg] >= 2) { echo $data[memo3]; } else { ?> 0) { $lotqty = dbselect("nonreserveqty",$company."stockdata","lotnum = ".$data["lotnum"],-1,-1); $lotqty2 = dbselect("sum(nonreserveqty)",$company."stockdata",$center_sql." shohincd = ".$data["shohincd"]." and nonreserveqty > 0 GROUP by shohincd",-1,-1); echo "賞 ".$data[shomi]."
入 ".$data[stockdate]."
全:".(int)$lotqty2[0][0]." L:".$data["lotnum"]." 残".(int)$lotqty[0][0].""; ?>
" class="EDIT" tabindex=""> = 0) { $pi = 0; while ($data2=@mysql_fetch_array($result2)) { if($data[shohin_kubun3] == 0) { if($data[memo2] > 0) { //加工オプション有り echo "定貫(加工賃算出用)"; echo " "; } else { echo "-"; } } else { // echo "不定貫"; echo " "; } if (($pi%5)==4){echo "
\n";} $pi++; } //個数が足りない場合 if ($pi < abs($data[shukkaqty])) { //入力箇所を1つに // for ($pi = $pi; $pi < $data[shukkaqty]; $pi++) { for ($pi = $pi; $pi < 1; $pi++) { if($data[shohin_kubun3] == 0) { if($data[memo2] > 0) { echo "定貫(加工賃算出用)"; echo " "; } else { echo "-"; } } else { // echo "不定貫"; echo " "; } if (($pi % 5) == 4){echo "
\n";} } } } } ?>
".number_format($data2[gram],3).""; if (($pi%5)==0){echo "
\n";} $pi++; } } ?>
合計 合計 合計
追加 出荷数
重量
"; if (($pi % 5) == 4){echo "
\n";} } ?>

3) AND ($orderdate >= -90)) { //3日前過去日まで 締め済み訂正可 ?> 3) AND ($updateflg > 2)) { //締め済み訂正不可 ?>

= 0 ) { return $cknumber; //マイナス以外の数字なら数値で返す } elseif ($cknumber < 0 ) { return $cknumber; //マイナス数字なら数値で返す } else { return "NO-MATCH"; //数値でないならNO-MATCHで返す } } } Testecho($strsql); ?>