@@ -343,21 +330,29 @@ try {
$(document).ready(function() {
$("#ProjectId").selectize();
$("#CU_MaterialId").selectize();
- $("#comSupplierName").selectize();
})
- $(function() {
- $("#comSupplierName").change(function() {
- if ($("#comSupplierName").val() == "雜項請款用") {
- $("#Tax").show();
- } else {
- $("#Tax").hide();
- }
- })
- $("#TaxNo").change(function() {
- if ($("#TaxNo").val().length !== 8) {
+ function checkBiz() {
+ if ($("#TaxNo").val().length !== 8) {
alert("統一編號格式錯誤");
+ }else{
+ var biz = $("#TaxNo").val();
+ var BizArray = ;
+ var answer = 0;
+ for (var partner = 0; partner < = $bizcount ?>; partner++){
+ var value = BizArray[partner];
+ if (biz == value){
+ answer +=1
}
- })
+ }
+ if (answer==1){
+ alert("供應商認證成功")
+ }else{
+ alert("T8內無此供應商")
+ }
+ }
+
+ }
+ $(function() {
$("#VoucherType").change(function() {
if ($("#VoucherType").val() !== "0") {
$("#NotInvoice1").hide();
diff --git a/wms/rib02-edit.php b/wms/rib02-edit.php
index 1c263ce5..2665a7c2 100644
--- a/wms/rib02-edit.php
+++ b/wms/rib02-edit.php
@@ -38,30 +38,28 @@ foreach ($allpeople as $man) {
//取得部門代碼
$sql_department = "SELECT DeptId,DeptName FROM comDepartment WHERE DeptId!='0001'";
$deptype = $conn->query($sql_department);
-$conn = null;
//取得計量單位
$sql_unit = "SELECT * FROM unit";
$unit_query = mysqli_query($link, $sql_unit);
$unit = mysqli_fetch_all($unit_query, MYSQLI_ASSOC);
-// 連線T8MASADA 取得供應商、合約跟作番號
-try {
- $conn = new PDO("sqlsrv:Server=60.244.87.101;Database=T8MASADA", "masada", "@m222222");
- if ($conn) {
- $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- $sql_Biz = "SELECT * FROM comBusinessPartner";
- $BizPartner = $conn->query($sql_Biz);
- $sql_Project = "SELECT * FROM comProject";
- $projects = $conn->query($sql_Project);
- $sql_Material = "SELECT * FROM comMaterialGroup";
- $materials = $conn->query($sql_Material);
- $conn = null;
- }
-} catch (PDOException $e) {
- echo "fail";
- echo $e->getMessage();
+// 取得供應商、合約跟作番號
+$BusinessPartner = array();
+$sql_Biz = "SELECT comBusinessPartner.BizPartnerId, comBusinessPartner.BizPartnerName FROM comBusinessPartner INNER JOIN comSupplier ON comBusinessPartner.BizPartnerId=comSupplier.BizPartnerId WHERE comBusinessPartner.BizPartnerId !='V0001'";
+$BizPartner = $conn->query($sql_Biz);
+$bizcount = 0;
+foreach ($BizPartner as $biz) {
+ $bizKey = $biz['BizPartnerId'];
+ $bizValue = $biz['BizPartnerName'];
+ array_push($BusinessPartner,$bizKey);
+ $bizcount +=1;
}
+$BizJSON = json_encode($BusinessPartner);
+$sql_Project = "SELECT * FROM comProject";
+$projects = $conn->query($sql_Project);
+$sql_Material = "SELECT * FROM comMaterialGroup";
+$materials = $conn->query($sql_Material);
?>
@@ -419,26 +417,9 @@ try {
@@ -459,24 +440,30 @@ try {
$(document).ready(function() {
$("#ProjectId").selectize();
$("#CU_MaterialId").selectize();
- $("#comSupplierName").selectize();
})
- var TempArr = [];
- $(function() {
- $("#comSupplierName").change(function() {
- if ($("#comSupplierName").val() == "雜項請款用") {
- $("#Tax").show();
- } else {
- $("#Tax").hide();
- }
- })
-
-
- $("#TaxNo").change(function() {
- if ($("#TaxNo").val().length !== 8) {
+ function checkBiz() {
+ if ($("#TaxNo").val().length !== 8) {
alert("統一編號格式錯誤");
+ }else{
+ var biz = $("#TaxNo").val();
+ var BizArray = ;
+ var answer = 0;
+ for (var partner = 0; partner < = $bizcount ?>; partner++){
+ var value = BizArray[partner];
+ if (biz == value){
+ answer +=1
}
- })
+ }
+ if (answer==1){
+ alert("供應商認證成功")
+ }else{
+ alert("T8內無此供應商")
+ }
+ }
+
+ }
+ var TempArr = [];
+ $(function() {
$("#VoucherType").change(function() {
if ($("#VoucherType").val() !== "0") {
$("#NotInvoice1").hide();
@@ -581,21 +568,6 @@ try {
}
})
- $("#comSupplierIdNum option").each(function(index, el) {
- TempArr[index] = $(this).text();
- })
- $(document).bind('click', function(e) {
- var e = e || window.event;
- var elem = e.target || e.srcElement;
- while (elem) {
- if (elem.id && (elem.id == 'comSupplierIdNum' || elem.id == "comSupplierName")) {
- return;
- }
- elem = elem.parentNode;
- }
- $('#comSupplierIdNum').css('display', 'none');
- });
-
$("#Price").change(function() {
$("#OAmount").val($("#Quantity").val() * $("#Price").val());
$("#LAmount").val($("#OAmount").val() * $("#CurrLAmount").val());
@@ -649,44 +621,10 @@ try {
})
function ShowInvoice() {
- // $("#Invoice").show();
window.open('rib02-invoice.php', '新視窗的名稱', config = 'height=600, width=600');
}
- function changeF(this_) {
- $(this_).prev("input").val($(this_).find("option:selected").text());
- $("#comSupplierIdNum").css({
- "display": "none"
- });
- }
-
- function setfocus(this_) {
- $("#comSupplierIdNum").css({
- "display": ""
- });
- var select = $("#comSupplierIdNum");
- select.empty();
- if (select) {
- $("#comSupplierIdNum").attr("size", 5);
- for (i = 0; i < TempArr.length; i++) {
- var option = new Option(TempArr[i], TempArr[i]);
- select.append(option);
- }
- }
- }
-
- function setinput(this_) {
- var select = $("#comSupplierIdNum");
- select.html("");
- for (i = 0; i < TempArr.length; i++) {
- if (TempArr[i].indexOf(this_.value) >= 0) {
- var option = new Option(TempArr[i], TempArr[i]);
- select.append(option);
- }
- }
- }
-
function changeWriteOffId(SelectedDept) {
var SelectDeptId = 'WriteOff' + SelectedDept + '-';
for (var i = 0; i < WriteOffId.options.length; i++) {
diff --git a/wms/rib02-submit.php b/wms/rib02-submit.php
index 712e1adf..17b17f11 100644
--- a/wms/rib02-submit.php
+++ b/wms/rib02-submit.php
@@ -5,6 +5,15 @@ $ribsub_id = isset($_GET['ribsub_id']) ? $_GET['ribsub_id'] : Null;
$submit = $_GET['submit'];
$state = empty($_GET['state']) ? 0 : $_GET['state'];
+// 取得供應商
+$BusinessPartner = array();
+$sql_Biz = "SELECT comBusinessPartner.BizPartnerId, comBusinessPartner.BizPartnerName FROM comBusinessPartner INNER JOIN comSupplier ON comBusinessPartner.BizPartnerId=comSupplier.BizPartnerId WHERE comBusinessPartner.BizPartnerId !='V0001'";
+$BizPartner = $conn->query($sql_Biz);
+foreach ($BizPartner as $biz) {
+ $bizKey = $biz['BizPartnerId'];
+ $bizValue = $biz['BizPartnerName'];
+ $BusinessPartner[$bizKey]=$bizValue;
+}
$RowCode = $_POST['RowCode'];
$FeeDate = $_POST['FeeDate'];
@@ -26,7 +35,7 @@ $VoucherCount = empty($_POST['VoucherCount']) ? 1 : $_POST['VoucherCount'];
$VoucherType = isset($_POST['VoucherType']) ? $_POST['VoucherType'] : 0;
$InvoiceNo = empty($_POST['InvoiceNo']) ? NULL : $_POST['InvoiceNo'];
$CurrId = empty($_POST['CurrId']) ? null : $_POST['CurrId'];
-$comSupplierName = empty($_POST['comSupplierName']) ? null : $_POST['comSupplierName'];
+// $comSupplierName = empty($_POST['comSupplierName']) ? null : $_POST['comSupplierName'];
$FromSourceTag = 0;
$TaxRate = ($TaxId == "ST005") ? 0.05 : 0;
$OTax = isset($_POST['OTax']) ? $_POST['OTax'] : NULL;
@@ -35,6 +44,15 @@ $OAmountUnWithTax = isset($_POST['OAmountUnWithTax']) ? $_POST['OAmountUnWithTax
$LAmountUnWithTax = isset($_POST['LAmountUnWithTax']) ? $_POST['LAmountUnWithTax'] : null;
$LAmount = isset($_POST['LAmount']) ? $_POST['LAmount'] : null;
$TaxNo = empty($_POST['TaxNo']) ? '' : $_POST['TaxNo'];
+if (empty($TaxNo)){
+ $comSupplierName = "雜項請款用";
+}else{
+ if (isset($BusinessPartner[$TaxNo])){
+ $comSupplierName= $BusinessPartner[$TaxNo];
+ }else{
+ $comSupplierName = "雜項請款用";
+ }
+}
if (isset($comSupplierName) && ($comSupplierName != "雜項請款用")) {
diff --git a/wms/schedule-index.php b/wms/schedule-index.php
index 6125d9c8..f6d07a00 100644
--- a/wms/schedule-index.php
+++ b/wms/schedule-index.php
@@ -4,12 +4,16 @@ include "header.php";
$tourl = $_SERVER["SCRIPT_NAME"]."?function_name=schedule&token=".$token;
// 工務總處可瀏覽全部資料
-$sql = "select department_id from account where accountid = '$user_id'";
+$sql = "select department_id, role_id from account where accountid = '$user_id'";
$res = mysqli_query($link, $sql);
$row = mysqli_fetch_row($res);
$user_department_id = $row[0];
+$user_role_id = $row[1];
mysqli_free_result($res);
+// 各區工務助理專員可瀏覽全部
+$dr_arr = ['3114', '3133', '3144', '3152'];
+
if (!isset($_GET["p"]) || $_GET["p"] <= 0) $p = 1;
else $p = $_GET["p"];
$page_each = 50;
@@ -22,6 +26,7 @@ $page_close = 0;
$sql_cmd2 = "";
$sql_cmd = sql_myself($user_id);
if ($user_department_id == "501" || $user_department_id == "322" || $user_id == "M0012" || $user_id == "M0105") $sql_cmd = "";
+if (in_array($user_department_id.$user_role_id, $dr_arr)) $sql_cmd = "";
//if (empty($sql_cmd)) $sql_cmd = "where ";
if (!empty($_GET["contractno"])) $sql_cmd2 .= "and contractno = '".$_GET["contractno"]."' ";
if (!empty($_GET["facilityno"])) $sql_cmd2 .= "and facilityno = '".$_GET["facilityno"]."' ";
diff --git a/wms/sign/list.php b/wms/sign/list.php
index bbdd9a13..b335de8c 100644
--- a/wms/sign/list.php
+++ b/wms/sign/list.php
@@ -90,14 +90,14 @@ $flow_name_opt = (array_unique($flow_name_opt, SORT_REGULAR));
- 待签查询
+ 待簽查詢
|
- 系统名称 |
+ 系統名稱 |
|
- 流程名称 |
+ 流程名稱 |
|