diff --git a/wms/contract/api/createFacilityNo.php b/wms/contract/api/createFacilityNo.php index 4ae4adbb..3c92c600 100644 --- a/wms/contract/api/createFacilityNo.php +++ b/wms/contract/api/createFacilityNo.php @@ -1,9 +1,12 @@ false, @@ -19,7 +41,7 @@ class CreateFacilityNo PDO::ATTR_STRINGIFY_FETCHES => false, PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4', ]; - $pdo = new PDO('mysql:host=localhost;port=3306;dbname=appwms', 'masadaroot', 'x6h5E5p#u8y', $options); + $pdo = new PDO('mysql:host=' . $host . ';port=' . $dbport . ';dbname=' . $dbname . '', $dbuser, $dbpassword, $options); $pdo->exec('SET CHARACTER SET utf8mb4'); return $pdo; } catch (PDOException $e) { @@ -199,8 +221,8 @@ class CreateFacilityNo } foreach ($new_facility_no_arr as $new_facility_no) { - if ($this->getMakeNewTFacilityNoStatus($faclikity_details) !== "1") { - return $new_facility_no . ":" . $this->getMakeNewTFacilityNoStatus($faclikity_details); + if ($this->getMakeNewBFacilityNoStatus($faclikity_details) !== "1") { + return $new_facility_no . ":" . $this->getMakeNewBFacilityNoStatus($faclikity_details); } // seq +1 $this->facilitySeqAddOne("B"); @@ -215,11 +237,8 @@ class CreateFacilityNo */ function getMakeNewMFacilityNoStatus($faclikity_details) { - $Y = substr(date("Y"), 3, 1); $sale_type = $faclikity_details['sale_type']; $make_type = $faclikity_details['make_type']; - $next_seq = $this->getNextFacilitySeq("mf_vol_no"); - $new_facility_no = $Y . $sale_type . $make_type . str_pad($next_seq + 1, 5, "0", STR_PAD_LEFT); if ($this->checkSaleTypeStatus($sale_type) == false) return "銷售代號錯誤"; @@ -235,14 +254,25 @@ class CreateFacilityNo */ function getMakeNewTFacilityNoStatus($faclikity_details) { - $Y = substr(date("Y"), 3, 1); $sale_type = $faclikity_details['sale_type']; $make_type = $faclikity_details['make_type']; - $num = $faclikity_details['num']; - $next_seq = $this->getNextFacilitySeq("mf_vol_no"); - $new_facility_no = $Y . $sale_type . $make_type - . str_pad($next_seq + 1, 3, "0", STR_PAD_LEFT) - . str_pad($num, 2, "0", STR_PAD_LEFT); + + if ($this->checkSaleTypeStatus($sale_type) == false) + return "銷售代號錯誤"; + if ($this->checkMakeTypeStatus($make_type) == false) + return "製造編號類型錯誤"; + return "1"; + } + + /** + * 檢查作番編列狀態 - 保養 + * @param array $faclikity_details + * @return string $status : 1:正確 else:error message + */ + function getMakeNewBFacilityNoStatus($faclikity_details) + { + $sale_type = $faclikity_details['sale_type']; + $make_type = $faclikity_details['make_type']; if ($this->checkSaleTypeStatus($sale_type) == false) return "銷售代號錯誤"; @@ -468,14 +498,13 @@ class CreateFacilityNo } -$cfn = new CreateFacilityNo; - -// 建立作番號 - 新梯 -print_r($cfn->makeMFacilityNo("M", "X", 5)); -echo ""; -// 建立作番號 - 汰改 -print_r($cfn->makeTFacilityNo( "M", "X", 1)); -echo ""; -// 建立作番號 - 保養 -print_r($cfn->makeBFacilityNo( "M", "X", 1)); -echo ""; \ No newline at end of file +// $cfn = new CreateFacilityNo; +// // 建立作番號 - 新梯 +// print_r($cfn->makeMFacilityNo("M", "X", 5)); +// echo ""; +// // 建立作番號 - 汰改 +// print_r($cfn->makeTFacilityNo("M", "X", 1)); +// echo ""; +// // 建立作番號 - 保養 +// print_r($cfn->makeBFacilityNo("M", "X", 1)); +// echo ""; diff --git a/wms/css/dataTables.fixedColumns.min.js b/wms/css/dataTables.fixedColumns.min.js new file mode 100644 index 00000000..f8202b8e --- /dev/null +++ b/wms/css/dataTables.fixedColumns.min.js @@ -0,0 +1,4 @@ +/*! FixedColumns 4.3.0 + * © SpryMedia Ltd - datatables.net/license + */ +!function(e){var i,o;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(t){return e(t,window,document)}):"object"==typeof exports?(i=require("jquery"),o=function(t,s){s.fn.dataTable||require("datatables.net")(t,s)},"undefined"==typeof window?module.exports=function(t,s){return t=t||window,s=s||i(t),o(t,s),e(s,0,t.document)}:(o(window,i),module.exports=e(i,window,window.document))):e(jQuery,window,document)}(function(o,t,s,F){"use strict";var A,i,e,l,d=o.fn.dataTable;function r(t,s){var e=this;if(i&&i.versionCheck&&i.versionCheck("1.10.0"))return t=new i.Api(t),this.classes=A.extend(!0,{},r.classes),this.c=A.extend(!0,{},r.defaults,s),s&&s.left!==F||this.c.leftColumns===F||(this.c.left=this.c.leftColumns),s&&s.right!==F||this.c.rightColumns===F||(this.c.right=this.c.rightColumns),this.s={barWidth:0,dt:t,rtl:"rtl"===A("body").css("direction")},s={bottom:"0px",display:"block",position:"absolute",width:this.s.barWidth+1+"px"},this.dom={leftBottomBlocker:A("